diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 09ed3f146..000000000 --- a/.babelrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "presets": [ - ["es2015", {"loose": true}], - "stage-1", - "react" - ] -} diff --git a/.babelrc.js b/.babelrc.js new file mode 100644 index 000000000..14d7098e7 --- /dev/null +++ b/.babelrc.js @@ -0,0 +1,21 @@ +// @flow + +const es6Compat = process.env.BABEL_ES_COMPAT === "6" || process.env.NODE_ENV === "test"; + +module.exports = { + presets: [ + [ + "@babel/preset-env", + { + targets: es6Compat ? "maintained node versions" : "> 0.25%, not dead" + }, + ], + "@babel/react", + "@babel/preset-flow" + ], + plugins: [ + "@babel/plugin-transform-flow-comments", + "@babel/plugin-proposal-class-properties", + "babel-plugin-preval" + ] +}; diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 000000000..53565ed35 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,3 @@ +> 0.25% +ie 11 +not dead \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index 909358744..20a8e98c6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -13,6 +13,11 @@ "rules": { "no-console": 0, "no-use-before-define": [2, "nofunc"], + "no-unused-vars": [1, { + "argsIgnorePattern": "^(e|_.*)$", + "vars": "local", + "varsIgnorePattern": "(debug|^_)" + }], "prefer-const": 2, "react/jsx-boolean-value": [2, "always"] }, @@ -20,5 +25,10 @@ "browser": true, "node": true, "es6": true + }, + "settings": { + "react": { + "version": "detect" + } } } diff --git a/.flowconfig b/.flowconfig index fd497b549..fede8b6ea 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,11 +1,19 @@ [version] -0.65.0 +^0.129.0 [ignore] +/build/.* +/dist/.* +# Speeds parsing: +.*/node_modules/@babel.* +.*/node_modules/babel.* [include] [libs] interfaces/ +flow-typed/ [options] +emoji=true +module.use_strict=true diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000..1c6285154 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,29 @@ +documentation: + - test/examples/**/* + - README.md + - examples/**/* + +core: + - lib/**/* + +release: + - dist/**/* + +tests: + - test/spec/**/* + +deps: + - yarn.lock + +infrastructure: + - .github/**/* + - .babelrc + - .eslintignore + - .eslintrc.json + - .flowconfig + - .gitignore + - .npmignore + - .travis.yml + - build.sh + - package.json + - webpack* \ No newline at end of file diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 000000000..35bb88022 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,14 @@ +--- +name: Pull request labeler +on: + schedule: + - cron: '*/5 * * * *' +jobs: + labeler: + runs-on: ubuntu-latest + steps: + - uses: paulfantom/periodic-labeler@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} + LABEL_MAPPINGS_FILE: .github/labeler.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..f6fc34cdc --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,19 @@ +name: "Close stale issues and PRs" +on: + schedule: + - cron: "0 0,6,12,18 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days' + stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 7 days' + stale-pr-label: 'stale' + exempt-pr-label: 'stale' + days-before-stale: 30 + days-before-close: 7 + operations-per-run: 30 diff --git a/.gitignore b/.gitignore index a22a09030..534a72264 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,9 @@ dist/* npm-debug.log build/ .idea +# Ignore built example files +examples/*.html +examples/*.js +!examples/generate.js +!examples/vars.js +.vscode diff --git a/.npmignore b/.npmignore index d32eafcdd..0ff7871da 100644 --- a/.npmignore +++ b/.npmignore @@ -8,5 +8,8 @@ Makefile *.sh *.*.json __tests__/ +__mocks__/ index-dev.js index.html +flow-typed/ +interfaces/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..dedaa6dc8 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +dist/ +examples/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..95da445fa --- /dev/null +++ b/.prettierrc @@ -0,0 +1,18 @@ +{ + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": false, + "quoteProps": "as-needed", + "jsxSingleQuote": false, + "trailingComma": "none", + "bracketSpacing": true, + "jsxBracketSameLine": false, + "arrowParens": "avoid", + "requirePragma": false, + "insertPragma": false, + "proseWrap": "preserve", + "htmlWhitespaceSensitivity": "css", + "endOfLine": "auto" +} diff --git a/.travis.yml b/.travis.yml index 3bda87ebb..171364650 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,8 @@ language: node_js node_js: - - "6" - - "7" + - 10 + - 12 + - "lts/*" script: - make build test cache: yarn diff --git a/CHANGELOG.md b/CHANGELOG.md index 67069df0e..40a42e398 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,114 @@ # Changelog +0.18.3 (Mar 16, 2020) +---- + +### Bugfixes + - Fix `shouldComponentUpdate` interfering with droppability ([#1152](https://github.com/STRML/react-grid-layout/issues/1152)) + +### Internal Changes + - New Enzyme test suite added to prevent regression. If you have time, we could really use more test cases that reflect your use cases! + +0.18.2 (Feb 26, 2020) +---- + +### Bugfixes + - `shouldComponentUpdate`: + - A too-aggressive implementation of `shouldComponentUpdate` was shipped in 0.18.0-0.18.1 ([#1123](https://github.com/STRML/react-grid-layout/pull/1123)), which did not compare the `children` object. While this works well in many simple implementations of RGL, it breaks in more complex applications. + - Reference equality of `props.children` and `nextProps.children` is now added to `` and ``. If you wish to take advantage of the performance improvements from the `shouldComponentUpdate` work, memoize your children. + - A section has been added to the [README](/README.md#Performance) explaining how this works. + - Fixed [#1150](https://github.com/STRML/react-grid-layout/issues/1150), [#1151](https://github.com/STRML/react-grid-layout/issues/1151). + +0.18.1 (Feb 25, 2020) +---- + +This release contains typedef changes only. + +### Bugfixes + - Flow types: + - Make Props to `` and `` exact. + - Fix loss of props refinement when passing through `WidthProvider`. + - Fix Flow errors as surfaced in [#1138](https://github.com/STRML/react-grid-layout/pull/1138). + - Modify examples to use types so that the above type error can't resurface + +0.18.0 (Feb 25, 2020) +---- + +Thanks to all of our maintainers for this big release. 0.18.0 contains a large number of bugfixes that users have been asking for. Please read the full list so you know what to expect. Some of the biggest improvements include fixing changes of `isResizable`/`isDraggable` without a remount ([#892](https://github.com/STRML/react-grid-layout/pull/892)), fixes to prop changes on `ResponsiveReactGridLayout` ([#1090](https://github.com/STRML/react-grid-layout/pull/1090)), `shouldComponentUpdate` improvements for speed ([#1123](https://github.com/STRML/react-grid-layout/pull/1123)), improvements to droppability ([#1127](https://github.com/STRML/react-grid-layout/pull/1127)), and much more. + +### (Potentially) Breaking Changes + +- You can now locally set `isDraggable`/`isResizable` on a `static` item and it will have that property. This could be useful, but be sure to check your layouts if you use `static`. Relates to [#1060](https://github.com/STRML/react-grid-layout/pull/1060). +- `shouldComponentUpdate` is now implemented on major components to improve render speed while you manipulate the layout. In our testing there are no issues. If you encounter one, please open an issue asap and we'll get it fixed. See [#1123](https://github.com/STRML/react-grid-layout/pull/1123). + +### New Features + +- You can now manipulate `isDraggable`/`isResizable` without the child component remounting. We do this by always rendering the child `` and `` wrappers, optionally in a `disabled` state. This feature has been heavily requested. [#892](https://github.com/STRML/react-grid-layout/pull/892) +- The event is now passed as `e` on the `onDrop` callback. [#1065](https://github.com/STRML/react-grid-layout/pull/1065) +- Pass `transformScale` to `Resizable`. [#1075](https://github.com/STRML/react-grid-layout/pull/1075) + +### Bugfixes + +- Fix handling of width changes in `ResponsiveReactGridLayout`. [#1090](https://github.com/STRML/react-grid-layout/pull/1090) + - Fixes ignored changes of breakpoints and columns. See also [issue #1083](https://github.com/STRML/react-grid-layout/issues/1083). +- Forbid layout change on click without drag. [#1044](https://github.com/STRML/react-grid-layout/pull/1044) +- Do not mutate `layouts` prop. [#1064](https://github.com/STRML/react-grid-layout/pull/1064) +- Ensure locally set `isDraggable`/`isResizable` on a `GridItem` overrides the global setting on the layout. [#1060](https://github.com/STRML/react-grid-layout/pull/1060) +- Avoid additional element jumping when an item is dropped. [#1127](https://github.com/STRML/react-grid-layout/issues/1127) +- Don't use `String#includes` for Firefox test. [#1096](https://github.com/STRML/react-grid-layout/pull/1096) + +### Internal Refactors + +- Added `shouldComponentUpdate` to major elements for speed. Significant [performance improvements](https://github.com/STRML/react-grid-layout/pull/1032#issuecomment-541604763) while dragging. Started in [#1032](https://github.com/STRML/react-grid-layout/pull/1032) and finished in [#1123](https://github.com/STRML/react-grid-layout/pull/1123). + - A [fun trick for the curious](https://github.com/STRML/react-grid-layout/blob/44e200067b3640c3230f5511e8624a7c629d2f9a/lib/fastRGLPropsEqual.js). +- Internal refactor of dropping capability. It is now more predictable and uses similar unit labels (`left`, `top`) to other features. [#1128](https://github.com/STRML/react-grid-layout/issues/1128) +- Upgrade devDependencies. +- Remove ESPower from test suite (not useful with Jest). + + +0.17.1 (Oct 29, 2019) +---- + +### Bugfixes + +- Surround `navigator` check in `try/catch` to avoid problems with mocked navigators [#1057](https://github.com/STRML/react-grid-layout/pull/1054) +- TransformScale is not applied properly while dragging an element [#1046](https://github.com/STRML/react-grid-layout/pull/1054) + +0.17.0 (Oct 24, 2019) +---- + +It's been 18 months since the last release, and this is a pretty large one! For references on the items below, see https://github.com/STRML/react-grid-layout/milestone/1?closed=1. + +Thanks to @daynin and @n1ghtmare for taking an active role in maintaining RGL, and for giving it a much-needed shot in the arm, and thanks to the rest of our contributors. + +### New Features + +- Added ability to drag items into the grid from outside. [#980](https://github.com/STRML/react-grid-layout/pull/980). See [the example](https://strml.github.io/react-grid-layout/examples/15-drag-from-outside.html). + - This is especially exciting as it opens up new "widget toolbox" use cases such as [Example 14](https://strml.github.io/react-grid-layout/examples/14-toolbox.html) with more intuitive interaction. Thanks @daynin. +- `transformScale` prop [#987](https://github.com/STRML/react-grid-layout/pull/987) +- `` now supports margin-per-breakpoint [#1016](https://github.com/STRML/react-grid-layout/pull/1016) + + +### Bugfixes + +- `onWidthChange` only called on breakpoint changes [#770](https://github.com/STRML/react-grid-layout/pull/770) +- Various movement bugs when compaction is off [#766](https://github.com/STRML/react-grid-layout/pull/766) +- Don't fire `onDragStop` if an item is only clicked, not dragged [#1023](https://github.com/STRML/react-grid-layout/pull/1023) +- Fix infinite loop when dragging over a static element. [#1019](https://github.com/STRML/react-grid-layout/pull/1019) + +### Internal Refactors + +- Both `react-draggable` and `react-resizable` dependencies are now React 16.9 compatible, as is now `react-grid-layout`. + - [RGL PR #990](https://github.com/STRML/react-grid-layout/pull/990) + - [react-resizable](https://github.com/STRML/react-resizable/pull/112/commits/541dee69b8e45d91a533855609472b481634edee) + - [react-draggable](https://github.com/mzabriskie/react-draggable/commit/fea778c8e89db2a4e1a35e563b65634f8146e7e4) +- Webpack 4 [#907](https://github.com/STRML/react-grid-layout/pull/907) +- Babel 7 [#1013](https://github.com/STRML/react-grid-layout/pull/1013) +- Flow 0.110 [#995](https://github.com/STRML/react-grid-layout/pull/995) +- Jest [#774](https://github.com/STRML/react-grid-layout/pull/774) +- Various build simplifications [#773](https://github.com/STRML/react-grid-layout/pull/773) +- Various PR bots - thanks @daynin + 0.16.6 (Mar 8, 2018) ---- diff --git a/Makefile b/Makefile index 40cd85514..e0602a9b8 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,8 @@ clean: rm -rf $(BUILD) $(DIST) dev: - @$(BIN)/webpack-dev-server --config webpack-dev-server.config.js --hot --progress --colors --port 4002 --open --content-base . + @$(BIN)/webpack-dev-server --config webpack-dev-server.config.js \ + --hot --progress --colors # Allows usage of `make install`, `make link` install link: @@ -28,26 +29,33 @@ install link: dist/%.min.js: $(LIB) $(BIN) @$(BIN)/webpack -# find/exec is more cross-platform compatible than `rename` build-js: - @$(BIN)/babel --stage 0 --out-dir $(BUILD) $(LIB) + @$(BIN)/babel --out-dir $(BUILD) $(LIB) +# Will build for use on github pages. Full url of page is +# https://strml.github.io/react-grid-layout/examples/0-showcase.html +# so the CONTENT_BASE should adapt. build-example: @$(BIN)/webpack --config webpack-examples.config.js - node ./examples/generate.js - -view-example: build-example - @$(BIN)/opener examples/0-showcase.html + env CONTENT_BASE="/react-grid-layout/examples/" node ./examples/generate.js +view-example: + env CONTENT_BASE="/examples/" node ./examples/generate.js + @$(BIN)/webpack-dev-server --config webpack-examples.config.js --progress --colors # FIXME flow is usually global lint: - ./node_modules/.bin/flow + @$(BIN)/flow @$(BIN)/eslint --ext .js,.jsx $(LIB) $(TEST) - @$(BIN)/valiquire $(LIB) test: - @$(BIN)/jest + env NODE_ENV=test $(BIN)/jest + +test-watch: + env NODE_ENV=test $(BIN)/jest --watch + +test-update-snapshots: + env NODE_ENV=test $(BIN)/jest --updateSnapshot release-patch: build lint test @$(call release,patch) diff --git a/README.md b/README.md index 0e592c55f..b6be7a2d2 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ RGL is React-only and does not require jQuery. - [Grid Layout Props](#grid-layout-props) - [Responsive Grid Layout Props](#responsive-grid-layout-props) - [Grid Item Props](#grid-item-props) +- [User Recipes](../../wiki/Users-recipes) +- [Performance](#performance) - [Contribute](#contribute) - [TODO List](#todo-list) @@ -49,6 +51,9 @@ RGL is React-only and does not require jQuery. 1. [Prevent Collision](https://strml.github.io/react-grid-layout/examples/12-prevent-collision.html) 1. [Error Case](https://strml.github.io/react-grid-layout/examples/13-error-case.html) 1. [Toolbox](https://strml.github.io/react-grid-layout/examples/14-toolbox.html) +1. [Drag From Outside](https://strml.github.io/react-grid-layout/examples/15-drag-from-outside.html) +1. [Bounded Layout](https://strml.github.io/react-grid-layout/examples/16-bounded.html) +1. [Resizable Handles](https://strml.github.io/react-grid-layout/examples/17-resizable-handles.html) #### Projects Using React-Grid-Layout @@ -62,6 +67,10 @@ RGL is React-only and does not require jQuery. - [Reflect](https://reflect.io) - [ez-Dashing](https://github.com/ylacaute/ez-Dashing) - [Kibana](https://www.elastic.co/products/kibana) +- [Graphext](https://graphext.com/) +- [Monday](https://support.monday.com/hc/en-us/articles/360002187819-What-are-the-Dashboards-) +- [Quadency](https://quadency.com/) +- [Hakkiri](https://www.hakkiri.io) *Know of others? Create a PR to let me know!* @@ -79,10 +88,11 @@ RGL is React-only and does not require jQuery. * Responsive breakpoints * Separate layouts per responsive breakpoint * Grid Items placed using CSS Transforms -* Performance: [on](http://i.imgur.com/FTogpLp.jpg) / [off](http://i.imgur.com/gOveMm8.jpg), note paint (green) as % of time + * Performance with CSS Transforms: [on](http://i.imgur.com/FTogpLp.jpg) / [off](http://i.imgur.com/gOveMm8.jpg), note paint (green) as % of time |Version | Compatibility | |----------------|------------------| +| >= 0.17.0 | React 0.16 | | >= 0.11.3 | React 0.14 & v15 | | >= 0.10.0 | React 0.14 | | 0.8. - 0.9.2 | React 0.13 | @@ -118,7 +128,7 @@ import GridLayout from 'react-grid-layout'; class MyFirstGrid extends React.Component { render() { // layout is an array of objects, see the demo for more complete usage - var layout = [ + const layout = [ {i: 'a', x: 0, y: 0, w: 1, h: 2, static: true}, {i: 'b', x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4}, {i: 'c', x: 4, y: 0, w: 1, h: 2} @@ -167,7 +177,7 @@ import { Responsive as ResponsiveGridLayout } from 'react-grid-layout'; class MyResponsiveGrid extends React.Component { render() { // {lg: layout1, md: layout2, ...} - var layouts = getLayoutsFromSomewhere(); + const layouts = getLayoutsFromSomewhere(); return ( ` it is suggested you use the HOC `WidthProvider` as per the instructions below. -For the time being, it is not possible to supply responsive mappings via the `data-grid` property on individual -items, but that is coming soon. +It is possible to supply default mappings via the `data-grid` property on individual +items, so that they would be taken into account within layout interpolation. ### Providing Grid Width @@ -283,19 +293,54 @@ containerPadding: ?[number, number] = margin, // if you like. rowHeight: ?number = 150, +// Configuration of a dropping element. Dropping element is a "virtual" element +// which appears when you drag over some element from outside. +// It can be changed by passing specific parameters: +// i - id of an element +// w - width of an element +// h - height of an element +droppingItem?: { i: string, w: number, h: number } + // // Flags // isDraggable: ?boolean = true, isResizable: ?boolean = true, +isBounded: ?boolean = false, // Uses CSS3 translate() instead of position top/left. // This makes about 6x faster paint performance useCSSTransforms: ?boolean = true, +// If parent DOM node of ResponsiveReactGridLayout or ReactGridLayout has "transform: scale(n)" css property, +// we should set scale coefficient to avoid render artefacts while dragging. +transformScale: ?number = 1, // If true, grid items won't change position when being // dragged over. preventCollision: ?boolean = false; +// If true, droppable elements (with `draggable={true}` attribute) +// can be dropped on the grid. It triggers "onDrop" callback +// with position and event object as parameters. +// It can be useful for dropping an element in a specific position +// +// NOTE: In case of using Firefox you should add +// `onDragStart={e => e.dataTransfer.setData('text/plain', '')}` attribute +// along with `draggable={true}` otherwise this feature will work incorrect. +// onDragStart attribute is required for Firefox for a dragging initialization +// @see https://bugzilla.mozilla.org/show_bug.cgi?id=568313 +isDroppable: ?boolean = false +// Defines which resize handles should be rendered +// Allows for any combination of: +// 's' - South handle (bottom-center) +// 'w' - West handle (left-center) +// 'e' - East handle (right-center) +// 'n' - North handle (top-center) +// 'sw' - Southwest handle (bottom-left) +// 'nw' - Northwest handle (top-left) +// 'se' - Southeast handle (bottom-right) +// 'ne' - Northeast handle (top-right) +resizeHandles: ?string[] = ['se'] + // // Callbacks // @@ -322,7 +367,13 @@ onResizeStart: ItemCallback, // Calls when resize movement happens. onResize: ItemCallback, // Calls when resize is complete. -onResizeStop: ItemCallback +onResizeStop: ItemCallback, +// Calls when an element has been dropped into the grid from outside. +onDrop: (layout: Layout, item: ?LayoutItem, e: Event) => void + +// Ref for getting a reference for the grid's wrapping div. +// You can use this instead of a regular ref and the deprecated `ReactDOM.findDOMNode()`` function. +innerRef: ?React.Ref<"div"> ``` ### Responsive Grid Layout Props @@ -338,6 +389,15 @@ breakpoints: ?Object = {lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0}, // # of cols. This is a breakpoint -> cols map, e.g. {lg: 12, md: 10, ...} cols: ?Object = {lg: 12, md: 10, sm: 6, xs: 4, xxs: 2}, + +// margin (in pixels). Can be specified either as horizontal and vertical margin, e.g. `[10, 10]` or as a breakpoint -> margin map, e.g. `{lg: [10, 10], md: [10, 10], ...}. +margin: [number, number] | {[breakpoint: $Keys]: [number, number]} + + +// containerPadding (in pixels). Can be specified either as horizontal and vertical padding, e.g. `[10, 10]` or as a breakpoint -> containerPadding map, e.g. `{lg: [10, 10], md: [10, 10], ...}. +containerPadding: [number, number] | {[breakpoint: $Keys]: [number, number]} + + // layouts is an object mapping breakpoints to layouts. // e.g. {lg: Layout, md: Layout, ...} layouts: {[key: $Keys]: Layout} @@ -375,7 +435,7 @@ are out of range. Any `` properties defined directly will take precedence over globally-set options. For example, if the layout has the property `isDraggable: false`, but the grid item has the prop `isDraggable: true`, the item -will be draggable. +will be draggable, even if the item is marked `static: true`. ```js { @@ -398,15 +458,56 @@ will be draggable. // If false, will not be draggable. Overrides `static`. isDraggable: ?boolean = true, // If false, will not be resizable. Overrides `static`. - isResizable: ?boolean = true + isResizable: ?boolean = true, + // By default, a handle is only shown on the bottom-right (southeast) corner. + // Note that resizing from the top or left is generally not intuitive. + resizeHandles?: ?Array<'s' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne'> = ['se'] + // If true and draggable, item will be moved only within grid. + isBounded: ?boolean = false } ``` +### Performance + +`` has [an optimized `shouldComponentUpdate` implementation](lib/ReactGridLayout.jsx), but it relies on the user memoizing the `children` array: + + +```js +// lib/ReactGridLayout.jsx +// ... +shouldComponentUpdate(nextProps: Props, nextState: State) { + return ( + // NOTE: this is almost always unequal. Therefore the only way to get better performance + // from SCU is if the user intentionally memoizes children. If they do, and they can + // handle changes properly, performance will increase. + this.props.children !== nextProps.children || + !fastRGLPropsEqual(this.props, nextProps, isEqual) || + !isEqual(this.state.activeDrag, nextState.activeDrag) + ); +} +// ... +``` + +If you memoize your children, you can take advantage of this, and reap faster rerenders. For example: + +```js +function MyGrid(props) { + const children = React.useMemo(() => { + return new Array(props.count).fill(undefined).map((val, idx) => { + return
; + }); + }, [props.count]); + return {children}; +} +``` + +Because the `children` prop doesn't change between rerenders, updates to `` won't result in new renders, improving performance. + ## Contribute If you have a feature request, please add it as an issue or make a pull request. -If you have a bug to report, please reproduce the bug in [WebpackBin](http://www.webpackbin.com/VymTE3zWG) to help +If you have a bug to report, please reproduce the bug in [CodeSandbox](https://codesandbox.io/s/5wy3rz5z1x?module=%2Fsrc%2FShowcaseLayout.js) to help us easily isolate it. ## TODO List diff --git a/__mocks__/react-grid-layout.js b/__mocks__/react-grid-layout.js new file mode 100644 index 000000000..6765f4046 --- /dev/null +++ b/__mocks__/react-grid-layout.js @@ -0,0 +1,2 @@ +// Used by jest as it requires some example files, which pull from 'react-grid-layout' +module.exports = require('../index-dev'); \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100755 index f5aa8eff3..000000000 --- a/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -rm -rf ./build -./node_modules/.bin/babel --stage 0 --out-dir ./build ./lib -# More cross-platform compatible than `rename` -find ./build -type f -name '*.jsx' -exec sh -c 'mv -f $0 ${0%.jsx}.js' {} \; - -# Build browser module -./node_modules/.bin/webpack diff --git a/css/styles.css b/css/styles.css index dff787025..a1e049c44 100644 --- a/css/styles.css +++ b/css/styles.css @@ -20,6 +20,10 @@ will-change: transform; } +.react-grid-item.dropping { + visibility: hidden; +} + .react-grid-item.react-grid-placeholder { background: red; opacity: 0.2; @@ -51,3 +55,7 @@ border-right: 2px solid rgba(0, 0, 0, 0.4); border-bottom: 2px solid rgba(0, 0, 0, 0.4); } + +.react-resizable-hide > .react-resizable-handle { + display: none; +} diff --git a/dist/react-grid-layout.min.js b/dist/react-grid-layout.min.js index 121c72e29..518b7e3b1 100644 --- a/dist/react-grid-layout.min.js +++ b/dist/react-grid-layout.min.js @@ -1,4942 +1,12 @@ -!(function(t, e) { - "object" == typeof exports && "object" == typeof module - ? (module.exports = e(require("react"), require("react-dom"))) - : "function" == typeof define && define.amd - ? define(["react", "react-dom"], e) - : "object" == typeof exports - ? (exports.ReactGridLayout = e(require("react"), require("react-dom"))) - : (t.ReactGridLayout = e(t.React, t.ReactDOM)); -})("undefined" != typeof self ? self : this, function(t, e) { - return (function(t) { - function e(r) { - if (n[r]) return n[r].exports; - var o = (n[r] = { i: r, l: !1, exports: {} }); - return t[r].call(o.exports, o, o.exports, e), (o.l = !0), o.exports; - } - var n = {}; - return ( - (e.m = t), - (e.c = n), - (e.d = function(t, n, r) { - e.o(t, n) || - Object.defineProperty(t, n, { - configurable: !1, - enumerable: !0, - get: r - }); - }), - (e.n = function(t) { - var n = - t && t.__esModule - ? function() { - return t.default; - } - : function() { - return t; - }; - return e.d(n, "a", n), n; - }), - (e.o = function(t, e) { - return Object.prototype.hasOwnProperty.call(t, e); - }), - (e.p = ""), - e((e.s = 10)) - ); - })([ - function(e, n) { - e.exports = t; - }, - function(t, e, n) { - t.exports = n(11)(); - }, - function(t, e, n) { - "use strict"; - function r(t) { - return t && t.__esModule ? t : { default: t }; - } - function o(t) { - for (var e = 0, n = void 0, r = 0, o = t.length; r < o; r++) - (n = t[r].y + t[r].h) > e && (e = n); - return e; - } - function a(t) { - for (var e = Array(t.length), n = 0, r = t.length; n < r; n++) - e[n] = i(t[n]); - return e; - } - function i(t) { - return { - w: t.w, - h: t.h, - x: t.x, - y: t.y, - i: t.i, - minW: t.minW, - maxW: t.maxW, - minH: t.minH, - maxH: t.maxH, - moved: Boolean(t.moved), - static: Boolean(t.static), - isDraggable: t.isDraggable, - isResizable: t.isResizable - }; - } - function s(t, e) { - return (0, z.default)( - k.default.Children.map(t, function(t) { - return t.key; - }), - k.default.Children.map(e, function(t) { - return t.key; - }) - ); - } - function u(t, e) { - return ( - t !== e && - (!(t.x + t.w <= e.x) && - (!(t.x >= e.x + e.w) && - (!(t.y + t.h <= e.y) && !(t.y >= e.y + e.h)))) - ); - } - function l(t, e, n) { - for ( - var r = g(t), o = S(t, e), a = Array(t.length), s = 0, u = o.length; - s < u; - s++ - ) { - var l = i(o[s]); - l.static || ((l = f(r, l, e, n, o)), r.push(l)), - (a[t.indexOf(o[s])] = l), - (l.moved = !1); - } - return a; - } - function c(t, e, n, r) { - var o = N[r]; - e[r] += 1; - for (var a = t.indexOf(e), i = a + 1; i < t.length; i++) { - var s = t[i]; - if (!s.static) { - if (s.y > e.y + e.h) break; - u(e, s) && c(t, s, n + e[o], r); - } - } - e[r] = n; - } - function f(t, e, n, r, a) { - var i = "vertical" === n, - s = "horizontal" === n; - if (i) for (e.y = Math.min(o(t), e.y); e.y > 0 && !h(t, e); ) e.y--; - else if (s) - for (e.y = Math.min(o(t), e.y); e.x > 0 && !h(t, e); ) e.x--; - for (var u = void 0; (u = h(t, e)); ) - s ? c(a, e, u.x + u.w, "x") : c(a, e, u.y + u.h, "y"), - s && e.x + e.w > r && ((e.x = r - e.w), e.y++); - return e; - } - function p(t, e) { - for (var n = g(t), r = 0, o = t.length; r < o; r++) { - var a = t[r]; - if ( - (a.x + a.w > e.cols && (a.x = e.cols - a.w), - a.x < 0 && ((a.x = 0), (a.w = e.cols)), - a.static) - ) - for (; h(n, a); ) a.y++; - else n.push(a); - } - return t; - } - function d(t, e) { - for (var n = 0, r = t.length; n < r; n++) if (t[n].i === e) return t[n]; - } - function h(t, e) { - for (var n = 0, r = t.length; n < r; n++) if (u(t[n], e)) return t[n]; - } - function y(t, e) { - return t.filter(function(t) { - return u(t, e); - }); - } - function g(t) { - return t.filter(function(t) { - return t.static; - }); - } - function m(t, e, n, r, o, a, i, s) { - if (e.static) return t; - if (e.y === r && e.x === n) return t; - E( - "Moving element " + - e.i + - " to [" + - String(n) + - "," + - String(r) + - "] from [" + - e.x + - "," + - e.y + - "]" - ); - var u = e.x, - l = e.y; - "number" == typeof n && (e.x = n), - "number" == typeof r && (e.y = r), - (e.moved = !0); - var c = S(t, i); - ("vertical" === i && "number" == typeof r - ? l >= r - : "horizontal" === i && "number" == typeof n && u >= n) && - (c = c.reverse()); - var f = y(c, e); - if (a && f.length) - return ( - E("Collision prevented on " + e.i + ", reverting."), - (e.x = u), - (e.y = l), - (e.moved = !1), - t - ); - for (var p = 0, d = f.length; p < d; p++) { - var h = f[p]; - E( - "Resolving collision between " + - e.i + - " at [" + - e.x + - "," + - e.y + - "] and " + - h.i + - " at [" + - h.x + - "," + - h.y + - "]" - ), - h.moved || - (t = h.static ? v(t, h, e, o, i, s) : v(t, e, h, o, i, s)); - } - return t; - } - function v(t, e, n, r, o, a) { - var i = "horizontal" === o, - s = "vertical" === o; - if (r) { - r = !1; - var u = { - x: i ? Math.max(e.x - n.w, 0) : n.x, - y: s ? Math.max(e.y - n.h, 0) : n.y, - w: n.w, - h: n.h, - i: "-1" - }; - if (!h(t, u)) - return ( - E( - "Doing reverse collision on " + - n.i + - " up to [" + - u.x + - "," + - u.y + - "]." - ), - m(t, n, i ? u.x : void 0, s ? u.y : void 0, r, !1, o, a) - ); - } - return m(t, n, i ? n.x + 1 : void 0, s ? n.y + 1 : void 0, r, !1, o, a); - } - function b(t) { - return 100 * t + "%"; - } - function w(t) { - var e = t.top, - n = t.left, - r = t.width, - o = t.height, - a = "translate(" + n + "px," + e + "px)"; - return { - transform: a, - WebkitTransform: a, - MozTransform: a, - msTransform: a, - OTransform: a, - width: r + "px", - height: o + "px", - position: "absolute" - }; - } - function x(t) { - return { - top: t.top + "px", - left: t.left + "px", - width: t.width + "px", - height: t.height + "px", - position: "absolute" - }; - } - function S(t, e) { - return "horizontal" === e ? O(t) : _(t); - } - function _(t) { - return [].concat(t).sort(function(t, e) { - return t.y > e.y || (t.y === e.y && t.x > e.x) - ? 1 - : t.y === e.y && t.x === e.x ? 0 : -1; - }); - } - function O(t) { - return [].concat(t).sort(function(t, e) { - return t.x > e.x || (t.x === e.x && t.y > e.y) ? 1 : -1; - }); - } - function R(t, e, n, r) { - t = t || []; - var a = []; - return ( - k.default.Children.forEach(e, function(e, n) { - var r = d(t, String(e.key)); - if (r) a[n] = i(r); - else { - !M && - e.props._grid && - console.warn( - "`_grid` properties on children have been deprecated as of React 15.2. Please use `data-grid` or add your properties directly to the `layout`." - ); - var s = e.props["data-grid"] || e.props._grid; - s - ? (M || D([s], "ReactGridLayout.children"), - (a[n] = i(T({}, s, { i: e.key })))) - : (a[n] = i({ w: 1, h: 1, x: 0, y: o(a), i: String(e.key) })); - } - }), - (a = p(a, { cols: n })), - (a = l(a, r, n)) - ); - } - function D(t) { - var e = - arguments.length > 1 && void 0 !== arguments[1] - ? arguments[1] - : "Layout", - n = ["x", "y", "w", "h"]; - if (!Array.isArray(t)) throw new Error(e + " must be an array!"); - for (var r = 0, o = t.length; r < o; r++) { - for (var a = t[r], i = 0; i < n.length; i++) - if ("number" != typeof a[n[i]]) - throw new Error( - "ReactGridLayout: " + - e + - "[" + - r + - "]." + - n[i] + - " must be a number!" - ); - if (a.i && "string" != typeof a.i) - throw new Error( - "ReactGridLayout: " + e + "[" + r + "].i must be a string!" - ); - if (void 0 !== a.static && "boolean" != typeof a.static) - throw new Error( - "ReactGridLayout: " + e + "[" + r + "].static must be a boolean!" - ); - } - } - function j(t, e) { - e.forEach(function(e) { - return (t[e] = t[e].bind(t)); - }); - } - function E() { - var t; - L && (t = console).log.apply(t, arguments); - } - (e.__esModule = !0), (e.noop = void 0); - var T = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); - } - return t; - }; - (e.bottom = o), - (e.cloneLayout = a), - (e.cloneLayoutItem = i), - (e.childrenEqual = s), - (e.collides = u), - (e.compact = l), - (e.compactItem = f), - (e.correctBounds = p), - (e.getLayoutItem = d), - (e.getFirstCollision = h), - (e.getAllCollisions = y), - (e.getStatics = g), - (e.moveElement = m), - (e.moveElementAwayFromCollision = v), - (e.perc = b), - (e.setTransform = w), - (e.setTopLeft = x), - (e.sortLayoutItems = S), - (e.sortLayoutItemsByRowCol = _), - (e.sortLayoutItemsByColRow = O), - (e.synchronizeLayoutWithChildren = R), - (e.validateLayout = D), - (e.autoBindHandlers = j); - var C = n(3), - z = r(C), - P = n(0), - k = r(P), - M = !0, - L = !1, - N = { x: "w", y: "h" }; - e.noop = function() {}; - }, - function(t, e, n) { - (function(t, n) { - function r(t, e) { - for ( - var n = -1, r = null == t ? 0 : t.length, o = 0, a = []; - ++n < r; - - ) { - var i = t[n]; - e(i, n, t) && (a[o++] = i); - } - return a; - } - function o(t, e) { - for (var n = -1, r = e.length, o = t.length; ++n < r; ) - t[o + n] = e[n]; - return t; - } - function a(t, e) { - for (var n = -1, r = null == t ? 0 : t.length; ++n < r; ) - if (e(t[n], n, t)) return !0; - return !1; - } - function i(t, e) { - for (var n = -1, r = Array(t); ++n < t; ) r[n] = e(n); - return r; - } - function s(t, e) { - return t.has(e); - } - function u(t, e) { - return null == t ? void 0 : t[e]; - } - function l(t) { - var e = -1, - n = Array(t.size); - return ( - t.forEach(function(t, r) { - n[++e] = [r, t]; - }), - n - ); - } - function c(t) { - var e = -1, - n = Array(t.size); - return ( - t.forEach(function(t) { - n[++e] = t; - }), - n - ); - } - function f(t) { - var e = -1, - n = null == t ? 0 : t.length; - for (this.clear(); ++e < n; ) { - var r = t[e]; - this.set(r[0], r[1]); - } - } - function p() { - (this.__data__ = Oe ? Oe(null) : {}), (this.size = 0); - } - function d(t) { - var e = this.has(t) && delete this.__data__[t]; - return (this.size -= e ? 1 : 0), e; - } - function h(t) { - var e = this.__data__; - if (Oe) { - var n = e[t]; - return n === vt ? void 0 : n; - } - return ie.call(e, t) ? e[t] : void 0; - } - function y(t) { - var e = this.__data__; - return Oe ? void 0 !== e[t] : ie.call(e, t); - } - function g(t, e) { - var n = this.__data__; - return ( - (this.size += this.has(t) ? 0 : 1), - (n[t] = Oe && void 0 === e ? vt : e), - this - ); - } - function m(t) { - var e = -1, - n = null == t ? 0 : t.length; - for (this.clear(); ++e < n; ) { - var r = t[e]; - this.set(r[0], r[1]); - } - } - function v() { - (this.__data__ = []), (this.size = 0); - } - function b(t) { - var e = this.__data__, - n = H(e, t); - return ( - !(n < 0) && - (n == e.length - 1 ? e.pop() : he.call(e, n, 1), --this.size, !0) - ); - } - function w(t) { - var e = this.__data__, - n = H(e, t); - return n < 0 ? void 0 : e[n][1]; - } - function x(t) { - return H(this.__data__, t) > -1; - } - function S(t, e) { - var n = this.__data__, - r = H(n, t); - return r < 0 ? (++this.size, n.push([t, e])) : (n[r][1] = e), this; - } - function _(t) { - var e = -1, - n = null == t ? 0 : t.length; - for (this.clear(); ++e < n; ) { - var r = t[e]; - this.set(r[0], r[1]); - } - } - function O() { - (this.size = 0), - (this.__data__ = { - hash: new f(), - map: new (we || m)(), - string: new f() - }); - } - function R(t) { - var e = Q(this, t).delete(t); - return (this.size -= e ? 1 : 0), e; - } - function D(t) { - return Q(this, t).get(t); - } - function j(t) { - return Q(this, t).has(t); - } - function E(t, e) { - var n = Q(this, t), - r = n.size; - return n.set(t, e), (this.size += n.size == r ? 0 : 1), this; - } - function T(t) { - var e = -1, - n = null == t ? 0 : t.length; - for (this.__data__ = new _(); ++e < n; ) this.add(t[e]); - } - function C(t) { - return this.__data__.set(t, vt), this; - } - function z(t) { - return this.__data__.has(t); - } - function P(t) { - var e = (this.__data__ = new m(t)); - this.size = e.size; - } - function k() { - (this.__data__ = new m()), (this.size = 0); - } - function M(t) { - var e = this.__data__, - n = e.delete(t); - return (this.size = e.size), n; - } - function L(t) { - return this.__data__.get(t); - } - function N(t) { - return this.__data__.has(t); - } - function A(t, e) { - var n = this.__data__; - if (n instanceof m) { - var r = n.__data__; - if (!we || r.length < mt - 1) - return r.push([t, e]), (this.size = ++n.size), this; - n = this.__data__ = new _(r); - } - return n.set(t, e), (this.size = n.size), this; - } - function W(t, e) { - var n = Le(t), - r = !n && Me(t), - o = !n && !r && Ne(t), - a = !n && !r && !o && Ae(t), - s = n || r || o || a, - u = s ? i(t.length, String) : [], - l = u.length; - for (var c in t) - (!e && !ie.call(t, c)) || - (s && - ("length" == c || - (o && ("offset" == c || "parent" == c)) || - (a && - ("buffer" == c || - "byteLength" == c || - "byteOffset" == c)) || - et(c, l))) || - u.push(c); - return u; - } - function H(t, e) { - for (var n = t.length; n--; ) if (st(t[n][0], e)) return n; - return -1; - } - function I(t, e, n) { - var r = e(t); - return Le(t) ? r : o(r, n(t)); - } - function B(t) { - return null == t - ? void 0 === t ? Ht : Pt - : ye && ye in Object(t) ? tt(t) : at(t); - } - function G(t) { - return dt(t) && B(t) == St; - } - function U(t, e, n, r, o) { - return ( - t === e || - (null == t || null == e || (!dt(t) && !dt(e)) - ? t !== t && e !== e - : q(t, e, n, r, U, o)) - ); - } - function q(t, e, n, r, o, a) { - var i = Le(t), - s = Le(e), - u = i ? _t : ke(t), - l = s ? _t : ke(e); - (u = u == St ? kt : u), (l = l == St ? kt : l); - var c = u == kt, - f = l == kt, - p = u == l; - if (p && Ne(t)) { - if (!Ne(e)) return !1; - (i = !0), (c = !1); - } - if (p && !c) - return ( - a || (a = new P()), - i || Ae(t) ? V(t, e, n, r, o, a) : $(t, e, u, n, r, o, a) - ); - if (!(n & bt)) { - var d = c && ie.call(t, "__wrapped__"), - h = f && ie.call(e, "__wrapped__"); - if (d || h) { - var y = d ? t.value() : t, - g = h ? e.value() : e; - return a || (a = new P()), o(y, g, n, r, a); - } - } - return !!p && (a || (a = new P()), J(t, e, n, r, o, a)); - } - function Y(t) { - return !(!pt(t) || rt(t)) && (ct(t) ? le : Ut).test(it(t)); - } - function X(t) { - return dt(t) && ft(t.length) && !!Yt[B(t)]; - } - function F(t) { - if (!ot(t)) return ve(t); - var e = []; - for (var n in Object(t)) - ie.call(t, n) && "constructor" != n && e.push(n); - return e; - } - function V(t, e, n, r, o, i) { - var u = n & bt, - l = t.length, - c = e.length; - if (l != c && !(u && c > l)) return !1; - var f = i.get(t); - if (f && i.get(e)) return f == e; - var p = -1, - d = !0, - h = n & wt ? new T() : void 0; - for (i.set(t, e), i.set(e, t); ++p < l; ) { - var y = t[p], - g = e[p]; - if (r) var m = u ? r(g, y, p, e, t, i) : r(y, g, p, t, e, i); - if (void 0 !== m) { - if (m) continue; - d = !1; - break; - } - if (h) { - if ( - !a(e, function(t, e) { - if (!s(h, e) && (y === t || o(y, t, n, r, i))) - return h.push(e); - }) - ) { - d = !1; - break; - } - } else if (y !== g && !o(y, g, n, r, i)) { - d = !1; - break; - } - } - return i.delete(t), i.delete(e), d; - } - function $(t, e, n, r, o, a, i) { - switch (n) { - case Bt: - if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset) - return !1; - (t = t.buffer), (e = e.buffer); - case It: - return !( - t.byteLength != e.byteLength || !a(new pe(t), new pe(e)) - ); - case Rt: - case Dt: - case zt: - return st(+t, +e); - case jt: - return t.name == e.name && t.message == e.message; - case Lt: - case At: - return t == e + ""; - case Ct: - var s = l; - case Nt: - var u = r & bt; - if ((s || (s = c), t.size != e.size && !u)) return !1; - var f = i.get(t); - if (f) return f == e; - (r |= wt), i.set(t, e); - var p = V(s(t), s(e), r, o, a, i); - return i.delete(t), p; - case Wt: - if (ze) return ze.call(t) == ze.call(e); - } - return !1; - } - function J(t, e, n, r, o, a) { - var i = n & bt, - s = K(t), - u = s.length; - if (u != K(e).length && !i) return !1; - for (var l = u; l--; ) { - var c = s[l]; - if (!(i ? c in e : ie.call(e, c))) return !1; - } - var f = a.get(t); - if (f && a.get(e)) return f == e; - var p = !0; - a.set(t, e), a.set(e, t); - for (var d = i; ++l < u; ) { - c = s[l]; - var h = t[c], - y = e[c]; - if (r) var g = i ? r(y, h, c, e, t, a) : r(h, y, c, t, e, a); - if (!(void 0 === g ? h === y || o(h, y, n, r, a) : g)) { - p = !1; - break; - } - d || (d = "constructor" == c); - } - if (p && !d) { - var m = t.constructor, - v = e.constructor; - m != v && - "constructor" in t && - "constructor" in e && - !( - "function" == typeof m && - m instanceof m && - "function" == typeof v && - v instanceof v - ) && - (p = !1); - } - return a.delete(t), a.delete(e), p; - } - function K(t) { - return I(t, ht, Pe); - } - function Q(t, e) { - var n = t.__data__; - return nt(e) ? n["string" == typeof e ? "string" : "hash"] : n.map; - } - function Z(t, e) { - var n = u(t, e); - return Y(n) ? n : void 0; - } - function tt(t) { - var e = ie.call(t, ye), - n = t[ye]; - try { - t[ye] = void 0; - var r = !0; - } catch (t) {} - var o = ue.call(t); - return r && (e ? (t[ye] = n) : delete t[ye]), o; - } - function et(t, e) { - return ( - !!(e = null == e ? xt : e) && - ("number" == typeof t || qt.test(t)) && - t > -1 && - t % 1 == 0 && - t < e - ); - } - function nt(t) { - var e = typeof t; - return "string" == e || - "number" == e || - "symbol" == e || - "boolean" == e - ? "__proto__" !== t - : null === t; - } - function rt(t) { - return !!se && se in t; - } - function ot(t) { - var e = t && t.constructor; - return t === (("function" == typeof e && e.prototype) || re); - } - function at(t) { - return ue.call(t); - } - function it(t) { - if (null != t) { - try { - return ae.call(t); - } catch (t) {} - try { - return t + ""; - } catch (t) {} - } - return ""; - } - function st(t, e) { - return t === e || (t !== t && e !== e); - } - function ut(t) { - return null != t && ft(t.length) && !ct(t); - } - function lt(t, e) { - return U(t, e); - } - function ct(t) { - if (!pt(t)) return !1; - var e = B(t); - return e == Et || e == Tt || e == Ot || e == Mt; - } - function ft(t) { - return "number" == typeof t && t > -1 && t % 1 == 0 && t <= xt; - } - function pt(t) { - var e = typeof t; - return null != t && ("object" == e || "function" == e); - } - function dt(t) { - return null != t && "object" == typeof t; - } - function ht(t) { - return ut(t) ? W(t) : F(t); - } - function yt() { - return []; - } - function gt() { - return !1; - } - var mt = 200, - vt = "__lodash_hash_undefined__", - bt = 1, - wt = 2, - xt = 9007199254740991, - St = "[object Arguments]", - _t = "[object Array]", - Ot = "[object AsyncFunction]", - Rt = "[object Boolean]", - Dt = "[object Date]", - jt = "[object Error]", - Et = "[object Function]", - Tt = "[object GeneratorFunction]", - Ct = "[object Map]", - zt = "[object Number]", - Pt = "[object Null]", - kt = "[object Object]", - Mt = "[object Proxy]", - Lt = "[object RegExp]", - Nt = "[object Set]", - At = "[object String]", - Wt = "[object Symbol]", - Ht = "[object Undefined]", - It = "[object ArrayBuffer]", - Bt = "[object DataView]", - Gt = /[\\^$.*+?()[\]{}|]/g, - Ut = /^\[object .+?Constructor\]$/, - qt = /^(?:0|[1-9]\d*)$/, - Yt = {}; - (Yt["[object Float32Array]"] = Yt["[object Float64Array]"] = Yt[ - "[object Int8Array]" - ] = Yt["[object Int16Array]"] = Yt["[object Int32Array]"] = Yt[ - "[object Uint8Array]" - ] = Yt["[object Uint8ClampedArray]"] = Yt["[object Uint16Array]"] = Yt[ - "[object Uint32Array]" - ] = !0), - (Yt[St] = Yt[_t] = Yt[It] = Yt[Rt] = Yt[Bt] = Yt[Dt] = Yt[jt] = Yt[ - Et - ] = Yt[Ct] = Yt[zt] = Yt[kt] = Yt[Lt] = Yt[Nt] = Yt[At] = Yt[ - "[object WeakMap]" - ] = !1); - var Xt = "object" == typeof t && t && t.Object === Object && t, - Ft = - "object" == typeof self && self && self.Object === Object && self, - Vt = Xt || Ft || Function("return this")(), - $t = "object" == typeof e && e && !e.nodeType && e, - Jt = $t && "object" == typeof n && n && !n.nodeType && n, - Kt = Jt && Jt.exports === $t, - Qt = Kt && Xt.process, - Zt = (function() { - try { - return Qt && Qt.binding && Qt.binding("util"); - } catch (t) {} - })(), - te = Zt && Zt.isTypedArray, - ee = Array.prototype, - ne = Function.prototype, - re = Object.prototype, - oe = Vt["__core-js_shared__"], - ae = ne.toString, - ie = re.hasOwnProperty, - se = (function() { - var t = /[^.]+$/.exec((oe && oe.keys && oe.keys.IE_PROTO) || ""); - return t ? "Symbol(src)_1." + t : ""; - })(), - ue = re.toString, - le = RegExp( - "^" + - ae - .call(ie) - .replace(Gt, "\\$&") - .replace( - /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, - "$1.*?" - ) + - "$" - ), - ce = Kt ? Vt.Buffer : void 0, - fe = Vt.Symbol, - pe = Vt.Uint8Array, - de = re.propertyIsEnumerable, - he = ee.splice, - ye = fe ? fe.toStringTag : void 0, - ge = Object.getOwnPropertySymbols, - me = ce ? ce.isBuffer : void 0, - ve = (function(t, e) { - return function(n) { - return t(e(n)); - }; - })(Object.keys, Object), - be = Z(Vt, "DataView"), - we = Z(Vt, "Map"), - xe = Z(Vt, "Promise"), - Se = Z(Vt, "Set"), - _e = Z(Vt, "WeakMap"), - Oe = Z(Object, "create"), - Re = it(be), - De = it(we), - je = it(xe), - Ee = it(Se), - Te = it(_e), - Ce = fe ? fe.prototype : void 0, - ze = Ce ? Ce.valueOf : void 0; - (f.prototype.clear = p), - (f.prototype.delete = d), - (f.prototype.get = h), - (f.prototype.has = y), - (f.prototype.set = g), - (m.prototype.clear = v), - (m.prototype.delete = b), - (m.prototype.get = w), - (m.prototype.has = x), - (m.prototype.set = S), - (_.prototype.clear = O), - (_.prototype.delete = R), - (_.prototype.get = D), - (_.prototype.has = j), - (_.prototype.set = E), - (T.prototype.add = T.prototype.push = C), - (T.prototype.has = z), - (P.prototype.clear = k), - (P.prototype.delete = M), - (P.prototype.get = L), - (P.prototype.has = N), - (P.prototype.set = A); - var Pe = ge - ? function(t) { - return null == t - ? [] - : ((t = Object(t)), - r(ge(t), function(e) { - return de.call(t, e); - })); - } - : yt, - ke = B; - ((be && ke(new be(new ArrayBuffer(1))) != Bt) || - (we && ke(new we()) != Ct) || - (xe && "[object Promise]" != ke(xe.resolve())) || - (Se && ke(new Se()) != Nt) || - (_e && "[object WeakMap]" != ke(new _e()))) && - (ke = function(t) { - var e = B(t), - n = e == kt ? t.constructor : void 0, - r = n ? it(n) : ""; - if (r) - switch (r) { - case Re: - return Bt; - case De: - return Ct; - case je: - return "[object Promise]"; - case Ee: - return Nt; - case Te: - return "[object WeakMap]"; - } - return e; - }); - var Me = G( - (function() { - return arguments; - })() - ) - ? G - : function(t) { - return dt(t) && ie.call(t, "callee") && !de.call(t, "callee"); - }, - Le = Array.isArray, - Ne = me || gt, - Ae = te - ? (function(t) { - return function(e) { - return t(e); - }; - })(te) - : X; - n.exports = lt; - }.call(e, n(15), n(16)(t))); - }, - function(t, e, n) { - "use strict"; - function r(t) { - return t && t.__esModule ? t : { default: t }; - } - function o(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function a(t, e) { - if (!t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - return !e || ("object" != typeof e && "function" != typeof e) ? t : e; - } - function i(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function, not " + - typeof e - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - enumerable: !1, - writable: !0, - configurable: !0 - } - })), - e && - (Object.setPrototypeOf - ? Object.setPrototypeOf(t, e) - : (t.__proto__ = e)); - } - e.__esModule = !0; - var s = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); - } - return t; - }, - u = n(0), - l = r(u), - c = n(1), - f = r(c), - p = n(3), - d = r(p), - h = n(5), - y = r(h), - g = n(2), - m = n(17), - v = r(m), - b = (function(t) { - function e(n, r) { - o(this, e); - var i = a(this, t.call(this, n, r)); - return ( - w.call(i), - (0, g.autoBindHandlers)(i, [ - "onDragStart", - "onDrag", - "onDragStop", - "onResizeStart", - "onResize", - "onResizeStop" - ]), - i - ); - } - return ( - i(e, t), - (e.prototype.componentDidMount = function() { - this.setState({ mounted: !0 }), - this.onLayoutMaybeChanged(this.state.layout, this.props.layout); - }), - (e.prototype.componentWillReceiveProps = function(t) { - var e = void 0; - if ( - ((0, d.default)(t.layout, this.props.layout) && - t.compactType === this.props.compactType - ? (0, g.childrenEqual)(this.props.children, t.children) || - (e = this.state.layout) - : (e = t.layout), - e) - ) { - var n = (0, g.synchronizeLayoutWithChildren)( - e, - t.children, - t.cols, - this.compactType(t) - ), - r = this.state.layout; - this.setState({ layout: n }), this.onLayoutMaybeChanged(n, r); - } - }), - (e.prototype.containerHeight = function() { - if (this.props.autoSize) { - var t = (0, g.bottom)(this.state.layout), - e = this.props.containerPadding - ? this.props.containerPadding[1] - : this.props.margin[1]; - return ( - t * this.props.rowHeight + - (t - 1) * this.props.margin[1] + - 2 * e + - "px" - ); - } - }), - (e.prototype.compactType = function(t) { - return ( - t || (t = this.props), - !1 === t.verticalCompact ? null : t.compactType - ); - }), - (e.prototype.onDragStart = function(t, e, n, r) { - var o = r.e, - a = r.node, - i = this.state.layout, - s = (0, g.getLayoutItem)(i, t); - if (s) - return ( - this.setState({ - oldDragItem: (0, g.cloneLayoutItem)(s), - oldLayout: this.state.layout - }), - this.props.onDragStart(i, s, s, null, o, a) - ); - }), - (e.prototype.onDrag = function(t, e, n, r) { - var o = r.e, - a = r.node, - i = this.state.oldDragItem, - s = this.state.layout, - u = this.props.cols, - l = (0, g.getLayoutItem)(s, t); - if (l) { - var c = { - w: l.w, - h: l.h, - x: l.x, - y: l.y, - placeholder: !0, - i: t - }; - (s = (0, g.moveElement)( - s, - l, - e, - n, - !0, - this.props.preventCollision, - this.compactType(), - u - )), - this.props.onDrag(s, i, l, c, o, a), - this.setState({ - layout: (0, g.compact)(s, this.compactType(), u), - activeDrag: c - }); - } - }), - (e.prototype.onDragStop = function(t, e, n, r) { - var o = r.e, - a = r.node, - i = this.state.oldDragItem, - s = this.state.layout, - u = this.props, - l = u.cols, - c = u.preventCollision, - f = (0, g.getLayoutItem)(s, t); - if (f) { - (s = (0, g.moveElement)( - s, - f, - e, - n, - !0, - c, - this.compactType(), - l - )), - this.props.onDragStop(s, i, f, null, o, a); - var p = (0, g.compact)(s, this.compactType(), l), - d = this.state.oldLayout; - this.setState({ - activeDrag: null, - layout: p, - oldDragItem: null, - oldLayout: null - }), - this.onLayoutMaybeChanged(p, d); - } - }), - (e.prototype.onLayoutMaybeChanged = function(t, e) { - e || (e = this.state.layout), - (0, d.default)(e, t) || this.props.onLayoutChange(t); - }), - (e.prototype.onResizeStart = function(t, e, n, r) { - var o = r.e, - a = r.node, - i = this.state.layout, - s = (0, g.getLayoutItem)(i, t); - s && - (this.setState({ - oldResizeItem: (0, g.cloneLayoutItem)(s), - oldLayout: this.state.layout - }), - this.props.onResizeStart(i, s, s, null, o, a)); - }), - (e.prototype.onResize = function(t, e, n, r) { - var o = r.e, - a = r.node, - i = this.state, - u = i.layout, - l = i.oldResizeItem, - c = this.props, - f = c.cols, - p = c.preventCollision, - d = (0, g.getLayoutItem)(u, t); - if (d) { - var h = void 0; - if (p) { - var y = (0, g.getAllCollisions)( - u, - s({}, d, { w: e, h: n }) - ).filter(function(t) { - return t.i !== d.i; - }); - if ((h = y.length > 0)) { - var m = 1 / 0, - v = 1 / 0; - y.forEach(function(t) { - t.x > d.x && (m = Math.min(m, t.x)), - t.y > d.y && (v = Math.min(v, t.y)); - }), - Number.isFinite(m) && (d.w = m - d.x), - Number.isFinite(v) && (d.h = v - d.y); - } - } - h || ((d.w = e), (d.h = n)); - var b = { w: d.w, h: d.h, x: d.x, y: d.y, static: !0, i: t }; - this.props.onResize(u, l, d, b, o, a), - this.setState({ - layout: (0, g.compact)(u, this.compactType(), f), - activeDrag: b - }); - } - }), - (e.prototype.onResizeStop = function(t, e, n, r) { - var o = r.e, - a = r.node, - i = this.state, - s = i.layout, - u = i.oldResizeItem, - l = this.props.cols, - c = (0, g.getLayoutItem)(s, t); - this.props.onResizeStop(s, u, c, null, o, a); - var f = (0, g.compact)(s, this.compactType(), l), - p = this.state.oldLayout; - this.setState({ - activeDrag: null, - layout: f, - oldResizeItem: null, - oldLayout: null - }), - this.onLayoutMaybeChanged(f, p); - }), - (e.prototype.placeholder = function() { - var t = this.state.activeDrag; - if (!t) return null; - var e = this.props, - n = e.width, - r = e.cols, - o = e.margin, - a = e.containerPadding, - i = e.rowHeight, - s = e.maxRows, - u = e.useCSSTransforms; - return l.default.createElement( - v.default, - { - w: t.w, - h: t.h, - x: t.x, - y: t.y, - i: t.i, - className: "react-grid-placeholder", - containerWidth: n, - cols: r, - margin: o, - containerPadding: a || o, - maxRows: s, - rowHeight: i, - isDraggable: !1, - isResizable: !1, - useCSSTransforms: u - }, - l.default.createElement("div", null) - ); - }), - (e.prototype.processGridItem = function(t) { - if (t && t.key) { - var e = (0, g.getLayoutItem)(this.state.layout, String(t.key)); - if (!e) return null; - var n = this.props, - r = n.width, - o = n.cols, - a = n.margin, - i = n.containerPadding, - s = n.rowHeight, - u = n.maxRows, - c = n.isDraggable, - f = n.isResizable, - p = n.useCSSTransforms, - d = n.draggableCancel, - h = n.draggableHandle, - y = this.state.mounted, - m = Boolean( - !e.static && c && (e.isDraggable || null == e.isDraggable) - ), - b = Boolean( - !e.static && f && (e.isResizable || null == e.isResizable) - ); - return l.default.createElement( - v.default, - { - containerWidth: r, - cols: o, - margin: a, - containerPadding: i || a, - maxRows: u, - rowHeight: s, - cancel: d, - handle: h, - onDragStop: this.onDragStop, - onDragStart: this.onDragStart, - onDrag: this.onDrag, - onResizeStart: this.onResizeStart, - onResize: this.onResize, - onResizeStop: this.onResizeStop, - isDraggable: m, - isResizable: b, - useCSSTransforms: p && y, - usePercentages: !y, - w: e.w, - h: e.h, - x: e.x, - y: e.y, - i: e.i, - minH: e.minH, - minW: e.minW, - maxH: e.maxH, - maxW: e.maxW, - static: e.static - }, - t - ); - } - }), - (e.prototype.render = function() { - var t = this, - e = this.props, - n = e.className, - r = e.style, - o = (0, y.default)("react-grid-layout", n), - a = s({ height: this.containerHeight() }, r); - return l.default.createElement( - "div", - { className: o, style: a }, - l.default.Children.map(this.props.children, function(e) { - return t.processGridItem(e); - }), - this.placeholder() - ); - }), - e - ); - })(l.default.Component); - (b.displayName = "ReactGridLayout"), - (b.propTypes = { - className: f.default.string, - style: f.default.object, - width: f.default.number, - autoSize: f.default.bool, - cols: f.default.number, - draggableCancel: f.default.string, - draggableHandle: f.default.string, - verticalCompact: function(t) { - t.verticalCompact, 1; - }, - compactType: f.default.oneOf(["vertical", "horizontal"]), - layout: function(t) { - var e = t.layout; - void 0 !== e && (0, g.validateLayout)(e, "layout"); - }, - margin: f.default.arrayOf(f.default.number), - containerPadding: f.default.arrayOf(f.default.number), - rowHeight: f.default.number, - maxRows: f.default.number, - isDraggable: f.default.bool, - isResizable: f.default.bool, - preventCollision: f.default.bool, - useCSSTransforms: f.default.bool, - onLayoutChange: f.default.func, - onDragStart: f.default.func, - onDrag: f.default.func, - onDragStop: f.default.func, - onResizeStart: f.default.func, - onResize: f.default.func, - onResizeStop: f.default.func, - children: function(t, e) { - var n = t[e], - r = {}; - l.default.Children.forEach(n, function(t) { - if (r[t.key]) - throw new Error( - 'Duplicate child key "' + - t.key + - '" found! This will cause problems in ReactGridLayout.' - ); - r[t.key] = !0; - }); - } - }), - (b.defaultProps = { - autoSize: !0, - cols: 12, - className: "", - style: {}, - draggableHandle: "", - draggableCancel: "", - containerPadding: null, - rowHeight: 150, - maxRows: 1 / 0, - layout: [], - margin: [10, 10], - isDraggable: !0, - isResizable: !0, - useCSSTransforms: !0, - verticalCompact: !0, - compactType: "vertical", - preventCollision: !1, - onLayoutChange: g.noop, - onDragStart: g.noop, - onDrag: g.noop, - onDragStop: g.noop, - onResizeStart: g.noop, - onResize: g.noop, - onResizeStop: g.noop - }); - var w = function() { - this.state = { - activeDrag: null, - layout: (0, g.synchronizeLayoutWithChildren)( - this.props.layout, - this.props.children, - this.props.cols, - this.compactType() - ), - mounted: !1, - oldDragItem: null, - oldLayout: null, - oldResizeItem: null - }; - }; - e.default = b; - }, - function(t, e, n) { - var r, - o; /*! - Copyright (c) 2016 Jed Watson. +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.ReactGridLayout=e(require("react"),require("react-dom")):t.ReactGridLayout=e(t.React,t.ReactDOM)}(window,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){t.exports=n(15)()},function(t,e,n){"use strict";n.r(e),n.d(e,"bottom",(function(){return l})),n.d(e,"cloneLayout",(function(){return p})),n.d(e,"cloneLayoutItem",(function(){return f})),n.d(e,"childrenEqual",(function(){return d})),n.d(e,"fastRGLPropsEqual",(function(){return h})),n.d(e,"fastPositionEqual",(function(){return y})),n.d(e,"collides",(function(){return g})),n.d(e,"compact",(function(){return b})),n.d(e,"compactItem",(function(){return w})),n.d(e,"correctBounds",(function(){return O})),n.d(e,"getLayoutItem",(function(){return S})),n.d(e,"getFirstCollision",(function(){return j})),n.d(e,"getAllCollisions",(function(){return x})),n.d(e,"getStatics",(function(){return D})),n.d(e,"moveElement",(function(){return P})),n.d(e,"moveElementAwayFromCollision",(function(){return R})),n.d(e,"perc",(function(){return _})),n.d(e,"setTransform",(function(){return z})),n.d(e,"setTopLeft",(function(){return k})),n.d(e,"sortLayoutItems",(function(){return C})),n.d(e,"sortLayoutItemsByRowCol",(function(){return E})),n.d(e,"sortLayoutItemsByColRow",(function(){return T})),n.d(e,"synchronizeLayoutWithChildren",(function(){return M})),n.d(e,"validateLayout",(function(){return L})),n.d(e,"compactType",(function(){return N})),n.d(e,"autoBindHandlers",(function(){return H})),n.d(e,"noop",(function(){return A}));var r=n(3),o=n.n(r),a=n(2),i=n.n(a);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;en&&(n=e);return n}function p(t){for(var e=Array(t.length),n=0,r=t.length;n=e.x+e.w)&&(!(t.y+t.h<=e.y)&&!(t.y>=e.y+e.h))))}function b(t,e,n){for(var r=D(t),o=C(t,e),a=Array(t.length),i=0,s=o.length;ie.y+e.h)break;g(e,i)&&v(t,i,n+e[o],r)}}e[r]=n}function w(t,e,n,r,o){var a,i="horizontal"===n;if("vertical"===n)for(e.y=Math.min(l(t),e.y);e.y>0&&!j(t,e);)e.y--;else if(i)for(e.y=Math.min(l(t),e.y);e.x>0&&!j(t,e);)e.x--;for(;a=j(t,e);)i?v(o,e,a.x+a.w,"x"):v(o,e,a.y+a.h,"y"),i&&e.x+e.w>r&&(e.x=r-e.w,e.y++);return e}function O(t,e){for(var n=D(t),r=0,o=t.length;re.cols&&(a.x=e.cols-a.w),a.x<0&&(a.x=0,a.w=e.cols),a.static)for(;j(n,a);)a.y++;else n.push(a)}return t}function S(t,e){for(var n=0,r=t.length;n=r:"horizontal"===i&&"number"==typeof n&&u>=n)&&(l=l.reverse());var p=x(l,e);if(a&&p.length)return W("Collision prevented on ".concat(e.i,", reverting.")),e.x=u,e.y=c,e.moved=!1,t;for(var f=0,d=p.length;fe.y||t.y===e.y&&t.x>e.x?1:t.y===e.y&&t.x===e.x?0:-1}))}function T(t){return t.slice(0).sort((function(t,e){return t.x>e.x||t.x===e.x&&t.y>e.y?1:-1}))}function M(t,e,n,r){t=t||[];var o=[];return i.a.Children.forEach(e,(function(e,n){var r=S(t,String(e.key));if(r)o[n]=f(r);else{0;var a=e.props["data-grid"]||e.props._grid;o[n]=f(a?u(u({},a),{},{i:e.key}):{w:1,h:1,x:0,y:l(o),i:String(e.key)})}})),b(O(o,{cols:n}),r,n)}function L(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Layout",n=["x","y","w","h"];if(!Array.isArray(t))throw new Error(e+" must be an array!");for(var r=0,o=t.length;rs))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var l=-1,p=!0,f=2&n?new at:void 0;for(a.set(t,e),a.set(e,t);++l-1},rt.prototype.set=function(t,e){var n=this.__data__,r=ut(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},ot.prototype.clear=function(){this.size=0,this.__data__={hash:new nt,map:new(Y||rt),string:new nt}},ot.prototype.delete=function(t){var e=gt(this,t).delete(t);return this.size-=e?1:0,e},ot.prototype.get=function(t){return gt(this,t).get(t)},ot.prototype.has=function(t){return gt(this,t).has(t)},ot.prototype.set=function(t,e){var n=gt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},at.prototype.add=at.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},at.prototype.has=function(t){return this.__data__.has(t)},it.prototype.clear=function(){this.__data__=new rt,this.size=0},it.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},it.prototype.get=function(t){return this.__data__.get(t)},it.prototype.has=function(t){return this.__data__.has(t)},it.prototype.set=function(t,e){var n=this.__data__;if(n instanceof rt){var r=n.__data__;if(!Y||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ot(r)}return n.set(t,e),this.size=n.size,this};var mt=I?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,a=[];++n-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}function _t(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function zt(t){return null!=t&&"object"==typeof t}var kt=m?function(t){return function(e){return t(e)}}(m):function(t){return zt(t)&&Rt(t.length)&&!!c[ct(t)]};function Ct(t){return null!=(e=t)&&Rt(e.length)&&!Pt(e)?st(t):dt(t);var e}n.exports=function(t,e){return pt(t,e)}}).call(this,n(12),n(13)(t))},function(t,e,n){"use strict";n.r(e),n.d(e,"getBreakpointFromWidth",(function(){return o})),n.d(e,"getColsFromBreakpoint",(function(){return a})),n.d(e,"findOrGenerateResponsiveLayout",(function(){return i})),n.d(e,"sortBreakpoints",(function(){return s}));var r=n(1);function o(t,e){for(var n=s(t),r=n[0],o=1,a=n.length;ot[i]&&(r=i)}return r}function a(t,e){if(!e[t])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+t+" is missing!");return e[t]}function i(t,e,n,o,a,i){if(t[n])return Object(r.cloneLayout)(t[n]);for(var u=t[o],c=s(e),l=c.slice(c.indexOf(n)),p=0,f=l.length;p 0 && void 0 !== arguments[0] - ? arguments[0] - : {}; - return S({ touchAction: "none" }, t); - } - function w(t, e) { - t.classList - ? t.classList.add(e) - : t.className.match(new RegExp("(?:^|\\s)" + e + "(?!\\S)")) || - (t.className += " " + e); - } - function x(t, e) { - t.classList - ? t.classList.remove(e) - : (t.className = t.className.replace( - new RegExp("(?:^|\\s)" + e + "(?!\\S)", "g"), - "" - )); - } - Object.defineProperty(e, "__esModule", { value: !0 }); - var S = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); - } - return t; - }; - (e.matchesSelector = o), - (e.matchesSelectorAndParentsTo = a), - (e.addEvent = i), - (e.removeEvent = s), - (e.outerHeight = u), - (e.outerWidth = l), - (e.innerHeight = c), - (e.innerWidth = f), - (e.offsetXYFromParent = p), - (e.createCSSTransform = d), - (e.createSVGTransform = h), - (e.getTouch = y), - (e.getTouchIdentifier = g), - (e.addUserSelectStyles = m), - (e.removeUserSelectStyles = v), - (e.styleHacks = b), - (e.addClassName = w), - (e.removeClassName = x); - var _ = n(0), - O = n(19), - R = (function(t) { - return t && t.__esModule ? t : { default: t }; - })(O), - D = ""; - }, - function(t, n) { - t.exports = e; - }, - function(t, e, n) { - if ("production" !== Object({ DRAGGABLE_DEBUG: void 0 }).NODE_ENV) { - var r = - ("function" == typeof Symbol && - Symbol.for && - Symbol.for("react.element")) || - 60103, - o = function(t) { - return "object" == typeof t && null !== t && t.$$typeof === r; - }; - t.exports = n(14)(o, !0); - } else t.exports = n(17)(); - }, - function(t, e, n) { - "use strict"; - var r = n(1), - o = r; - if ("production" !== Object({ DRAGGABLE_DEBUG: void 0 }).NODE_ENV) { - var a = function(t) { - for ( - var e = arguments.length, n = Array(e > 1 ? e - 1 : 0), r = 1; - r < e; - r++ - ) - n[r - 1] = arguments[r]; - var o = 0, - a = - "Warning: " + - t.replace(/%s/g, function() { - return n[o++]; - }); - "undefined" != typeof console && console.error(a); - try { - throw new Error(a); - } catch (t) {} - }; - o = function(t, e) { - if (void 0 === e) - throw new Error( - "`warning(condition, format, ...args)` requires a warning message argument" - ); - if (0 !== e.indexOf("Failed Composite propType: ") && !t) { - for ( - var n = arguments.length, - r = Array(n > 2 ? n - 2 : 0), - o = 2; - o < n; - o++ - ) - r[o - 2] = arguments[o]; - a.apply(void 0, [e].concat(r)); - } - }; - } - t.exports = o; - }, - function(t, e, n) { - "use strict"; - function r(t, e, n) { - if (!t.props.bounds) return [e, n]; - var r = t.props.bounds; - r = "string" == typeof r ? r : c(r); - var o = f(t); - if ("string" == typeof r) { - var a = o.ownerDocument, - i = a.defaultView, - s = void 0; - if ( - !( - (s = - "parent" === r - ? o.parentNode - : a.querySelector(r)) instanceof HTMLElement - ) - ) - throw new Error( - 'Bounds selector "' + r + '" could not find an element.' - ); - var u = i.getComputedStyle(o), - l = i.getComputedStyle(s); - r = { - left: - -o.offsetLeft + - (0, p.int)(l.paddingLeft) + - (0, p.int)(u.marginLeft), - top: - -o.offsetTop + - (0, p.int)(l.paddingTop) + - (0, p.int)(u.marginTop), - right: - (0, y.innerWidth)(s) - - (0, y.outerWidth)(o) - - o.offsetLeft + - (0, p.int)(l.paddingRight) - - (0, p.int)(u.marginRight), - bottom: - (0, y.innerHeight)(s) - - (0, y.outerHeight)(o) - - o.offsetTop + - (0, p.int)(l.paddingBottom) - - (0, p.int)(u.marginBottom) - }; - } - return ( - (0, p.isNum)(r.right) && (e = Math.min(e, r.right)), - (0, p.isNum)(r.bottom) && (n = Math.min(n, r.bottom)), - (0, p.isNum)(r.left) && (e = Math.max(e, r.left)), - (0, p.isNum)(r.top) && (n = Math.max(n, r.top)), - [e, n] - ); - } - function o(t, e, n) { - return [Math.round(e / t[0]) * t[0], Math.round(n / t[1]) * t[1]]; - } - function a(t) { - return "both" === t.props.axis || "x" === t.props.axis; - } - function i(t) { - return "both" === t.props.axis || "y" === t.props.axis; - } - function s(t, e, n) { - var r = "number" == typeof e ? (0, y.getTouch)(t, e) : null; - if ("number" == typeof e && !r) return null; - var o = f(n), - a = - n.props.offsetParent || - o.offsetParent || - o.ownerDocument.body; - return (0, y.offsetXYFromParent)(r || t, a); - } - function u(t, e, n) { - var r = t.state, - o = !(0, p.isNum)(r.lastX), - a = f(t); - return o - ? { - node: a, - deltaX: 0, - deltaY: 0, - lastX: e, - lastY: n, - x: e, - y: n - } - : { - node: a, - deltaX: e - r.lastX, - deltaY: n - r.lastY, - lastX: r.lastX, - lastY: r.lastY, - x: e, - y: n - }; - } - function l(t, e) { - return { - node: e.node, - x: t.state.x + e.deltaX, - y: t.state.y + e.deltaY, - deltaX: e.deltaX, - deltaY: e.deltaY, - lastX: t.state.x, - lastY: t.state.y - }; - } - function c(t) { - return { - left: t.left, - top: t.top, - right: t.right, - bottom: t.bottom - }; - } - function f(t) { - var e = h.default.findDOMNode(t); - if (!e) - throw new Error(": Unmounted during event!"); - return e; - } - Object.defineProperty(e, "__esModule", { value: !0 }), - (e.getBoundPosition = r), - (e.snapToGrid = o), - (e.canDragX = a), - (e.canDragY = i), - (e.getControlPosition = s), - (e.createCoreData = u), - (e.createDraggableData = l); - var p = n(0), - d = n(4), - h = (function(t) { - return t && t.__esModule ? t : { default: t }; - })(d), - y = n(5); - }, - function(t, e, n) { - "use strict"; - (function(t) { - function r(t) { - return t && t.__esModule ? t : { default: t }; - } - function o(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function a(t, e) { - if (!t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - return !e || ("object" != typeof e && "function" != typeof e) - ? t - : e; - } - function i(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function, not " + - typeof e - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - enumerable: !1, - writable: !0, - configurable: !0 - } - })), - e && - (Object.setPrototypeOf - ? Object.setPrototypeOf(t, e) - : (t.__proto__ = e)); - } - Object.defineProperty(e, "__esModule", { value: !0 }); - var s = (function() { - function t(t, e) { - var n = [], - r = !0, - o = !1, - a = void 0; - try { - for ( - var i, s = t[Symbol.iterator](); - !(r = (i = s.next()).done) && - (n.push(i.value), !e || n.length !== e); - r = !0 - ); - } catch (t) { - (o = !0), (a = t); - } finally { - try { - !r && s.return && s.return(); - } finally { - if (o) throw a; - } - } - return n; - } - return function(e, n) { - if (Array.isArray(e)) return e; - if (Symbol.iterator in Object(e)) return t(e, n); - throw new TypeError( - "Invalid attempt to destructure non-iterable instance" - ); - }; - })(), - u = (function() { - function t(t, e) { - for (var n = 0; n < e.length; n++) { - var r = e[n]; - (r.enumerable = r.enumerable || !1), - (r.configurable = !0), - "value" in r && (r.writable = !0), - Object.defineProperty(t, r.key, r); - } - } - return function(e, n, r) { - return n && t(e.prototype, n), r && t(e, r), e; - }; - })(), - l = n(6), - c = r(l), - f = n(7), - p = r(f), - d = n(4), - h = r(d), - y = n(5), - g = n(9), - m = n(0), - v = n(11), - b = r(v), - w = { - touch: { - start: "touchstart", - move: "touchmove", - stop: "touchend" - }, - mouse: { - start: "mousedown", - move: "mousemove", - stop: "mouseup" - } - }, - x = w.mouse, - S = (function(t) { - function e() { - var t, n, r, i; - o(this, e); - for ( - var u = arguments.length, l = Array(u), c = 0; - c < u; - c++ - ) - l[c] = arguments[c]; - return ( - (n = r = a( - this, - (t = - e.__proto__ || Object.getPrototypeOf(e)).call.apply( - t, - [this].concat(l) - ) - )), - (r.state = { - dragging: !1, - lastX: NaN, - lastY: NaN, - touchIdentifier: null - }), - (r.handleDragStart = function(t) { - if ( - (r.props.onMouseDown(t), - !r.props.allowAnyClick && - "number" == typeof t.button && - 0 !== t.button) - ) - return !1; - var e = h.default.findDOMNode(r); - if (!e || !e.ownerDocument || !e.ownerDocument.body) - throw new Error( - " not mounted on DragStart!" - ); - var n = e.ownerDocument; - if ( - !( - r.props.disabled || - !(t.target instanceof n.defaultView.Node) || - (r.props.handle && - !(0, y.matchesSelectorAndParentsTo)( - t.target, - r.props.handle, - e - )) || - (r.props.cancel && - (0, y.matchesSelectorAndParentsTo)( - t.target, - r.props.cancel, - e - )) - ) - ) { - var o = (0, y.getTouchIdentifier)(t); - r.setState({ touchIdentifier: o }); - var a = (0, g.getControlPosition)(t, o, r); - if (null != a) { - var i = a.x, - s = a.y, - u = (0, g.createCoreData)(r, i, s); - (0, b.default)( - "DraggableCore: handleDragStart: %j", - u - ), - (0, b.default)("calling", r.props.onStart); - !1 !== r.props.onStart(t, u) && - (r.props.enableUserSelectHack && - (0, y.addUserSelectStyles)(n), - r.setState({ dragging: !0, lastX: i, lastY: s }), - (0, y.addEvent)(n, x.move, r.handleDrag), - (0, y.addEvent)(n, x.stop, r.handleDragStop)); - } - } - }), - (r.handleDrag = function(t) { - "touchmove" === t.type && t.preventDefault(); - var e = (0, g.getControlPosition)( - t, - r.state.touchIdentifier, - r - ); - if (null != e) { - var n = e.x, - o = e.y; - if (Array.isArray(r.props.grid)) { - var a = n - r.state.lastX, - i = o - r.state.lastY, - u = (0, g.snapToGrid)(r.props.grid, a, i), - l = s(u, 2); - if (((a = l[0]), (i = l[1]), !a && !i)) return; - (n = r.state.lastX + a), (o = r.state.lastY + i); - } - var c = (0, g.createCoreData)(r, n, o); - (0, b.default)("DraggableCore: handleDrag: %j", c); - if (!1 !== r.props.onDrag(t, c)) - r.setState({ lastX: n, lastY: o }); - else - try { - r.handleDragStop(new MouseEvent("mouseup")); - } catch (t) { - var f = document.createEvent("MouseEvents"); - f.initMouseEvent( - "mouseup", - !0, - !0, - window, - 0, - 0, - 0, - 0, - 0, - !1, - !1, - !1, - !1, - 0, - null - ), - r.handleDragStop(f); - } - } - }), - (r.handleDragStop = function(t) { - if (r.state.dragging) { - var e = (0, g.getControlPosition)( - t, - r.state.touchIdentifier, - r - ); - if (null != e) { - var n = e.x, - o = e.y, - a = (0, g.createCoreData)(r, n, o), - i = h.default.findDOMNode(r); - i && - r.props.enableUserSelectHack && - (0, y.removeUserSelectStyles)(i.ownerDocument), - (0, b.default)( - "DraggableCore: handleDragStop: %j", - a - ), - r.setState({ - dragging: !1, - lastX: NaN, - lastY: NaN - }), - r.props.onStop(t, a), - i && - ((0, b.default)( - "DraggableCore: Removing handlers" - ), - (0, y.removeEvent)( - i.ownerDocument, - x.move, - r.handleDrag - ), - (0, y.removeEvent)( - i.ownerDocument, - x.stop, - r.handleDragStop - )); - } - } - }), - (r.onMouseDown = function(t) { - return (x = w.mouse), r.handleDragStart(t); - }), - (r.onMouseUp = function(t) { - return (x = w.mouse), r.handleDragStop(t); - }), - (r.onTouchStart = function(t) { - return (x = w.touch), r.handleDragStart(t); - }), - (r.onTouchEnd = function(t) { - return (x = w.touch), r.handleDragStop(t); - }), - (i = n), - a(r, i) - ); - } - return ( - i(e, t), - u(e, [ - { - key: "componentWillUnmount", - value: function() { - var t = h.default.findDOMNode(this); - if (t) { - var e = t.ownerDocument; - (0, y.removeEvent)( - e, - w.mouse.move, - this.handleDrag - ), - (0, y.removeEvent)( - e, - w.touch.move, - this.handleDrag - ), - (0, y.removeEvent)( - e, - w.mouse.stop, - this.handleDragStop - ), - (0, y.removeEvent)( - e, - w.touch.stop, - this.handleDragStop - ), - this.props.enableUserSelectHack && - (0, y.removeUserSelectStyles)(e); - } - } - }, - { - key: "render", - value: function() { - return c.default.cloneElement( - c.default.Children.only(this.props.children), - { - style: (0, y.styleHacks)( - this.props.children.props.style - ), - onMouseDown: this.onMouseDown, - onTouchStart: this.onTouchStart, - onMouseUp: this.onMouseUp, - onTouchEnd: this.onTouchEnd - } - ); - } - } - ]), - e - ); - })(c.default.Component); - (S.displayName = "DraggableCore"), - (S.propTypes = { - allowAnyClick: p.default.bool, - disabled: p.default.bool, - enableUserSelectHack: p.default.bool, - offsetParent: function(e, n) { - if (!0 === t.browser && e[n] && 1 !== e[n].nodeType) - throw new Error( - "Draggable's offsetParent must be a DOM Node." - ); - }, - grid: p.default.arrayOf(p.default.number), - handle: p.default.string, - cancel: p.default.string, - onStart: p.default.func, - onDrag: p.default.func, - onStop: p.default.func, - onMouseDown: p.default.func, - className: m.dontSetMe, - style: m.dontSetMe, - transform: m.dontSetMe - }), - (S.defaultProps = { - allowAnyClick: !1, - cancel: null, - disabled: !1, - enableUserSelectHack: !0, - offsetParent: null, - handle: null, - grid: null, - transform: null, - onStart: function() {}, - onDrag: function() {}, - onStop: function() {}, - onMouseDown: function() {} - }), - (e.default = S); - }.call(e, n(20))); - }, - function(t, e, n) { - "use strict"; - function r() {} - Object.defineProperty(e, "__esModule", { value: !0 }), - (e.default = r); - }, - function(t, e, n) { - "use strict"; - var r = n(13).default; - (t.exports = r), - (t.exports.default = r), - (t.exports.DraggableCore = n(10).default); - }, - function(t, e, n) { - "use strict"; - function r(t) { - return t && t.__esModule ? t : { default: t }; - } - function o(t, e, n) { - return ( - e in t - ? Object.defineProperty(t, e, { - value: n, - enumerable: !0, - configurable: !0, - writable: !0 - }) - : (t[e] = n), - t - ); - } - function a(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function i(t, e) { - if (!t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - return !e || ("object" != typeof e && "function" != typeof e) - ? t - : e; - } - function s(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function, not " + - typeof e - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - enumerable: !1, - writable: !0, - configurable: !0 - } - })), - e && - (Object.setPrototypeOf - ? Object.setPrototypeOf(t, e) - : (t.__proto__ = e)); - } - Object.defineProperty(e, "__esModule", { value: !0 }); - var u = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && - (t[r] = n[r]); - } - return t; - }, - l = (function() { - function t(t, e) { - var n = [], - r = !0, - o = !1, - a = void 0; - try { - for ( - var i, s = t[Symbol.iterator](); - !(r = (i = s.next()).done) && - (n.push(i.value), !e || n.length !== e); - r = !0 - ); - } catch (t) { - (o = !0), (a = t); - } finally { - try { - !r && s.return && s.return(); - } finally { - if (o) throw a; - } - } - return n; - } - return function(e, n) { - if (Array.isArray(e)) return e; - if (Symbol.iterator in Object(e)) return t(e, n); - throw new TypeError( - "Invalid attempt to destructure non-iterable instance" - ); - }; - })(), - c = (function() { - function t(t, e) { - for (var n = 0; n < e.length; n++) { - var r = e[n]; - (r.enumerable = r.enumerable || !1), - (r.configurable = !0), - "value" in r && (r.writable = !0), - Object.defineProperty(t, r.key, r); - } - } - return function(e, n, r) { - return n && t(e.prototype, n), r && t(e, r), e; - }; - })(), - f = n(6), - p = r(f), - d = n(7), - h = r(d), - y = n(4), - g = r(y), - m = n(18), - v = r(m), - b = n(5), - w = n(9), - x = n(0), - S = n(10), - _ = r(S), - O = n(11), - R = r(O), - D = (function(t) { - function e(t) { - a(this, e); - var n = i( - this, - (e.__proto__ || Object.getPrototypeOf(e)).call(this, t) - ); - return ( - (n.onDragStart = function(t, e) { - if ( - ((0, R.default)("Draggable: onDragStart: %j", e), - !1 === - n.props.onStart(t, (0, w.createDraggableData)(n, e))) - ) - return !1; - n.setState({ dragging: !0, dragged: !0 }); - }), - (n.onDrag = function(t, e) { - if (!n.state.dragging) return !1; - (0, R.default)("Draggable: onDrag: %j", e); - var r = (0, w.createDraggableData)(n, e), - o = { x: r.x, y: r.y }; - if (n.props.bounds) { - var a = o.x, - i = o.y; - (o.x += n.state.slackX), (o.y += n.state.slackY); - var s = (0, w.getBoundPosition)(n, o.x, o.y), - u = l(s, 2), - c = u[0], - f = u[1]; - (o.x = c), - (o.y = f), - (o.slackX = n.state.slackX + (a - o.x)), - (o.slackY = n.state.slackY + (i - o.y)), - (r.x = o.x), - (r.y = o.y), - (r.deltaX = o.x - n.state.x), - (r.deltaY = o.y - n.state.y); - } - if (!1 === n.props.onDrag(t, r)) return !1; - n.setState(o); - }), - (n.onDragStop = function(t, e) { - if (!n.state.dragging) return !1; - if ( - !1 === - n.props.onStop(t, (0, w.createDraggableData)(n, e)) - ) - return !1; - (0, R.default)("Draggable: onDragStop: %j", e); - var r = { dragging: !1, slackX: 0, slackY: 0 }; - if (Boolean(n.props.position)) { - var o = n.props.position, - a = o.x, - i = o.y; - (r.x = a), (r.y = i); - } - n.setState(r); - }), - (n.state = { - dragging: !1, - dragged: !1, - x: t.position ? t.position.x : t.defaultPosition.x, - y: t.position ? t.position.y : t.defaultPosition.y, - slackX: 0, - slackY: 0, - isElementSVG: !1 - }), - n - ); - } - return ( - s(e, t), - c(e, [ - { - key: "componentWillMount", - value: function() { - !this.props.position || - this.props.onDrag || - this.props.onStop || - console.warn( - "A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element." - ); - } - }, - { - key: "componentDidMount", - value: function() { - void 0 !== window.SVGElement && - g.default.findDOMNode(this) instanceof - window.SVGElement && - this.setState({ isElementSVG: !0 }); - } - }, - { - key: "componentWillReceiveProps", - value: function(t) { - !t.position || - (this.props.position && - t.position.x === this.props.position.x && - t.position.y === this.props.position.y) || - this.setState({ x: t.position.x, y: t.position.y }); - } - }, - { - key: "componentWillUnmount", - value: function() { - this.setState({ dragging: !1 }); - } - }, - { - key: "render", - value: function() { - var t, - e = {}, - n = null, - r = Boolean(this.props.position), - a = !r || this.state.dragging, - i = this.props.position || this.props.defaultPosition, - s = { - x: (0, w.canDragX)(this) && a ? this.state.x : i.x, - y: (0, w.canDragY)(this) && a ? this.state.y : i.y - }; - this.state.isElementSVG - ? (n = (0, b.createSVGTransform)(s)) - : (e = (0, b.createCSSTransform)(s)); - var l = this.props, - c = l.defaultClassName, - f = l.defaultClassNameDragging, - d = l.defaultClassNameDragged, - h = p.default.Children.only(this.props.children), - y = (0, v.default)( - h.props.className || "", - c, - ((t = {}), - o(t, f, this.state.dragging), - o(t, d, this.state.dragged), - t) - ); - return p.default.createElement( - _.default, - u({}, this.props, { - onStart: this.onDragStart, - onDrag: this.onDrag, - onStop: this.onDragStop - }), - p.default.cloneElement(h, { - className: y, - style: u({}, h.props.style, e), - transform: n - }) - ); - } - } - ]), - e - ); - })(p.default.Component); - (D.displayName = "Draggable"), - (D.propTypes = u({}, _.default.propTypes, { - axis: h.default.oneOf(["both", "x", "y", "none"]), - bounds: h.default.oneOfType([ - h.default.shape({ - left: h.default.number, - right: h.default.number, - top: h.default.number, - bottom: h.default.number - }), - h.default.string, - h.default.oneOf([!1]) - ]), - defaultClassName: h.default.string, - defaultClassNameDragging: h.default.string, - defaultClassNameDragged: h.default.string, - defaultPosition: h.default.shape({ - x: h.default.number, - y: h.default.number - }), - position: h.default.shape({ - x: h.default.number, - y: h.default.number - }), - className: x.dontSetMe, - style: x.dontSetMe, - transform: x.dontSetMe - })), - (D.defaultProps = u({}, _.default.defaultProps, { - axis: "both", - bounds: !1, - defaultClassName: "react-draggable", - defaultClassNameDragging: "react-draggable-dragging", - defaultClassNameDragged: "react-draggable-dragged", - defaultPosition: { x: 0, y: 0 }, - position: null - })), - (e.default = D); - }, - function(t, e, n) { - "use strict"; - var r = n(1), - o = n(2), - a = n(8), - i = n(15), - s = n(3), - u = n(16); - t.exports = function(t, e) { - function n(t) { - var e = t && ((D && t[D]) || t[j]); - if ("function" == typeof e) return e; - } - function l(t, e) { - return t === e ? 0 !== t || 1 / t == 1 / e : t !== t && e !== e; - } - function c(t) { - (this.message = t), (this.stack = ""); - } - function f(t) { - function n(n, u, l, f, p, d, h) { - if (((f = f || E), (d = d || l), h !== s)) - if (e) - o( - !1, - "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" - ); - else if ( - "production" !== - Object({ DRAGGABLE_DEBUG: void 0 }).NODE_ENV && - "undefined" != typeof console - ) { - var y = f + ":" + l; - !r[y] && - i < 3 && - (a( - !1, - "You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.", - d, - f - ), - (r[y] = !0), - i++); - } - return null == u[l] - ? n - ? new c( - null === u[l] - ? "The " + - p + - " `" + - d + - "` is marked as required in `" + - f + - "`, but its value is `null`." - : "The " + - p + - " `" + - d + - "` is marked as required in `" + - f + - "`, but its value is `undefined`." - ) - : null - : t(u, l, f, p, d); - } - if ( - "production" !== Object({ DRAGGABLE_DEBUG: void 0 }).NODE_ENV - ) - var r = {}, - i = 0; - var u = n.bind(null, !1); - return (u.isRequired = n.bind(null, !0)), u; - } - function p(t) { - function e(e, n, r, o, a, i) { - var s = e[n]; - if (S(s) !== t) - return new c( - "Invalid " + - o + - " `" + - a + - "` of type `" + - _(s) + - "` supplied to `" + - r + - "`, expected `" + - t + - "`." - ); - return null; - } - return f(e); - } - function d(t) { - function e(e, n, r, o, a) { - if ("function" != typeof t) - return new c( - "Property `" + - a + - "` of component `" + - r + - "` has invalid PropType notation inside arrayOf." - ); - var i = e[n]; - if (!Array.isArray(i)) { - return new c( - "Invalid " + - o + - " `" + - a + - "` of type `" + - S(i) + - "` supplied to `" + - r + - "`, expected an array." - ); - } - for (var u = 0; u < i.length; u++) { - var l = t(i, u, r, o, a + "[" + u + "]", s); - if (l instanceof Error) return l; - } - return null; - } - return f(e); - } - function h(t) { - function e(e, n, r, o, a) { - if (!(e[n] instanceof t)) { - var i = t.name || E; - return new c( - "Invalid " + - o + - " `" + - a + - "` of type `" + - R(e[n]) + - "` supplied to `" + - r + - "`, expected instance of `" + - i + - "`." - ); - } - return null; - } - return f(e); - } - function y(t) { - function e(e, n, r, o, a) { - for (var i = e[n], s = 0; s < t.length; s++) - if (l(i, t[s])) return null; - return new c( - "Invalid " + - o + - " `" + - a + - "` of value `" + - i + - "` supplied to `" + - r + - "`, expected one of " + - JSON.stringify(t) + - "." - ); - } - return Array.isArray(t) - ? f(e) - : ("production" !== - Object({ DRAGGABLE_DEBUG: void 0 }).NODE_ENV && - a( - !1, - "Invalid argument supplied to oneOf, expected an instance of array." - ), - r.thatReturnsNull); - } - function g(t) { - function e(e, n, r, o, a) { - if ("function" != typeof t) - return new c( - "Property `" + - a + - "` of component `" + - r + - "` has invalid PropType notation inside objectOf." - ); - var i = e[n], - u = S(i); - if ("object" !== u) - return new c( - "Invalid " + - o + - " `" + - a + - "` of type `" + - u + - "` supplied to `" + - r + - "`, expected an object." - ); - for (var l in i) - if (i.hasOwnProperty(l)) { - var f = t(i, l, r, o, a + "." + l, s); - if (f instanceof Error) return f; - } - return null; - } - return f(e); - } - function m(t) { - function e(e, n, r, o, a) { - for (var i = 0; i < t.length; i++) { - if (null == (0, t[i])(e, n, r, o, a, s)) return null; - } - return new c( - "Invalid " + o + " `" + a + "` supplied to `" + r + "`." - ); - } - if (!Array.isArray(t)) - return ( - "production" !== - Object({ DRAGGABLE_DEBUG: void 0 }).NODE_ENV && - a( - !1, - "Invalid argument supplied to oneOfType, expected an instance of array." - ), - r.thatReturnsNull - ); - for (var n = 0; n < t.length; n++) { - var o = t[n]; - if ("function" != typeof o) - return ( - a( - !1, - "Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.", - O(o), - n - ), - r.thatReturnsNull - ); - } - return f(e); - } - function v(t) { - function e(e, n, r, o, a) { - var i = e[n], - u = S(i); - if ("object" !== u) - return new c( - "Invalid " + - o + - " `" + - a + - "` of type `" + - u + - "` supplied to `" + - r + - "`, expected `object`." - ); - for (var l in t) { - var f = t[l]; - if (f) { - var p = f(i, l, r, o, a + "." + l, s); - if (p) return p; - } - } - return null; - } - return f(e); - } - function b(t) { - function e(e, n, r, o, a) { - var u = e[n], - l = S(u); - if ("object" !== l) - return new c( - "Invalid " + - o + - " `" + - a + - "` of type `" + - l + - "` supplied to `" + - r + - "`, expected `object`." - ); - var f = i({}, e[n], t); - for (var p in f) { - var d = t[p]; - if (!d) - return new c( - "Invalid " + - o + - " `" + - a + - "` key `" + - p + - "` supplied to `" + - r + - "`.\nBad object: " + - JSON.stringify(e[n], null, " ") + - "\nValid keys: " + - JSON.stringify(Object.keys(t), null, " ") - ); - var h = d(u, p, r, o, a + "." + p, s); - if (h) return h; - } - return null; - } - return f(e); - } - function w(e) { - switch (typeof e) { - case "number": - case "string": - case "undefined": - return !0; - case "boolean": - return !e; - case "object": - if (Array.isArray(e)) return e.every(w); - if (null === e || t(e)) return !0; - var r = n(e); - if (!r) return !1; - var o, - a = r.call(e); - if (r !== e.entries) { - for (; !(o = a.next()).done; ) if (!w(o.value)) return !1; - } else - for (; !(o = a.next()).done; ) { - var i = o.value; - if (i && !w(i[1])) return !1; - } - return !0; - default: - return !1; - } - } - function x(t, e) { - return ( - "symbol" === t || - ("Symbol" === e["@@toStringTag"] || - ("function" == typeof Symbol && e instanceof Symbol)) - ); - } - function S(t) { - var e = typeof t; - return Array.isArray(t) - ? "array" - : t instanceof RegExp ? "object" : x(e, t) ? "symbol" : e; - } - function _(t) { - if (void 0 === t || null === t) return "" + t; - var e = S(t); - if ("object" === e) { - if (t instanceof Date) return "date"; - if (t instanceof RegExp) return "regexp"; - } - return e; - } - function O(t) { - var e = _(t); - switch (e) { - case "array": - case "object": - return "an " + e; - case "boolean": - case "date": - case "regexp": - return "a " + e; - default: - return e; - } - } - function R(t) { - return t.constructor && t.constructor.name - ? t.constructor.name - : E; - } - var D = "function" == typeof Symbol && Symbol.iterator, - j = "@@iterator", - E = "<>", - T = { - array: p("array"), - bool: p("boolean"), - func: p("function"), - number: p("number"), - object: p("object"), - string: p("string"), - symbol: p("symbol"), - any: (function() { - return f(r.thatReturnsNull); - })(), - arrayOf: d, - element: (function() { - function e(e, n, r, o, a) { - var i = e[n]; - if (!t(i)) { - return new c( - "Invalid " + - o + - " `" + - a + - "` of type `" + - S(i) + - "` supplied to `" + - r + - "`, expected a single ReactElement." - ); - } - return null; - } - return f(e); - })(), - instanceOf: h, - node: (function() { - function t(t, e, n, r, o) { - return w(t[e]) - ? null - : new c( - "Invalid " + - r + - " `" + - o + - "` supplied to `" + - n + - "`, expected a ReactNode." - ); - } - return f(t); - })(), - objectOf: g, - oneOf: y, - oneOfType: m, - shape: v, - exact: b - }; - return ( - (c.prototype = Error.prototype), - (T.checkPropTypes = u), - (T.PropTypes = T), - T - ); - }; - }, - function(t, e, n) { - "use strict"; - function r(t) { - if (null === t || void 0 === t) - throw new TypeError( - "Object.assign cannot be called with null or undefined" - ); - return Object(t); - } /* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - var o = Object.getOwnPropertySymbols, - a = Object.prototype.hasOwnProperty, - i = Object.prototype.propertyIsEnumerable; - t.exports = (function() { - try { - if (!Object.assign) return !1; - var t = new String("abc"); - if (((t[5] = "de"), "5" === Object.getOwnPropertyNames(t)[0])) - return !1; - for (var e = {}, n = 0; n < 10; n++) - e["_" + String.fromCharCode(n)] = n; - if ( - "0123456789" !== - Object.getOwnPropertyNames(e) - .map(function(t) { - return e[t]; - }) - .join("") - ) - return !1; - var r = {}; - return ( - "abcdefghijklmnopqrst".split("").forEach(function(t) { - r[t] = t; - }), - "abcdefghijklmnopqrst" === - Object.keys(Object.assign({}, r)).join("") - ); - } catch (t) { - return !1; - } - })() - ? Object.assign - : function(t, e) { - for (var n, s, u = r(t), l = 1; l < arguments.length; l++) { - n = Object(arguments[l]); - for (var c in n) a.call(n, c) && (u[c] = n[c]); - if (o) { - s = o(n); - for (var f = 0; f < s.length; f++) - i.call(n, s[f]) && (u[s[f]] = n[s[f]]); - } - } - return u; - }; - }, - function(t, e, n) { - "use strict"; - function r(t, e, n, r, u) { - if ("production" !== Object({ DRAGGABLE_DEBUG: void 0 }).NODE_ENV) - for (var l in t) - if (t.hasOwnProperty(l)) { - var c; - try { - o( - "function" == typeof t[l], - "%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.", - r || "React class", - n, - l, - typeof t[l] - ), - (c = t[l](e, l, r, n, null, i)); - } catch (t) { - c = t; - } - if ( - (a( - !c || c instanceof Error, - "%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", - r || "React class", - n, - l, - typeof c - ), - c instanceof Error && !(c.message in s)) - ) { - s[c.message] = !0; - var f = u ? u() : ""; - a( - !1, - "Failed %s type: %s%s", - n, - c.message, - null != f ? f : "" - ); - } - } - } - if ("production" !== Object({ DRAGGABLE_DEBUG: void 0 }).NODE_ENV) - var o = n(2), - a = n(8), - i = n(3), - s = {}; - t.exports = r; - }, - function(t, e, n) { - "use strict"; - var r = n(1), - o = n(2), - a = n(3); - t.exports = function() { - function t(t, e, n, r, i, s) { - s !== a && - o( - !1, - "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" - ); - } - function e() { - return t; - } - t.isRequired = t; - var n = { - array: t, - bool: t, - func: t, - number: t, - object: t, - string: t, - symbol: t, - any: t, - arrayOf: e, - element: t, - instanceOf: e, - node: t, - objectOf: e, - oneOf: e, - oneOfType: e, - shape: e, - exact: e - }; - return (n.checkPropTypes = r), (n.PropTypes = n), n; - }; - }, - function(t, e, n) { - var r, - o; /*! - Copyright (c) 2016 Jed Watson. +*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e 0 && void 0 !== arguments[0] - ? arguments[0] - : "transform"; - if ("undefined" == typeof window || void 0 === window.document) - return ""; - var e = window.document.documentElement.style; - if (t in e) return ""; - for (var n = 0; n < s.length; n++) - if (o(t, s[n]) in e) return s[n]; - return ""; - } - function o(t, e) { - return e ? "" + e + i(t) : t; - } - function a(t, e) { - return e ? "-" + e.toLowerCase() + "-" + t : t; - } - function i(t) { - for (var e = "", n = !0, r = 0; r < t.length; r++) - n - ? ((e += t[r].toUpperCase()), (n = !1)) - : "-" === t[r] ? (n = !0) : (e += t[r]); - return e; - } - Object.defineProperty(e, "__esModule", { value: !0 }), - (e.getPrefix = r), - (e.browserPrefixToKey = o), - (e.browserPrefixToStyle = a); - var s = ["Moz", "Webkit", "O", "ms"]; - e.default = r(); - }, - function(t, e) { - function n() { - throw new Error("setTimeout has not been defined"); - } - function r() { - throw new Error("clearTimeout has not been defined"); - } - function o(t) { - if (c === setTimeout) return setTimeout(t, 0); - if ((c === n || !c) && setTimeout) - return (c = setTimeout), setTimeout(t, 0); - try { - return c(t, 0); - } catch (e) { - try { - return c.call(null, t, 0); - } catch (e) { - return c.call(this, t, 0); - } - } - } - function a(t) { - if (f === clearTimeout) return clearTimeout(t); - if ((f === r || !f) && clearTimeout) - return (f = clearTimeout), clearTimeout(t); - try { - return f(t); - } catch (e) { - try { - return f.call(null, t); - } catch (e) { - return f.call(this, t); - } - } - } - function i() { - y && - d && - ((y = !1), - d.length ? (h = d.concat(h)) : (g = -1), - h.length && s()); - } - function s() { - if (!y) { - var t = o(i); - y = !0; - for (var e = h.length; e; ) { - for (d = h, h = []; ++g < e; ) d && d[g].run(); - (g = -1), (e = h.length); - } - (d = null), (y = !1), a(t); - } - } - function u(t, e) { - (this.fun = t), (this.array = e); - } - function l() {} - var c, - f, - p = (t.exports = {}); - !(function() { - try { - c = "function" == typeof setTimeout ? setTimeout : n; - } catch (t) { - c = n; - } - try { - f = "function" == typeof clearTimeout ? clearTimeout : r; - } catch (t) { - f = r; - } - })(); - var d, - h = [], - y = !1, - g = -1; - (p.nextTick = function(t) { - var e = new Array(arguments.length - 1); - if (arguments.length > 1) - for (var n = 1; n < arguments.length; n++) - e[n - 1] = arguments[n]; - h.push(new u(t, e)), 1 !== h.length || y || o(s); - }), - (u.prototype.run = function() { - this.fun.apply(null, this.array); - }), - (p.title = "browser"), - (p.browser = !0), - (p.env = {}), - (p.argv = []), - (p.version = ""), - (p.versions = {}), - (p.on = l), - (p.addListener = l), - (p.once = l), - (p.off = l), - (p.removeListener = l), - (p.removeAllListeners = l), - (p.emit = l), - (p.prependListener = l), - (p.prependOnceListener = l), - (p.listeners = function(t) { - return []; - }), - (p.binding = function(t) { - throw new Error("process.binding is not supported"); - }), - (p.cwd = function() { - return "/"; - }), - (p.chdir = function(t) { - throw new Error("process.chdir is not supported"); - }), - (p.umask = function() { - return 0; - }); - } - ]); - }); - }, - function(t, n) { - t.exports = e; - }, - function(t, e, n) { - "use strict"; - function r(t) { - return t && t.__esModule ? t : { default: t }; - } - function o(t, e) { - var n = {}; - for (var r in t) - e.indexOf(r) >= 0 || - (Object.prototype.hasOwnProperty.call(t, r) && (n[r] = t[r])); - return n; - } - function a(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function i(t, e) { - if (!t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - return !e || ("object" != typeof e && "function" != typeof e) ? t : e; - } - function s(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function, not " + - typeof e - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - enumerable: !1, - writable: !0, - configurable: !0 - } - })), - e && - (Object.setPrototypeOf - ? Object.setPrototypeOf(t, e) - : (t.__proto__ = e)); - } - e.__esModule = !0; - var u = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); - } - return t; - }, - l = n(0), - c = r(l), - f = n(1), - p = r(f), - d = n(6), - h = n(19), - y = r(h), - g = (function(t) { - function e() { - var n, r, o; - a(this, e); - for (var s = arguments.length, u = Array(s), l = 0; l < s; l++) - u[l] = arguments[l]; - return ( - (n = r = i(this, t.call.apply(t, [this].concat(u)))), - (r.state = { - resizing: !1, - width: r.props.width, - height: r.props.height, - slackW: 0, - slackH: 0 - }), - (o = n), - i(r, o) - ); - } - return ( - s(e, t), - (e.prototype.componentWillReceiveProps = function(t) { - this.state.resizing || - (t.width === this.props.width && - t.height === this.props.height) || - this.setState({ width: t.width, height: t.height }); - }), - (e.prototype.lockAspectRatio = function(t, e, n) { - return (e = t / n), (t = e * n), [t, e]; - }), - (e.prototype.runConstraints = function(t, e) { - var n = [this.props.minConstraints, this.props.maxConstraints], - r = n[0], - o = n[1]; - if (this.props.lockAspectRatio) { - var a = this.state.width / this.state.height; - (e = t / a), (t = e * a); - } - if (!r && !o) return [t, e]; - var i = t, - s = e, - u = this.state, - l = u.slackW, - c = u.slackH; - return ( - (t += l), - (e += c), - r && ((t = Math.max(r[0], t)), (e = Math.max(r[1], e))), - o && ((t = Math.min(o[0], t)), (e = Math.min(o[1], e))), - (l += i - t), - (c += s - e), - (l === this.state.slackW && c === this.state.slackH) || - this.setState({ slackW: l, slackH: c }), - [t, e] - ); - }), - (e.prototype.resizeHandler = function(t) { - var e = this; - return function(n, r) { - var o = r.node, - a = r.deltaX, - i = r.deltaY, - s = "both" === e.props.axis || "x" === e.props.axis, - u = "both" === e.props.axis || "y" === e.props.axis, - l = e.state.width + (s ? a : 0), - c = e.state.height + (u ? i : 0), - f = l !== e.state.width, - p = c !== e.state.height; - if ("onResize" !== t || f || p) { - var d = e.runConstraints(l, c); - (l = d[0]), (c = d[1]); - var h = {}; - if ("onResizeStart" === t) h.resizing = !0; - else if ("onResizeStop" === t) - (h.resizing = !1), (h.slackW = h.slackH = 0); - else { - if (l === e.state.width && c === e.state.height) return; - (h.width = l), (h.height = c); - } - "function" == typeof e.props[t] - ? ("function" == typeof n.persist && n.persist(), - e.setState(h, function() { - return e.props[t](n, { - node: o, - size: { width: l, height: c } - }); - })) - : e.setState(h); - } - }; - }), - (e.prototype.render = function() { - var t = this.props, - e = t.children, - n = t.draggableOpts, - r = (t.width, - t.height, - t.handleSize, - t.lockAspectRatio, - t.axis, - t.minConstraints, - t.maxConstraints, - t.onResize, - t.onResizeStop, - t.onResizeStart, - o(t, [ - "children", - "draggableOpts", - "width", - "height", - "handleSize", - "lockAspectRatio", - "axis", - "minConstraints", - "maxConstraints", - "onResize", - "onResizeStop", - "onResizeStart" - ])), - a = r.className - ? r.className + " react-resizable" - : "react-resizable"; - return (0, y.default)( - e, - u({}, r, { - className: a, - children: [ - e.props.children, - c.default.createElement( - d.DraggableCore, - u({}, n, { - key: "resizableHandle", - onStop: this.resizeHandler("onResizeStop"), - onStart: this.resizeHandler("onResizeStart"), - onDrag: this.resizeHandler("onResize") - }), - c.default.createElement("span", { - className: "react-resizable-handle" - }) - ) - ] - }) - ); - }), - e - ); - })(c.default.Component); - (g.propTypes = { - children: p.default.element.isRequired, - width: p.default.number.isRequired, - height: p.default.number.isRequired, - handleSize: p.default.array, - lockAspectRatio: p.default.bool, - axis: p.default.oneOf(["both", "x", "y", "none"]), - minConstraints: p.default.arrayOf(p.default.number), - maxConstraints: p.default.arrayOf(p.default.number), - onResizeStop: p.default.func, - onResizeStart: p.default.func, - onResize: p.default.func, - draggableOpts: p.default.object - }), - (g.defaultProps = { - handleSize: [20, 20], - lockAspectRatio: !1, - axis: "both", - minConstraints: [20, 20], - maxConstraints: [1 / 0, 1 / 0] - }), - (e.default = g); - }, - function(t, e, n) { - "use strict"; - function r(t, e) { - for (var n = i(t), r = n[0], o = 1, a = n.length; o < a; o++) { - var s = n[o]; - e > t[s] && (r = s); - } - return r; - } - function o(t, e) { - if (!e[t]) - throw new Error( - "ResponsiveReactGridLayout: `cols` entry for breakpoint " + - t + - " is missing!" - ); - return e[t]; - } - function a(t, e, n, r, o, a) { - if (t[n]) return (0, s.cloneLayout)(t[n]); - for ( - var u = t[r], - l = i(e), - c = l.slice(l.indexOf(n)), - f = 0, - p = c.length; - f < p; - f++ - ) { - var d = c[f]; - if (t[d]) { - u = t[d]; - break; - } - } - return ( - (u = (0, s.cloneLayout)(u || [])), - (0, s.compact)((0, s.correctBounds)(u, { cols: o }), a, o) - ); - } - function i(t) { - return Object.keys(t).sort(function(e, n) { - return t[e] - t[n]; - }); - } - (e.__esModule = !0), - (e.getBreakpointFromWidth = r), - (e.getColsFromBreakpoint = o), - (e.findOrGenerateResponsiveLayout = a), - (e.sortBreakpoints = i); - var s = n(2); - }, - function(t, e, n) { - "use strict"; - (t.exports = n(4).default), - (t.exports.utils = n(2)), - (t.exports.Responsive = n(21).default), - (t.exports.Responsive.utils = n(9)), - (t.exports.WidthProvider = n(22).default); - }, - function(t, e, n) { - "use strict"; - var r = n(12), - o = n(13), - a = n(14); - t.exports = function() { - function t(t, e, n, r, i, s) { - s !== a && - o( - !1, - "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" - ); - } - function e() { - return t; - } - t.isRequired = t; - var n = { - array: t, - bool: t, - func: t, - number: t, - object: t, - string: t, - symbol: t, - any: t, - arrayOf: e, - element: t, - instanceOf: e, - node: t, - objectOf: e, - oneOf: e, - oneOfType: e, - shape: e, - exact: e - }; - return (n.checkPropTypes = r), (n.PropTypes = n), n; - }; - }, - function(t, e, n) { - "use strict"; - function r(t) { - return function() { - return t; - }; - } - var o = function() {}; - (o.thatReturns = r), - (o.thatReturnsFalse = r(!1)), - (o.thatReturnsTrue = r(!0)), - (o.thatReturnsNull = r(null)), - (o.thatReturnsThis = function() { - return this; - }), - (o.thatReturnsArgument = function(t) { - return t; - }), - (t.exports = o); - }, - function(t, e, n) { - "use strict"; - function r(t, e, n, r, a, i, s, u) { - if ((o(e), !t)) { - var l; - if (void 0 === e) - l = new Error( - "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings." - ); - else { - var c = [n, r, a, i, s, u], - f = 0; - (l = new Error( - e.replace(/%s/g, function() { - return c[f++]; - }) - )), - (l.name = "Invariant Violation"); - } - throw ((l.framesToPop = 1), l); - } - } - var o = function(t) {}; - t.exports = r; - }, - function(t, e, n) { - "use strict"; - t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; - }, - function(t, e) { - var n; - n = (function() { - return this; - })(); - try { - n = n || Function("return this")() || (0, eval)("this"); - } catch (t) { - "object" == typeof window && (n = window); - } - t.exports = n; - }, - function(t, e) { - t.exports = function(t) { - return ( - t.webpackPolyfill || - ((t.deprecate = function() {}), - (t.paths = []), - t.children || (t.children = []), - Object.defineProperty(t, "loaded", { - enumerable: !0, - get: function() { - return t.l; - } - }), - Object.defineProperty(t, "id", { - enumerable: !0, - get: function() { - return t.i; - } - }), - (t.webpackPolyfill = 1)), - t - ); - }; - }, - function(t, e, n) { - "use strict"; - function r(t) { - return t && t.__esModule ? t : { default: t }; - } - function o(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function a(t, e) { - if (!t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - return !e || ("object" != typeof e && "function" != typeof e) ? t : e; - } - function i(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function, not " + - typeof e - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - enumerable: !1, - writable: !0, - configurable: !0 - } - })), - e && - (Object.setPrototypeOf - ? Object.setPrototypeOf(t, e) - : (t.__proto__ = e)); - } - e.__esModule = !0; - var s = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); - } - return t; - }, - u = n(0), - l = r(u), - c = n(1), - f = r(c), - p = n(6), - d = n(18), - h = n(2), - y = n(5), - g = r(y), - m = (function(t) { - function e() { - var n, r, i; - o(this, e); - for (var s = arguments.length, u = Array(s), l = 0; l < s; l++) - u[l] = arguments[l]; - return ( - (n = r = a(this, t.call.apply(t, [this].concat(u)))), - (r.state = { resizing: null, dragging: null, className: "" }), - (i = n), - a(r, i) - ); - } - return ( - i(e, t), - (e.prototype.calcColWidth = function() { - var t = this.props, - e = t.margin, - n = t.containerPadding, - r = t.containerWidth, - o = t.cols; - return (r - e[0] * (o - 1) - 2 * n[0]) / o; - }), - (e.prototype.calcPosition = function(t, e, n, r, o) { - var a = this.props, - i = a.margin, - s = a.containerPadding, - u = a.rowHeight, - l = this.calcColWidth(), - c = { - left: Math.round((l + i[0]) * t + s[0]), - top: Math.round((u + i[1]) * e + s[1]), - width: - n === 1 / 0 - ? n - : Math.round(l * n + Math.max(0, n - 1) * i[0]), - height: - r === 1 / 0 - ? r - : Math.round(u * r + Math.max(0, r - 1) * i[1]) - }; - return ( - o && - o.resizing && - ((c.width = Math.round(o.resizing.width)), - (c.height = Math.round(o.resizing.height))), - o && - o.dragging && - ((c.top = Math.round(o.dragging.top)), - (c.left = Math.round(o.dragging.left))), - c - ); - }), - (e.prototype.calcXY = function(t, e) { - var n = this.props, - r = n.margin, - o = n.cols, - a = n.rowHeight, - i = n.w, - s = n.h, - u = n.maxRows, - l = this.calcColWidth(), - c = Math.round((e - r[0]) / (l + r[0])), - f = Math.round((t - r[1]) / (a + r[1])); - return ( - (c = Math.max(Math.min(c, o - i), 0)), - (f = Math.max(Math.min(f, u - s), 0)), - { x: c, y: f } - ); - }), - (e.prototype.calcWH = function(t) { - var e = t.height, - n = t.width, - r = this.props, - o = r.margin, - a = r.maxRows, - i = r.cols, - s = r.rowHeight, - u = r.x, - l = r.y, - c = this.calcColWidth(), - f = Math.round((n + o[0]) / (c + o[0])), - p = Math.round((e + o[1]) / (s + o[1])); - return ( - (f = Math.max(Math.min(f, i - u), 0)), - (p = Math.max(Math.min(p, a - l), 0)), - { w: f, h: p } - ); - }), - (e.prototype.createStyle = function(t) { - var e = this.props, - n = e.usePercentages, - r = e.containerWidth, - o = e.useCSSTransforms, - a = void 0; - return ( - o - ? (a = (0, h.setTransform)(t)) - : ((a = (0, h.setTopLeft)(t)), - n && - ((a.left = (0, h.perc)(t.left / r)), - (a.width = (0, h.perc)(t.width / r)))), - a - ); - }), - (e.prototype.mixinDraggable = function(t) { - return l.default.createElement( - p.DraggableCore, - { - onStart: this.onDragHandler("onDragStart"), - onDrag: this.onDragHandler("onDrag"), - onStop: this.onDragHandler("onDragStop"), - handle: this.props.handle, - cancel: - ".react-resizable-handle" + - (this.props.cancel ? "," + this.props.cancel : "") - }, - t - ); - }), - (e.prototype.mixinResizable = function(t, e) { - var n = this.props, - r = n.cols, - o = n.x, - a = n.minW, - i = n.minH, - s = n.maxW, - u = n.maxH, - c = this.calcPosition(0, 0, r - o, 0).width, - f = this.calcPosition(0, 0, a, i), - p = this.calcPosition(0, 0, s, u), - h = [f.width, f.height], - y = [Math.min(p.width, c), Math.min(p.height, 1 / 0)]; - return l.default.createElement( - d.Resizable, - { - width: e.width, - height: e.height, - minConstraints: h, - maxConstraints: y, - onResizeStop: this.onResizeHandler("onResizeStop"), - onResizeStart: this.onResizeHandler("onResizeStart"), - onResize: this.onResizeHandler("onResize") - }, - t - ); - }), - (e.prototype.onDragHandler = function(t) { - var e = this; - return function(n, r) { - var o = r.node, - a = r.deltaX, - i = r.deltaY, - s = e.props[t]; - if (s) { - var u = { top: 0, left: 0 }; - switch (t) { - case "onDragStart": - var l = o.offsetParent; - if (!l) return; - var c = l.getBoundingClientRect(), - f = o.getBoundingClientRect(); - (u.left = f.left - c.left + l.scrollLeft), - (u.top = f.top - c.top + l.scrollTop), - e.setState({ dragging: u }); - break; - case "onDrag": - if (!e.state.dragging) - throw new Error("onDrag called before onDragStart."); - (u.left = e.state.dragging.left + a), - (u.top = e.state.dragging.top + i), - e.setState({ dragging: u }); - break; - case "onDragStop": - if (!e.state.dragging) - throw new Error("onDragEnd called before onDragStart."); - (u.left = e.state.dragging.left), - (u.top = e.state.dragging.top), - e.setState({ dragging: null }); - break; - default: - throw new Error( - "onDragHandler called with unrecognized handlerName: " + - t - ); - } - var p = e.calcXY(u.top, u.left), - d = p.x, - h = p.y; - return s.call(e, e.props.i, d, h, { - e: n, - node: o, - newPosition: u - }); - } - }; - }), - (e.prototype.onResizeHandler = function(t) { - var e = this; - return function(n, r) { - var o = r.node, - a = r.size, - i = e.props[t]; - if (i) { - var s = e.props, - u = s.cols, - l = s.x, - c = s.i, - f = s.maxW, - p = s.minW, - d = s.maxH, - h = s.minH, - y = e.calcWH(a), - g = y.w, - m = y.h; - (g = Math.min(g, u - l)), - (g = Math.max(g, 1)), - (g = Math.max(Math.min(g, f), p)), - (m = Math.max(Math.min(m, d), h)), - e.setState({ resizing: "onResizeStop" === t ? null : a }), - i.call(e, c, g, m, { e: n, node: o, size: a }); - } - }; - }), - (e.prototype.render = function() { - var t = this.props, - e = t.x, - n = t.y, - r = t.w, - o = t.h, - a = t.isDraggable, - i = t.isResizable, - u = t.useCSSTransforms, - c = this.calcPosition(e, n, r, o, this.state), - f = l.default.Children.only(this.props.children), - p = l.default.cloneElement(f, { - className: (0, g.default)( - "react-grid-item", - f.props.className, - this.props.className, - { - static: this.props.static, - resizing: Boolean(this.state.resizing), - "react-draggable": a, - "react-draggable-dragging": Boolean(this.state.dragging), - cssTransforms: u - } - ), - style: s( - {}, - this.props.style, - f.props.style, - this.createStyle(c) - ) - }); - return ( - i && (p = this.mixinResizable(p, c)), - a && (p = this.mixinDraggable(p)), - p - ); - }), - e - ); - })(l.default.Component); - (m.propTypes = { - children: f.default.element, - cols: f.default.number.isRequired, - containerWidth: f.default.number.isRequired, - rowHeight: f.default.number.isRequired, - margin: f.default.array.isRequired, - maxRows: f.default.number.isRequired, - containerPadding: f.default.array.isRequired, - x: f.default.number.isRequired, - y: f.default.number.isRequired, - w: f.default.number.isRequired, - h: f.default.number.isRequired, - minW: function(t, e) { - var n = t[e]; - return "number" != typeof n - ? new Error("minWidth not Number") - : n > t.w || n > t.maxW - ? new Error("minWidth larger than item width/maxWidth") - : void 0; - }, - maxW: function(t, e) { - var n = t[e]; - return "number" != typeof n - ? new Error("maxWidth not Number") - : n < t.w || n < t.minW - ? new Error("maxWidth smaller than item width/minWidth") - : void 0; - }, - minH: function(t, e) { - var n = t[e]; - return "number" != typeof n - ? new Error("minHeight not Number") - : n > t.h || n > t.maxH - ? new Error("minHeight larger than item height/maxHeight") - : void 0; - }, - maxH: function(t, e) { - var n = t[e]; - return "number" != typeof n - ? new Error("maxHeight not Number") - : n < t.h || n < t.minH - ? new Error("maxHeight smaller than item height/minHeight") - : void 0; - }, - i: f.default.string.isRequired, - onDragStop: f.default.func, - onDragStart: f.default.func, - onDrag: f.default.func, - onResizeStop: f.default.func, - onResizeStart: f.default.func, - onResize: f.default.func, - isDraggable: f.default.bool.isRequired, - isResizable: f.default.bool.isRequired, - static: f.default.bool, - useCSSTransforms: f.default.bool.isRequired, - className: f.default.string, - handle: f.default.string, - cancel: f.default.string - }), - (m.defaultProps = { - className: "", - cancel: "", - handle: "", - minH: 1, - minW: 1, - maxH: 1 / 0, - maxW: 1 / 0 - }), - (e.default = m); - }, - function(t, e, n) { - "use strict"; - (t.exports = function() { - throw new Error( - "Don't instantiate Resizable directly! Use require('react-resizable').Resizable" - ); - }), - (t.exports.Resizable = n(8).default), - (t.exports.ResizableBox = n(20).default); - }, - function(t, e, n) { - "use strict"; - var r = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); - } - return t; - }, - o = n(0), - a = (function(t) { - return t && t.__esModule ? t : { default: t }; - })(o); - t.exports = function(t, e) { - return ( - e.style && t.props.style && (e.style = r({}, t.props.style, e.style)), - e.className && - t.props.className && - (e.className = t.props.className + " " + e.className), - a.default.cloneElement(t, e) - ); - }; - }, - function(t, e, n) { - "use strict"; - function r(t) { - return t && t.__esModule ? t : { default: t }; - } - function o(t, e) { - var n = {}; - for (var r in t) - e.indexOf(r) >= 0 || - (Object.prototype.hasOwnProperty.call(t, r) && (n[r] = t[r])); - return n; - } - function a(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function i(t, e) { - if (!t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - return !e || ("object" != typeof e && "function" != typeof e) ? t : e; - } - function s(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function, not " + - typeof e - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - enumerable: !1, - writable: !0, - configurable: !0 - } - })), - e && - (Object.setPrototypeOf - ? Object.setPrototypeOf(t, e) - : (t.__proto__ = e)); - } - e.__esModule = !0; - var u = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); - } - return t; - }, - l = n(0), - c = r(l), - f = n(1), - p = r(f), - d = n(8), - h = r(d), - y = (function(t) { - function e() { - var n, r, o; - a(this, e); - for (var s = arguments.length, u = Array(s), l = 0; l < s; l++) - u[l] = arguments[l]; - return ( - (n = r = i(this, t.call.apply(t, [this].concat(u)))), - (r.state = { width: r.props.width, height: r.props.height }), - (r.onResize = function(t, e) { - var n = e.size; - n.width, n.height; - r.props.onResize - ? (t.persist && t.persist(), - r.setState(n, function() { - return r.props.onResize && r.props.onResize(t, e); - })) - : r.setState(n); - }), - (o = n), - i(r, o) - ); - } - return ( - s(e, t), - (e.prototype.componentWillReceiveProps = function(t) { - (t.width === this.props.width && - t.height === this.props.height) || - this.setState({ width: t.width, height: t.height }); - }), - (e.prototype.render = function() { - var t = this.props, - e = t.handleSize, - n = (t.onResize, t.onResizeStart), - r = t.onResizeStop, - a = t.draggableOpts, - i = t.minConstraints, - s = t.maxConstraints, - l = t.lockAspectRatio, - f = t.axis, - p = (t.width, - t.height, - o(t, [ - "handleSize", - "onResize", - "onResizeStart", - "onResizeStop", - "draggableOpts", - "minConstraints", - "maxConstraints", - "lockAspectRatio", - "axis", - "width", - "height" - ])); - return c.default.createElement( - h.default, - { - handleSize: e, - width: this.state.width, - height: this.state.height, - onResizeStart: n, - onResize: this.onResize, - onResizeStop: r, - draggableOpts: a, - minConstraints: i, - maxConstraints: s, - lockAspectRatio: l, - axis: f - }, - c.default.createElement( - "div", - u( - { - style: { - width: this.state.width + "px", - height: this.state.height + "px" - } - }, - p - ) - ) - ); - }), - e - ); - })(c.default.Component); - (y.propTypes = { height: p.default.number, width: p.default.number }), - (y.defaultProps = { handleSize: [20, 20] }), - (e.default = y); - }, - function(t, e, n) { - "use strict"; - function r(t) { - return t && t.__esModule ? t : { default: t }; - } - function o(t, e) { - var n = {}; - for (var r in t) - e.indexOf(r) >= 0 || - (Object.prototype.hasOwnProperty.call(t, r) && (n[r] = t[r])); - return n; - } - function a(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function i(t, e) { - if (!t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - return !e || ("object" != typeof e && "function" != typeof e) ? t : e; - } - function s(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function, not " + - typeof e - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - enumerable: !1, - writable: !0, - configurable: !0 - } - })), - e && - (Object.setPrototypeOf - ? Object.setPrototypeOf(t, e) - : (t.__proto__ = e)); - } - e.__esModule = !0; - var u = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); - } - return t; - }, - l = n(0), - c = r(l), - f = n(1), - p = r(f), - d = n(3), - h = r(d), - y = n(2), - g = n(9), - m = n(4), - v = r(m), - b = function(t) { - return Object.prototype.toString.call(t); - }, - w = (function(t) { - function e() { - var n, r, o; - a(this, e); - for (var s = arguments.length, l = Array(s), c = 0; c < s; c++) - l[c] = arguments[c]; - return ( - (n = r = i(this, t.call.apply(t, [this].concat(l)))), - (r.state = r.generateInitialState()), - (r.onLayoutChange = function(t) { - var e; - r.props.onLayoutChange( - t, - u( - {}, - r.props.layouts, - ((e = {}), (e[r.state.breakpoint] = t), e) - ) - ); - }), - (o = n), - i(r, o) - ); - } - return ( - s(e, t), - (e.prototype.generateInitialState = function() { - var t = this.props, - e = t.width, - n = t.breakpoints, - r = t.layouts, - o = t.cols, - a = (0, g.getBreakpointFromWidth)(n, e), - i = (0, g.getColsFromBreakpoint)(a, o), - s = - !1 === this.props.verticalCompact - ? null - : this.props.compactType; - return { - layout: (0, g.findOrGenerateResponsiveLayout)(r, n, a, a, i, s), - breakpoint: a, - cols: i - }; - }), - (e.prototype.componentWillReceiveProps = function(t) { - if ( - t.width == this.props.width && - t.breakpoint === this.props.breakpoint && - (0, h.default)(t.breakpoints, this.props.breakpoints) && - (0, h.default)(t.cols, this.props.cols) - ) { - if (!(0, h.default)(t.layouts, this.props.layouts)) { - var e = this.state, - n = e.breakpoint, - r = e.cols, - o = (0, g.findOrGenerateResponsiveLayout)( - t.layouts, - t.breakpoints, - n, - n, - r, - t.compactType - ); - this.setState({ layout: o }); - } - } else this.onWidthChange(t); - }), - (e.prototype.onWidthChange = function(t) { - var e = t.breakpoints, - n = t.cols, - r = t.layouts, - o = t.compactType, - a = - t.breakpoint || - (0, g.getBreakpointFromWidth)(t.breakpoints, t.width), - i = this.state.breakpoint; - if ( - i !== a || - this.props.breakpoints !== e || - this.props.cols !== n - ) { - i in r || (r[i] = (0, y.cloneLayout)(this.state.layout)); - var s = (0, g.getColsFromBreakpoint)(a, n), - u = (0, g.findOrGenerateResponsiveLayout)(r, e, a, i, s, o); - (u = (0, y.synchronizeLayoutWithChildren)(u, t.children, s, o)), - (r[a] = u), - this.props.onLayoutChange(u, r), - this.props.onBreakpointChange(a, s), - this.props.onWidthChange( - t.width, - t.margin, - s, - t.containerPadding - ), - this.setState({ breakpoint: a, layout: u, cols: s }); - } - }), - (e.prototype.render = function() { - var t = this.props, - e = (t.breakpoint, - t.breakpoints, - t.cols, - t.layouts, - t.onBreakpointChange, - t.onLayoutChange, - t.onWidthChange, - o(t, [ - "breakpoint", - "breakpoints", - "cols", - "layouts", - "onBreakpointChange", - "onLayoutChange", - "onWidthChange" - ])); - return c.default.createElement( - v.default, - u({}, e, { - onLayoutChange: this.onLayoutChange, - layout: this.state.layout, - cols: this.state.cols - }) - ); - }), - e - ); - })(c.default.Component); - (w.propTypes = { - breakpoint: p.default.string, - breakpoints: p.default.object, - cols: p.default.object, - layouts: function(t, e) { - if ("[object Object]" !== b(t[e])) - throw new Error( - "Layout property must be an object. Received: " + b(t[e]) - ); - Object.keys(t[e]).forEach(function(e) { - if (!(e in t.breakpoints)) - throw new Error( - "Each key in layouts must align with a key in breakpoints." - ); - (0, y.validateLayout)(t.layouts[e], "layouts." + e); - }); - }, - width: p.default.number.isRequired, - onBreakpointChange: p.default.func, - onLayoutChange: p.default.func, - onWidthChange: p.default.func - }), - (w.defaultProps = { - breakpoints: { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }, - cols: { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }, - layouts: {}, - onBreakpointChange: y.noop, - onLayoutChange: y.noop, - onWidthChange: y.noop - }), - (e.default = w); - }, - function(t, e, n) { - "use strict"; - function r(t) { - return t && t.__esModule ? t : { default: t }; - } - function o(t, e) { - var n = {}; - for (var r in t) - e.indexOf(r) >= 0 || - (Object.prototype.hasOwnProperty.call(t, r) && (n[r] = t[r])); - return n; - } - function a(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function i(t, e) { - if (!t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - return !e || ("object" != typeof e && "function" != typeof e) ? t : e; - } - function s(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function, not " + - typeof e - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - enumerable: !1, - writable: !0, - configurable: !0 - } - })), - e && - (Object.setPrototypeOf - ? Object.setPrototypeOf(t, e) - : (t.__proto__ = e)); - } - function u(t) { - var e, n; - return ( - (n = e = (function(e) { - function n() { - var t, r, o; - a(this, n); - for (var s = arguments.length, u = Array(s), l = 0; l < s; l++) - u[l] = arguments[l]; - return ( - (t = r = i(this, e.call.apply(e, [this].concat(u)))), - (r.state = { width: 1280 }), - (r.mounted = !1), - (r.onWindowResize = function() { - if (r.mounted) { - var t = y.default.findDOMNode(r); - t instanceof HTMLElement && - r.setState({ width: t.offsetWidth }); - } - }), - (o = t), - i(r, o) - ); - } - return ( - s(n, e), - (n.prototype.componentDidMount = function() { - (this.mounted = !0), - window.addEventListener("resize", this.onWindowResize), - this.onWindowResize(); - }), - (n.prototype.componentWillUnmount = function() { - (this.mounted = !1), - window.removeEventListener("resize", this.onWindowResize); - }), - (n.prototype.render = function() { - var e = this.props, - n = e.measureBeforeMount, - r = o(e, ["measureBeforeMount"]); - return n && !this.mounted - ? f.default.createElement("div", { - className: this.props.className, - style: this.props.style - }) - : f.default.createElement(t, l({}, r, this.state)); - }), - n - ); - })(f.default.Component)), - (e.defaultProps = { measureBeforeMount: !1 }), - (e.propTypes = { measureBeforeMount: d.default.bool }), - n - ); - } - e.__esModule = !0; - var l = - Object.assign || - function(t) { - for (var e = 1; e < arguments.length; e++) { - var n = arguments[e]; - for (var r in n) - Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); - } - return t; - }; - e.default = u; - var c = n(0), - f = r(c), - p = n(1), - d = r(p), - h = n(7), - y = r(h); - } - ]); -}); -//# sourceMappingURL=react-grid-layout.min.js.map +*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||void 0===window.document)return"";var e=window.document.documentElement.style;if(t in e)return"";for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{})}function M(t){return"both"===t.props.axis||"x"===t.props.axis}function L(t){return"both"===t.props.axis||"y"===t.props.axis}function N(t,e,n){var r="number"==typeof e?function(t,e){return t.targetTouches&&p(t.targetTouches,(function(t){return e===t.identifier}))||t.changedTouches&&p(t.changedTouches,(function(t){return e===t.identifier}))}(t,e):null;if("number"==typeof e&&!r)return null;var o=A(n);return function(t,e,n){var r=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect();return{x:(t.clientX+e.scrollLeft-r.left)/n,y:(t.clientY+e.scrollTop-r.top)/n}}(r||t,n.props.offsetParent||o.offsetParent||o.ownerDocument.body,n.props.scale)}function H(t,e,n){var r=t.state,o=!d(r.lastX),a=A(t);return o?{node:a,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:a,deltaX:e-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:e,y:n}}function W(t,e){var n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function A(t){var e=u.a.findDOMNode(t);if(!e)throw new Error(": Unmounted during event!");return e}function I(t){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function B(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function q(t,e){for(var n=0;n not mounted on DragStart!");var r=e.ownerDocument;if(!(n.props.disabled||!(t.target instanceof r.defaultView.Node)||n.props.handle&&!j(t.target,n.props.handle,e)||n.props.cancel&&j(t.target,n.props.cancel,e))){var o=function(t){return t.targetTouches&&t.targetTouches[0]?t.targetTouches[0].identifier:t.changedTouches&&t.changedTouches[0]?t.changedTouches[0].identifier:void 0}(t);n.setState({touchIdentifier:o});var a=N(t,o,Y(n));if(null!=a){var i=a.x,s=a.y,c=H(Y(n),i,s);n.props.onStart,!1!==n.props.onStart(t,c)&&(n.props.enableUserSelectHack&&C(r),n.setState({dragging:!0,lastX:i,lastY:s}),x(r,$.move,n.handleDrag),x(r,$.stop,n.handleDragStop))}}})),F(Y(n),"handleDrag",(function(t){"touchmove"===t.type&&t.preventDefault();var e=N(t,n.state.touchIdentifier,Y(n));if(null!=e){var r,o,a,i=e.x,s=e.y;if(Array.isArray(n.props.grid)){var u=i-n.state.lastX,c=s-n.state.lastY,l=B((r=n.props.grid,o=u,a=c,[Math.round(o/r[0])*r[0],Math.round(a/r[1])*r[1]]),2);if(u=l[0],c=l[1],!u&&!c)return;i=n.state.lastX+u,s=n.state.lastY+c}var p=H(Y(n),i,s);if(!1!==n.props.onDrag(t,p))n.setState({lastX:i,lastY:s});else try{n.handleDragStop(new MouseEvent("mouseup"))}catch(t){var f=document.createEvent("MouseEvents");f.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.handleDragStop(f)}}})),F(Y(n),"handleDragStop",(function(t){if(n.state.dragging){var e=N(t,n.state.touchIdentifier,Y(n));if(null!=e){var r=e.x,o=e.y,a=H(Y(n),r,o),i=u.a.findDOMNode(Y(n));i&&n.props.enableUserSelectHack&&E(i.ownerDocument),n.setState({dragging:!1,lastX:NaN,lastY:NaN}),n.props.onStop(t,a),i&&(D(i.ownerDocument,$.move,n.handleDrag),D(i.ownerDocument,$.stop,n.handleDragStop))}}})),F(Y(n),"onMouseDown",(function(t){return $=V,n.handleDragStart(t)})),F(Y(n),"onMouseUp",(function(t){return $=V,n.handleDragStop(t)})),F(Y(n),"onTouchStart",(function(t){return $=G,n.handleDragStart(t)})),F(Y(n),"onTouchEnd",(function(t){return $=G,n.handleDragStop(t)})),n}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&X(t,e)}(e,o.a.Component),n=e,(r=[{key:"componentWillUnmount",value:function(){var t=u.a.findDOMNode(this);if(t){var e=t.ownerDocument;D(e,V.move,this.handleDrag),D(e,G.move,this.handleDrag),D(e,V.stop,this.handleDragStop),D(e,G.stop,this.handleDragStop),this.props.enableUserSelectHack&&E(e)}}},{key:"render",value:function(){return o.a.cloneElement(o.a.Children.only(this.props.children),{style:T(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}])&&q(n.prototype,r),e}();function K(t){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Q(){return(Q=Object.assign||function(t){for(var e=1;e, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(e,o.a.Component),ot(e,null,[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.position,r=e.prevPropsPosition;return!n||r&&n.x===r.x&&n.y===r.y?null:{x:n.x,y:n.y,prevPropsPosition:tt({},n)}}}]),ot(e,[{key:"componentDidMount",value:function(){void 0!==window.SVGElement&&u.a.findDOMNode(this)instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"render",value:function(){var t,e=this.props,n=(e.axis,e.bounds,e.children),r=e.defaultPosition,a=e.defaultClassName,i=e.defaultClassNameDragging,s=e.defaultClassNameDragged,u=e.position,c=e.positionOffset,p=(e.scale,function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"])),f={},d=null,h=!Boolean(u)||this.state.dragging,y=u||r,g={x:M(this)&&h?this.state.x:y.x,y:L(this)&&h?this.state.y:y.y};this.state.isElementSVG?d=function(t,e){return k(t,e,"")}(g,c):f=function(t,e){var n=k(t,e,"px");return w({},b("transform",m),n)}(g,c);var v=l()(n.props.className||"",a,(it(t={},i,this.state.dragging),it(t,s,this.state.dragged),t));return o.a.createElement(J,Q({},p,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),o.a.cloneElement(o.a.Children.only(n),{className:v,style:tt({},n.props.style,{},f),transform:d}))}}]),e}();it(st,"displayName","Draggable"),it(st,"propTypes",tt({},J.propTypes,{axis:i.a.oneOf(["both","x","y","none"]),bounds:i.a.oneOfType([i.a.shape({left:i.a.number,right:i.a.number,top:i.a.number,bottom:i.a.number}),i.a.string,i.a.oneOf([!1])]),defaultClassName:i.a.string,defaultClassNameDragging:i.a.string,defaultClassNameDragged:i.a.string,defaultPosition:i.a.shape({x:i.a.number,y:i.a.number}),positionOffset:i.a.shape({x:i.a.oneOfType([i.a.number,i.a.string]),y:i.a.oneOfType([i.a.number,i.a.string])}),position:i.a.shape({x:i.a.number,y:i.a.number}),className:y,style:y,transform:y})),it(st,"defaultProps",tt({},J.defaultProps,{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},position:null,scale:1}))}]))},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return G}));var r=n(2),o=n.n(r),a=n(3),i=n.n(a),s=n(6),u=n.n(s),c=n(1);function l(t){var e=t.margin,n=t.containerPadding,r=t.containerWidth,o=t.cols;return(r-e[0]*(o-1)-2*n[0])/o}function p(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function f(t,e,n,r,o,a){var i=t.margin,s=t.containerPadding,u=t.rowHeight,c=l(t),f={};return a&&a.resizing?(f.width=Math.round(a.resizing.width),f.height=Math.round(a.resizing.height)):(f.width=p(r,c,i[0]),f.height=p(o,u,i[1])),a&&a.dragging?(f.top=Math.round(a.dragging.top),f.left=Math.round(a.dragging.left)):(f.top=Math.round((u+i[1])*n+s[1]),f.left=Math.round((c+i[0])*e+s[0])),f}function d(t,e,n,r,o){var a=t.margin,i=t.cols,s=t.rowHeight,u=t.maxRows,c=l(t),p=Math.round((n-a[0])/(c+a[0])),f=Math.round((e-a[1])/(s+a[1]));return{x:p=h(p,0,i-r),y:f=h(f,0,u-o)}}function h(t,e,n){return Math.max(Math.min(t,n),e)}var y=n(5),g=n.n(y),b=n(0),m=n.n(b),v=n(7),w=n(10);function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}},{key:"createStyle",value:function(t){var e,n=this.props,r=n.usePercentages,o=n.containerWidth;return n.useCSSTransforms?e=Object(c.setTransform)(t):(e=Object(c.setTopLeft)(t),r&&(e.left=Object(c.perc)(t.left/o),e.width=Object(c.perc)(t.width/o))),e}},{key:"mixinDraggable",value:function(t,e){return o.a.createElement(v.DraggableCore,{disabled:!e,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale},t)}},{key:"mixinResizable",value:function(t,e,n){var r=this.props,a=r.cols,i=r.x,s=r.minW,u=r.minH,c=r.maxW,l=r.maxH,p=r.transformScale,d=this.getPositionParams(),h=f(d,0,0,a-i,0).width,y=f(d,0,0,s,u),g=f(d,0,0,c,l),b=[y.width,y.height],m=[Math.min(g.width,h),Math.min(g.height,1/0)];return o.a.createElement(w.Resizable,{draggableOpts:{disabled:!n},className:n?void 0:"react-resizable-hide",width:e.width,height:e.height,minConstraints:b,maxConstraints:m,onResizeStop:this.onResizeStop,onResizeStart:this.onResizeStart,onResize:this.onResize,transformScale:p},t)}},{key:"onResizeHandler",value:function(t,e,n){var r=e.node,o=e.size,a=this.props[n];if(a){var i=this.props,s=i.cols,u=i.x,c=i.y,p=i.i,f=i.maxH,d=i.minH,y=this.props,g=y.minW,b=y.maxW,m=function(t,e,n,r,o){var a=t.margin,i=t.maxRows,s=t.cols,u=t.rowHeight,c=l(t),p=Math.round((e+a[0])/(c+a[0])),f=Math.round((n+a[1])/(u+a[1]));return{w:p=h(p,0,s-r),h:f=h(f,0,i-o)}}(this.getPositionParams(),o.width,o.height,u,c),v=m.w,w=m.h;v=h(v,g=Math.max(g,1),b=Math.min(b,s-u)),w=h(w,d,f),this.setState({resizing:"onResizeStop"===n?null:o}),a.call(this,p,v,w,{e:t,node:r,size:o})}}},{key:"render",value:function(){var t=this.props,e=t.x,n=t.y,r=t.w,a=t.h,i=t.isDraggable,s=t.isResizable,c=t.droppingPosition,l=t.useCSSTransforms,p=f(this.getPositionParams(),e,n,r,a,this.state),d=o.a.Children.only(this.props.children),h=o.a.cloneElement(d,{className:u()("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:Boolean(this.state.resizing),"react-draggable":i,"react-draggable-dragging":Boolean(this.state.dragging),dropping:Boolean(c),cssTransforms:l}),style:j(j(j({},this.props.style),d.props.style),this.createStyle(p))});return h=this.mixinResizable(h,p,s),h=this.mixinDraggable(h,i)}}])&&D(e.prototype,n),r&&D(e,r),i}(o.a.Component);C(E,"propTypes",{children:m.a.element,cols:m.a.number.isRequired,containerWidth:m.a.number.isRequired,rowHeight:m.a.number.isRequired,margin:m.a.array.isRequired,maxRows:m.a.number.isRequired,containerPadding:m.a.array.isRequired,x:m.a.number.isRequired,y:m.a.number.isRequired,w:m.a.number.isRequired,h:m.a.number.isRequired,minW:function(t,e){var n=t[e];return"number"!=typeof n?new Error("minWidth not Number"):n>t.w||n>t.maxW?new Error("minWidth larger than item width/maxWidth"):void 0},maxW:function(t,e){var n=t[e];return"number"!=typeof n?new Error("maxWidth not Number"):nt.h||n>t.maxH?new Error("minHeight larger than item height/maxHeight"):void 0},maxH:function(t,e){var n=t[e];return"number"!=typeof n?new Error("maxHeight not Number"):nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0){var g=1/0,b=1/0;y.forEach((function(t){t.x>d.x&&(g=Math.min(g,t.x)),t.y>d.y&&(b=Math.min(b,t.y))})),Number.isFinite(g)&&(d.w=g-d.x),Number.isFinite(b)&&(d.h=b-d.y)}}h||(d.w=e,d.h=n);var m={w:d.w,h:d.h,x:d.x,y:d.y,static:!0,i:t};this.props.onResize(s,u,d,m,o,a),this.setState({layout:Object(c.compact)(s,Object(c.compactType)(this.props),p),activeDrag:m})}}},{key:"onResizeStop",value:function(t,e,n,r){var o=r.e,a=r.node,i=this.state,s=i.layout,u=i.oldResizeItem,l=this.props.cols,p=Object(c.getLayoutItem)(s,t);this.props.onResizeStop(s,u,p,null,o,a);var f=Object(c.compact)(s,Object(c.compactType)(this.props),l),d=this.state.oldLayout;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null}),this.onLayoutMaybeChanged(f,d)}},{key:"placeholder",value:function(){var t=this.state.activeDrag;if(!t)return null;var e=this.props,n=e.width,r=e.cols,a=e.margin,i=e.containerPadding,s=e.rowHeight,u=e.maxRows,c=e.useCSSTransforms,l=e.transformScale;return(o.a.createElement(E,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder",containerWidth:n,cols:r,margin:a,containerPadding:i||a,maxRows:u,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:c,transformScale:l},o.a.createElement("div",null)))}},{key:"processGridItem",value:function(t,e){if(t&&t.key){var n=Object(c.getLayoutItem)(this.state.layout,String(t.key));if(!n)return null;var r=this.props,a=r.width,i=r.cols,s=r.margin,u=r.containerPadding,l=r.rowHeight,p=r.maxRows,f=r.isDraggable,d=r.isResizable,h=r.isBounded,y=r.useCSSTransforms,g=r.transformScale,b=r.draggableCancel,m=r.draggableHandle,v=this.state,w=v.mounted,O=v.droppingPosition,S="boolean"==typeof n.isDraggable?n.isDraggable:!n.static&&f,j="boolean"==typeof n.isResizable?n.isResizable:!n.static&&d,x=S&&h&&!1!==n.isBounded;return o.a.createElement(E,{containerWidth:a,cols:i,margin:s,containerPadding:u||s,maxRows:p,rowHeight:l,cancel:b,handle:m,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:S,isResizable:j,isBounded:x,useCSSTransforms:y&&w,usePercentages:!w,transformScale:g,w:n.w,h:n.h,x:n.x,y:n.y,i:n.i,minH:n.minH,minW:n.minW,maxH:n.maxH,maxW:n.maxW,static:n.static,droppingPosition:e?O:void 0},t)}}},{key:"render",value:function(){var t=this,e=this.props,n=e.className,r=e.style,a=e.isDroppable,i=e.innerRef,s=u()("react-grid-layout",n),l=N({height:this.containerHeight()},r);return o.a.createElement("div",{ref:i,className:s,style:l,onDrop:a?this.onDrop:c.noop,onDragLeave:a?this.onDragLeave:c.noop,onDragEnter:a?this.onDragEnter:c.noop,onDragOver:a?this.onDragOver:c.noop},o.a.Children.map(this.props.children,(function(e){return t.processGridItem(e)})),a&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}])&&A(e.prototype,n),r&&A(e,r),s}(o.a.Component);X(G,"displayName","ReactGridLayout"),X(G,"propTypes",T),X(G,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},onLayoutChange:c.noop,onDragStart:c.noop,onDrag:c.noop,onDragStop:c.noop,onResizeStart:c.noop,onResize:c.noop,onResizeStop:c.noop,onDrop:c.noop})},function(t,e,n){"use strict";e.__esModule=!0,e.default=void 0;var r=s(n(2)),o=s(n(0)),a=n(7),i=n(17);function s(t){return t&&t.__esModule?t:{default:t}}function u(){return(u=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(e,["children","draggableOpts","width","height","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"])),f=l.className?l.className+" react-resizable":"react-resizable";return(0,i.cloneElement)(n,function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles"]);return r.default.createElement(a.default,{handle:e,handleSize:n,width:this.state.width,height:this.state.height,onResizeStart:o,onResize:this.onResize,onResizeStop:i,draggableOpts:u,minConstraints:c,maxConstraints:l,lockAspectRatio:p,axis:f,resizeHandles:d},r.default.createElement("div",s({style:{width:this.state.width+"px",height:this.state.height+"px"}},h)))},o}(r.default.Component);e.default=l,c(l,"propTypes",{height:o.default.number,width:o.default.number}),c(l,"defaultProps",{handleSize:[20,20]})},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return P}));var r=n(2),o=n(0),a=n.n(o),i=n(3),s=n.n(i),u=n(1),c=n(4),l=n(8);function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(){return(f=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n max) max = bottomY;\n }\n return max;\n}\n\nfunction cloneLayout(layout) {\n var newLayout = Array(layout.length);\n for (var _i2 = 0, len = layout.length; _i2 < len; _i2++) {\n newLayout[_i2] = cloneLayoutItem(layout[_i2]);\n }\n return newLayout;\n}\n\n// Fast path to cloning, since this is monomorphic\nfunction cloneLayoutItem(layoutItem) {\n return {\n w: layoutItem.w,\n h: layoutItem.h,\n x: layoutItem.x,\n y: layoutItem.y,\n i: layoutItem.i,\n minW: layoutItem.minW,\n maxW: layoutItem.maxW,\n minH: layoutItem.minH,\n maxH: layoutItem.maxH,\n moved: Boolean(layoutItem.moved),\n static: Boolean(layoutItem.static),\n // These can be null\n isDraggable: layoutItem.isDraggable,\n isResizable: layoutItem.isResizable\n };\n}\n\n/**\n * Comparing React `children` is a bit difficult. This is a good way to compare them.\n * This will catch differences in keys, order, and length.\n */\nfunction childrenEqual(a, b) {\n return (0, _lodash2.default)(_react2.default.Children.map(a, function (c) {\n return c.key;\n }), _react2.default.Children.map(b, function (c) {\n return c.key;\n }));\n}\n\n/**\n * Given two layoutitems, check if they collide.\n */\nfunction collides(l1, l2) {\n if (l1 === l2) return false; // same element\n if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2\n if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2\n if (l1.y + l1.h <= l2.y) return false; // l1 is above l2\n if (l1.y >= l2.y + l2.h) return false; // l1 is below l2\n return true; // boxes overlap\n}\n\n/**\n * Given a layout, compact it. This involves going down each y coordinate and removing gaps\n * between items.\n *\n * @param {Array} layout Layout.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} Compacted Layout.\n */\nfunction compact(layout, compactType, cols) {\n // Statics go in the compareWith array right away so items flow around them.\n var compareWith = getStatics(layout);\n // We go through the items by row and column.\n var sorted = sortLayoutItems(layout, compactType);\n // Holding for new items.\n var out = Array(layout.length);\n\n for (var _i3 = 0, len = sorted.length; _i3 < len; _i3++) {\n var l = cloneLayoutItem(sorted[_i3]);\n\n // Don't move static elements\n if (!l.static) {\n l = compactItem(compareWith, l, compactType, cols, sorted);\n\n // Add to comparison array. We only collide with items before this one.\n // Statics are already in this array.\n compareWith.push(l);\n }\n\n // Add to output array to make sure they still come out in the right order.\n out[layout.indexOf(sorted[_i3])] = l;\n\n // Clear moved flag, if it exists.\n l.moved = false;\n }\n\n return out;\n}\n\nvar heightWidth = { x: \"w\", y: \"h\" };\n/**\n * Before moving item down, it will check if the movement will cause collisions and move those items down before.\n */\nfunction resolveCompactionCollision(layout, item, moveToCoord, axis) {\n var sizeProp = heightWidth[axis];\n item[axis] += 1;\n var itemIndex = layout.indexOf(item);\n\n // Go through each item we collide with.\n for (var _i4 = itemIndex + 1; _i4 < layout.length; _i4++) {\n var otherItem = layout[_i4];\n // Ignore static items\n if (otherItem.static) continue;\n\n // Optimization: we can break early if we know we're past this el\n // We can do this b/c it's a sorted layout\n if (otherItem.y > item.y + item.h) break;\n\n if (collides(item, otherItem)) {\n resolveCompactionCollision(layout, otherItem, moveToCoord + item[sizeProp], axis);\n }\n }\n\n item[axis] = moveToCoord;\n}\n\n/**\n * Compact an item in the layout.\n */\nfunction compactItem(compareWith, l, compactType, cols, fullLayout) {\n var compactV = compactType === \"vertical\";\n var compactH = compactType === \"horizontal\";\n if (compactV) {\n // Bottom 'y' possible is the bottom of the layout.\n // This allows you to do nice stuff like specify {y: Infinity}\n // This is here because the layout must be sorted in order to get the correct bottom `y`.\n l.y = Math.min(bottom(compareWith), l.y);\n // Move the element up as far as it can go without colliding.\n while (l.y > 0 && !getFirstCollision(compareWith, l)) {\n l.y--;\n }\n } else if (compactH) {\n l.y = Math.min(bottom(compareWith), l.y);\n // Move the element left as far as it can go without colliding.\n while (l.x > 0 && !getFirstCollision(compareWith, l)) {\n l.x--;\n }\n }\n\n // Move it down, and keep moving it down if it's colliding.\n var collides = void 0;\n while (collides = getFirstCollision(compareWith, l)) {\n if (compactH) {\n resolveCompactionCollision(fullLayout, l, collides.x + collides.w, \"x\");\n } else {\n resolveCompactionCollision(fullLayout, l, collides.y + collides.h, \"y\");\n }\n // Since we can't grow without bounds horizontally, if we've overflown, let's move it down and try again.\n if (compactH && l.x + l.w > cols) {\n l.x = cols - l.w;\n l.y++;\n }\n }\n return l;\n}\n\n/**\n * Given a layout, make sure all elements fit within its bounds.\n *\n * @param {Array} layout Layout array.\n * @param {Number} bounds Number of columns.\n */\nfunction correctBounds(layout, bounds) {\n var collidesWith = getStatics(layout);\n for (var _i5 = 0, len = layout.length; _i5 < len; _i5++) {\n var l = layout[_i5];\n // Overflows right\n if (l.x + l.w > bounds.cols) l.x = bounds.cols - l.w;\n // Overflows left\n if (l.x < 0) {\n l.x = 0;\n l.w = bounds.cols;\n }\n if (!l.static) collidesWith.push(l);else {\n // If this is static and collides with other statics, we must move it down.\n // We have to do something nicer than just letting them overlap.\n while (getFirstCollision(collidesWith, l)) {\n l.y++;\n }\n }\n }\n return layout;\n}\n\n/**\n * Get a layout item by ID. Used so we can override later on if necessary.\n *\n * @param {Array} layout Layout array.\n * @param {String} id ID\n * @return {LayoutItem} Item at ID.\n */\nfunction getLayoutItem(layout, id) {\n for (var _i6 = 0, len = layout.length; _i6 < len; _i6++) {\n if (layout[_i6].i === id) return layout[_i6];\n }\n}\n\n/**\n * Returns the first item this layout collides with.\n * It doesn't appear to matter which order we approach this from, although\n * perhaps that is the wrong thing to do.\n *\n * @param {Object} layoutItem Layout item.\n * @return {Object|undefined} A colliding layout item, or undefined.\n */\nfunction getFirstCollision(layout, layoutItem) {\n for (var _i7 = 0, len = layout.length; _i7 < len; _i7++) {\n if (collides(layout[_i7], layoutItem)) return layout[_i7];\n }\n}\n\nfunction getAllCollisions(layout, layoutItem) {\n return layout.filter(function (l) {\n return collides(l, layoutItem);\n });\n}\n\n/**\n * Get all static elements.\n * @param {Array} layout Array of layout objects.\n * @return {Array} Array of static layout items..\n */\nfunction getStatics(layout) {\n return layout.filter(function (l) {\n return l.static;\n });\n}\n\n/**\n * Move an element. Responsible for doing cascading movements of other elements.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} l element to move.\n * @param {Number} [x] X position in grid units.\n * @param {Number} [y] Y position in grid units.\n */\nfunction moveElement(layout, l, x, y, isUserAction, preventCollision, compactType, cols) {\n if (l.static) return layout;\n\n // Short-circuit if nothing to do.\n if (l.y === y && l.x === x) return layout;\n\n log(\"Moving element \" + l.i + \" to [\" + String(x) + \",\" + String(y) + \"] from [\" + l.x + \",\" + l.y + \"]\");\n var oldX = l.x;\n var oldY = l.y;\n\n // This is quite a bit faster than extending the object\n if (typeof x === 'number') l.x = x;\n if (typeof y === 'number') l.y = y;\n l.moved = true;\n\n // If this collides with anything, move it.\n // When doing this comparison, we have to sort the items we compare with\n // to ensure, in the case of multiple collisions, that we're getting the\n // nearest collision.\n var sorted = sortLayoutItems(layout, compactType);\n var movingUp = compactType === \"vertical\" && typeof y === 'number' ? oldY >= y : compactType === \"horizontal\" && typeof x === 'number' ? oldX >= x : false;\n if (movingUp) sorted = sorted.reverse();\n var collisions = getAllCollisions(sorted, l);\n\n // There was a collision; abort\n if (preventCollision && collisions.length) {\n log(\"Collision prevented on \" + l.i + \", reverting.\");\n l.x = oldX;\n l.y = oldY;\n l.moved = false;\n return layout;\n }\n\n // Move each item that collides away from this element.\n for (var _i8 = 0, len = collisions.length; _i8 < len; _i8++) {\n var collision = collisions[_i8];\n log(\"Resolving collision between \" + l.i + \" at [\" + l.x + \",\" + l.y + \"] and \" + collision.i + \" at [\" + collision.x + \",\" + collision.y + \"]\");\n\n // Short circuit so we can't infinite loop\n if (collision.moved) continue;\n\n // Don't move static items - we have to move *this* element away\n if (collision.static) {\n layout = moveElementAwayFromCollision(layout, collision, l, isUserAction, compactType, cols);\n } else {\n layout = moveElementAwayFromCollision(layout, l, collision, isUserAction, compactType, cols);\n }\n }\n\n return layout;\n}\n\n/**\n * This is where the magic needs to happen - given a collision, move an element away from the collision.\n * We attempt to move it up if there's room, otherwise it goes below.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} collidesWith Layout item we're colliding with.\n * @param {LayoutItem} itemToMove Layout item we're moving.\n */\nfunction moveElementAwayFromCollision(layout, collidesWith, itemToMove, isUserAction, compactType, cols) {\n var compactH = compactType === \"horizontal\";\n var compactV = compactType === \"vertical\";\n var preventCollision = false; // we're already colliding\n\n // If there is enough space above the collision to put this element, move it there.\n // We only do this on the main collision as this can get funky in cascades and cause\n // unwanted swapping behavior.\n if (isUserAction) {\n // Reset isUserAction flag because we're not in the main collision anymore.\n isUserAction = false;\n\n // Make a mock item so we don't modify the item here, only modify in moveElement.\n var fakeItem = {\n x: compactH ? Math.max(collidesWith.x - itemToMove.w, 0) : itemToMove.x,\n y: compactV ? Math.max(collidesWith.y - itemToMove.h, 0) : itemToMove.y,\n w: itemToMove.w,\n h: itemToMove.h,\n i: \"-1\"\n };\n\n // No collision? If so, we can go up there; otherwise, we'll end up moving down as normal\n if (!getFirstCollision(layout, fakeItem)) {\n log(\"Doing reverse collision on \" + itemToMove.i + \" up to [\" + fakeItem.x + \",\" + fakeItem.y + \"].\");\n return moveElement(layout, itemToMove, compactH ? fakeItem.x : undefined, compactV ? fakeItem.y : undefined, isUserAction, preventCollision, compactType, cols);\n }\n }\n\n return moveElement(layout, itemToMove, compactH ? itemToMove.x + 1 : undefined, compactV ? itemToMove.y + 1 : undefined, isUserAction, preventCollision, compactType, cols);\n}\n\n/**\n * Helper to convert a number to a percentage string.\n *\n * @param {Number} num Any number\n * @return {String} That number as a percentage.\n */\nfunction perc(num) {\n return num * 100 + \"%\";\n}\n\nfunction setTransform(_ref) {\n var top = _ref.top,\n left = _ref.left,\n width = _ref.width,\n height = _ref.height;\n\n // Replace unitless items with px\n var translate = \"translate(\" + left + \"px,\" + top + \"px)\";\n return {\n transform: translate,\n WebkitTransform: translate,\n MozTransform: translate,\n msTransform: translate,\n OTransform: translate,\n width: width + \"px\",\n height: height + \"px\",\n position: \"absolute\"\n };\n}\n\nfunction setTopLeft(_ref2) {\n var top = _ref2.top,\n left = _ref2.left,\n width = _ref2.width,\n height = _ref2.height;\n\n return {\n top: top + \"px\",\n left: left + \"px\",\n width: width + \"px\",\n height: height + \"px\",\n position: \"absolute\"\n };\n}\n\n/**\n * Get layout items sorted from top left to right and down.\n *\n * @return {Array} Array of layout objects.\n * @return {Array} Layout, sorted static items first.\n */\nfunction sortLayoutItems(layout, compactType) {\n if (compactType === \"horizontal\") return sortLayoutItemsByColRow(layout);else return sortLayoutItemsByRowCol(layout);\n}\n\nfunction sortLayoutItemsByRowCol(layout) {\n return [].concat(layout).sort(function (a, b) {\n if (a.y > b.y || a.y === b.y && a.x > b.x) {\n return 1;\n } else if (a.y === b.y && a.x === b.x) {\n // Without this, we can get different sort results in IE vs. Chrome/FF\n return 0;\n }\n return -1;\n });\n}\n\nfunction sortLayoutItemsByColRow(layout) {\n return [].concat(layout).sort(function (a, b) {\n if (a.x > b.x || a.x === b.x && a.y > b.y) {\n return 1;\n }\n return -1;\n });\n}\n\n/**\n * Generate a layout using the initialLayout and children as a template.\n * Missing entries will be added, extraneous ones will be truncated.\n *\n * @param {Array} initialLayout Layout passed in through props.\n * @param {String} breakpoint Current responsive breakpoint.\n * @param {?String} compact Compaction option.\n * @return {Array} Working layout.\n */\nfunction synchronizeLayoutWithChildren(initialLayout, children, cols, compactType) {\n initialLayout = initialLayout || [];\n\n // Generate one layout item per child.\n var layout = [];\n _react2.default.Children.forEach(children, function (child, i) {\n // Don't overwrite if it already exists.\n var exists = getLayoutItem(initialLayout, String(child.key));\n if (exists) {\n layout[i] = cloneLayoutItem(exists);\n } else {\n if (!isProduction && child.props._grid) {\n console.warn(\"`_grid` properties on children have been deprecated as of React 15.2. \" + // eslint-disable-line\n \"Please use `data-grid` or add your properties directly to the `layout`.\");\n }\n var g = child.props[\"data-grid\"] || child.props._grid;\n\n // Hey, this item has a data-grid property, use it.\n if (g) {\n if (!isProduction) {\n validateLayout([g], \"ReactGridLayout.children\");\n }\n layout[i] = cloneLayoutItem(_extends({}, g, { i: child.key }));\n } else {\n // Nothing provided: ensure this is added to the bottom\n layout[i] = cloneLayoutItem({\n w: 1,\n h: 1,\n x: 0,\n y: bottom(layout),\n i: String(child.key)\n });\n }\n }\n });\n\n // Correct the layout.\n layout = correctBounds(layout, { cols: cols });\n layout = compact(layout, compactType, cols);\n\n return layout;\n}\n\n/**\n * Validate a layout. Throws errors.\n *\n * @param {Array} layout Array of layout items.\n * @param {String} [contextName] Context name for errors.\n * @throw {Error} Validation error.\n */\nfunction validateLayout(layout) {\n var contextName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"Layout\";\n\n var subProps = [\"x\", \"y\", \"w\", \"h\"];\n if (!Array.isArray(layout)) throw new Error(contextName + \" must be an array!\");\n for (var _i9 = 0, len = layout.length; _i9 < len; _i9++) {\n var item = layout[_i9];\n for (var j = 0; j < subProps.length; j++) {\n if (typeof item[subProps[j]] !== \"number\") {\n throw new Error(\"ReactGridLayout: \" + contextName + \"[\" + _i9 + \"].\" + subProps[j] + \" must be a number!\");\n }\n }\n if (item.i && typeof item.i !== \"string\") {\n throw new Error(\"ReactGridLayout: \" + contextName + \"[\" + _i9 + \"].i must be a string!\");\n }\n if (item.static !== undefined && typeof item.static !== \"boolean\") {\n throw new Error(\"ReactGridLayout: \" + contextName + \"[\" + _i9 + \"].static must be a boolean!\");\n }\n }\n}\n\n// Flow can't really figure this out, so we just use Object\nfunction autoBindHandlers(el, fns) {\n fns.forEach(function (key) {\n return el[key] = el[key].bind(el);\n });\n}\n\nfunction log() {\n var _console;\n\n if (!DEBUG) return;\n // eslint-disable-next-line no-console\n (_console = console).log.apply(_console, arguments);\n}\n\nvar noop = exports.noop = function noop() {};\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15), __webpack_require__(16)(module)))\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(1);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _lodash = __webpack_require__(3);\n\nvar _lodash2 = _interopRequireDefault(_lodash);\n\nvar _classnames = __webpack_require__(5);\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _utils = __webpack_require__(2);\n\nvar _GridItem = __webpack_require__(17);\n\nvar _GridItem2 = _interopRequireDefault(_GridItem);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// End Types\n\n/**\n * A reactive, fluid grid layout with draggable, resizable components.\n */\n\n// Types\nvar ReactGridLayout = function (_React$Component) {\n _inherits(ReactGridLayout, _React$Component);\n\n // TODO publish internal ReactClass displayName transform\n function ReactGridLayout(props, context) {\n _classCallCheck(this, ReactGridLayout);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));\n\n _initialiseProps.call(_this);\n\n (0, _utils.autoBindHandlers)(_this, [\"onDragStart\", \"onDrag\", \"onDragStop\", \"onResizeStart\", \"onResize\", \"onResizeStop\"]);\n return _this;\n }\n\n ReactGridLayout.prototype.componentDidMount = function componentDidMount() {\n this.setState({ mounted: true });\n // Possibly call back with layout on mount. This should be done after correcting the layout width\n // to ensure we don't rerender with the wrong width.\n this.onLayoutMaybeChanged(this.state.layout, this.props.layout);\n };\n\n ReactGridLayout.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n var newLayoutBase = void 0;\n // Legacy support for compactType\n // Allow parent to set layout directly.\n if (!(0, _lodash2.default)(nextProps.layout, this.props.layout) || nextProps.compactType !== this.props.compactType) {\n newLayoutBase = nextProps.layout;\n } else if (!(0, _utils.childrenEqual)(this.props.children, nextProps.children)) {\n // If children change, also regenerate the layout. Use our state\n // as the base in case because it may be more up to date than\n // what is in props.\n newLayoutBase = this.state.layout;\n }\n\n // We need to regenerate the layout.\n if (newLayoutBase) {\n var newLayout = (0, _utils.synchronizeLayoutWithChildren)(newLayoutBase, nextProps.children, nextProps.cols, this.compactType(nextProps));\n var _oldLayout = this.state.layout;\n this.setState({ layout: newLayout });\n this.onLayoutMaybeChanged(newLayout, _oldLayout);\n }\n };\n\n /**\n * Calculates a pixel value for the container.\n * @return {String} Container height in pixels.\n */\n\n\n ReactGridLayout.prototype.containerHeight = function containerHeight() {\n if (!this.props.autoSize) return;\n var nbRow = (0, _utils.bottom)(this.state.layout);\n var containerPaddingY = this.props.containerPadding ? this.props.containerPadding[1] : this.props.margin[1];\n return nbRow * this.props.rowHeight + (nbRow - 1) * this.props.margin[1] + containerPaddingY * 2 + \"px\";\n };\n\n ReactGridLayout.prototype.compactType = function compactType(props) {\n if (!props) props = this.props;\n return props.verticalCompact === false ? null : props.compactType;\n };\n\n /**\n * When dragging starts\n * @param {String} i Id of the child\n * @param {Number} x X position of the move\n * @param {Number} y Y position of the move\n * @param {Event} e The mousedown event\n * @param {Element} node The current dragging DOM element\n */\n\n\n ReactGridLayout.prototype.onDragStart = function onDragStart(i, x, y, _ref) {\n var e = _ref.e,\n node = _ref.node;\n var layout = this.state.layout;\n\n var l = (0, _utils.getLayoutItem)(layout, i);\n if (!l) return;\n\n this.setState({\n oldDragItem: (0, _utils.cloneLayoutItem)(l),\n oldLayout: this.state.layout\n });\n\n return this.props.onDragStart(layout, l, l, null, e, node);\n };\n\n /**\n * Each drag movement create a new dragelement and move the element to the dragged location\n * @param {String} i Id of the child\n * @param {Number} x X position of the move\n * @param {Number} y Y position of the move\n * @param {Event} e The mousedown event\n * @param {Element} node The current dragging DOM element\n */\n\n\n ReactGridLayout.prototype.onDrag = function onDrag(i, x, y, _ref2) {\n var e = _ref2.e,\n node = _ref2.node;\n var oldDragItem = this.state.oldDragItem;\n var layout = this.state.layout;\n var cols = this.props.cols;\n\n var l = (0, _utils.getLayoutItem)(layout, i);\n if (!l) return;\n\n // Create placeholder (display only)\n var placeholder = {\n w: l.w,\n h: l.h,\n x: l.x,\n y: l.y,\n placeholder: true,\n i: i\n };\n\n // Move the element to the dragged location.\n var isUserAction = true;\n layout = (0, _utils.moveElement)(layout, l, x, y, isUserAction, this.props.preventCollision, this.compactType(), cols);\n\n this.props.onDrag(layout, oldDragItem, l, placeholder, e, node);\n\n this.setState({\n layout: (0, _utils.compact)(layout, this.compactType(), cols),\n activeDrag: placeholder\n });\n };\n\n /**\n * When dragging stops, figure out which position the element is closest to and update its x and y.\n * @param {String} i Index of the child.\n * @param {Number} x X position of the move\n * @param {Number} y Y position of the move\n * @param {Event} e The mousedown event\n * @param {Element} node The current dragging DOM element\n */\n\n\n ReactGridLayout.prototype.onDragStop = function onDragStop(i, x, y, _ref3) {\n var e = _ref3.e,\n node = _ref3.node;\n var oldDragItem = this.state.oldDragItem;\n var layout = this.state.layout;\n var _props = this.props,\n cols = _props.cols,\n preventCollision = _props.preventCollision;\n\n var l = (0, _utils.getLayoutItem)(layout, i);\n if (!l) return;\n\n // Move the element here\n var isUserAction = true;\n layout = (0, _utils.moveElement)(layout, l, x, y, isUserAction, preventCollision, this.compactType(), cols);\n\n this.props.onDragStop(layout, oldDragItem, l, null, e, node);\n\n // Set state\n var newLayout = (0, _utils.compact)(layout, this.compactType(), cols);\n var oldLayout = this.state.oldLayout;\n\n this.setState({\n activeDrag: null,\n layout: newLayout,\n oldDragItem: null,\n oldLayout: null\n });\n\n this.onLayoutMaybeChanged(newLayout, oldLayout);\n };\n\n ReactGridLayout.prototype.onLayoutMaybeChanged = function onLayoutMaybeChanged(newLayout, oldLayout) {\n if (!oldLayout) oldLayout = this.state.layout;\n if (!(0, _lodash2.default)(oldLayout, newLayout)) {\n this.props.onLayoutChange(newLayout);\n }\n };\n\n ReactGridLayout.prototype.onResizeStart = function onResizeStart(i, w, h, _ref4) {\n var e = _ref4.e,\n node = _ref4.node;\n var layout = this.state.layout;\n\n var l = (0, _utils.getLayoutItem)(layout, i);\n if (!l) return;\n\n this.setState({\n oldResizeItem: (0, _utils.cloneLayoutItem)(l),\n oldLayout: this.state.layout\n });\n\n this.props.onResizeStart(layout, l, l, null, e, node);\n };\n\n ReactGridLayout.prototype.onResize = function onResize(i, w, h, _ref5) {\n var e = _ref5.e,\n node = _ref5.node;\n var _state = this.state,\n layout = _state.layout,\n oldResizeItem = _state.oldResizeItem;\n var _props2 = this.props,\n cols = _props2.cols,\n preventCollision = _props2.preventCollision;\n\n var l = (0, _utils.getLayoutItem)(layout, i);\n if (!l) return;\n\n // Something like quad tree should be used\n // to find collisions faster\n var hasCollisions = void 0;\n if (preventCollision) {\n var collisions = (0, _utils.getAllCollisions)(layout, _extends({}, l, { w: w, h: h })).filter(function (layoutItem) {\n return layoutItem.i !== l.i;\n });\n hasCollisions = collisions.length > 0;\n\n // If we're colliding, we need adjust the placeholder.\n if (hasCollisions) {\n // adjust w && h to maximum allowed space\n var leastX = Infinity,\n leastY = Infinity;\n collisions.forEach(function (layoutItem) {\n if (layoutItem.x > l.x) leastX = Math.min(leastX, layoutItem.x);\n if (layoutItem.y > l.y) leastY = Math.min(leastY, layoutItem.y);\n });\n\n if (Number.isFinite(leastX)) l.w = leastX - l.x;\n if (Number.isFinite(leastY)) l.h = leastY - l.y;\n }\n }\n\n if (!hasCollisions) {\n // Set new width and height.\n l.w = w;\n l.h = h;\n }\n\n // Create placeholder element (display only)\n var placeholder = {\n w: l.w,\n h: l.h,\n x: l.x,\n y: l.y,\n static: true,\n i: i\n };\n\n this.props.onResize(layout, oldResizeItem, l, placeholder, e, node);\n\n // Re-compact the layout and set the drag placeholder.\n this.setState({\n layout: (0, _utils.compact)(layout, this.compactType(), cols),\n activeDrag: placeholder\n });\n };\n\n ReactGridLayout.prototype.onResizeStop = function onResizeStop(i, w, h, _ref6) {\n var e = _ref6.e,\n node = _ref6.node;\n var _state2 = this.state,\n layout = _state2.layout,\n oldResizeItem = _state2.oldResizeItem;\n var cols = this.props.cols;\n\n var l = (0, _utils.getLayoutItem)(layout, i);\n\n this.props.onResizeStop(layout, oldResizeItem, l, null, e, node);\n\n // Set state\n var newLayout = (0, _utils.compact)(layout, this.compactType(), cols);\n var oldLayout = this.state.oldLayout;\n\n this.setState({\n activeDrag: null,\n layout: newLayout,\n oldResizeItem: null,\n oldLayout: null\n });\n\n this.onLayoutMaybeChanged(newLayout, oldLayout);\n };\n\n /**\n * Create a placeholder object.\n * @return {Element} Placeholder div.\n */\n\n\n ReactGridLayout.prototype.placeholder = function placeholder() {\n var activeDrag = this.state.activeDrag;\n\n if (!activeDrag) return null;\n var _props3 = this.props,\n width = _props3.width,\n cols = _props3.cols,\n margin = _props3.margin,\n containerPadding = _props3.containerPadding,\n rowHeight = _props3.rowHeight,\n maxRows = _props3.maxRows,\n useCSSTransforms = _props3.useCSSTransforms;\n\n // {...this.state.activeDrag} is pretty slow, actually\n\n return _react2.default.createElement(\n _GridItem2.default,\n {\n w: activeDrag.w,\n h: activeDrag.h,\n x: activeDrag.x,\n y: activeDrag.y,\n i: activeDrag.i,\n className: \"react-grid-placeholder\",\n containerWidth: width,\n cols: cols,\n margin: margin,\n containerPadding: containerPadding || margin,\n maxRows: maxRows,\n rowHeight: rowHeight,\n isDraggable: false,\n isResizable: false,\n useCSSTransforms: useCSSTransforms\n },\n _react2.default.createElement(\"div\", null)\n );\n };\n\n /**\n * Given a grid item, set its style attributes & surround in a .\n * @param {Element} child React element.\n * @return {Element} Element wrapped in draggable and properly placed.\n */\n\n\n ReactGridLayout.prototype.processGridItem = function processGridItem(child) {\n if (!child || !child.key) return;\n var l = (0, _utils.getLayoutItem)(this.state.layout, String(child.key));\n if (!l) return null;\n var _props4 = this.props,\n width = _props4.width,\n cols = _props4.cols,\n margin = _props4.margin,\n containerPadding = _props4.containerPadding,\n rowHeight = _props4.rowHeight,\n maxRows = _props4.maxRows,\n isDraggable = _props4.isDraggable,\n isResizable = _props4.isResizable,\n useCSSTransforms = _props4.useCSSTransforms,\n draggableCancel = _props4.draggableCancel,\n draggableHandle = _props4.draggableHandle;\n var mounted = this.state.mounted;\n\n // Parse 'static'. Any properties defined directly on the grid item will take precedence.\n\n var draggable = Boolean(!l.static && isDraggable && (l.isDraggable || l.isDraggable == null));\n var resizable = Boolean(!l.static && isResizable && (l.isResizable || l.isResizable == null));\n\n return _react2.default.createElement(\n _GridItem2.default,\n {\n containerWidth: width,\n cols: cols,\n margin: margin,\n containerPadding: containerPadding || margin,\n maxRows: maxRows,\n rowHeight: rowHeight,\n cancel: draggableCancel,\n handle: draggableHandle,\n onDragStop: this.onDragStop,\n onDragStart: this.onDragStart,\n onDrag: this.onDrag,\n onResizeStart: this.onResizeStart,\n onResize: this.onResize,\n onResizeStop: this.onResizeStop,\n isDraggable: draggable,\n isResizable: resizable,\n useCSSTransforms: useCSSTransforms && mounted,\n usePercentages: !mounted,\n w: l.w,\n h: l.h,\n x: l.x,\n y: l.y,\n i: l.i,\n minH: l.minH,\n minW: l.minW,\n maxH: l.maxH,\n maxW: l.maxW,\n \"static\": l.static\n },\n child\n );\n };\n\n ReactGridLayout.prototype.render = function render() {\n var _this2 = this;\n\n var _props5 = this.props,\n className = _props5.className,\n style = _props5.style;\n\n\n var mergedClassName = (0, _classnames2.default)(\"react-grid-layout\", className);\n var mergedStyle = _extends({\n height: this.containerHeight()\n }, style);\n\n return _react2.default.createElement(\n \"div\",\n { className: mergedClassName, style: mergedStyle },\n _react2.default.Children.map(this.props.children, function (child) {\n return _this2.processGridItem(child);\n }),\n this.placeholder()\n );\n };\n\n return ReactGridLayout;\n}(_react2.default.Component);\n\nReactGridLayout.displayName = \"ReactGridLayout\";\nReactGridLayout.propTypes = {\n //\n // Basic props\n //\n className: _propTypes2.default.string,\n style: _propTypes2.default.object,\n\n // This can be set explicitly. If it is not set, it will automatically\n // be set to the container width. Note that resizes will *not* cause this to adjust.\n // If you need that behavior, use WidthProvider.\n width: _propTypes2.default.number,\n\n // If true, the container height swells and contracts to fit contents\n autoSize: _propTypes2.default.bool,\n // # of cols.\n cols: _propTypes2.default.number,\n\n // A selector that will not be draggable.\n draggableCancel: _propTypes2.default.string,\n // A selector for the draggable handler\n draggableHandle: _propTypes2.default.string,\n\n // Deprecated\n verticalCompact: function verticalCompact(props) {\n if (props.verticalCompact === false && \"production\" !== \"production\") {\n console.warn(\n // eslint-disable-line no-console\n \"`verticalCompact` on is deprecated and will be removed soon. \" + 'Use `compactType`: \"horizontal\" | \"vertical\" | null.');\n }\n },\n // Choose vertical or hotizontal compaction\n compactType: _propTypes2.default.oneOf([\"vertical\", \"horizontal\"]),\n\n // layout is an array of object with the format:\n // {x: Number, y: Number, w: Number, h: Number, i: String}\n layout: function layout(props) {\n var layout = props.layout;\n // I hope you're setting the data-grid property on the grid items\n if (layout === undefined) return;\n (0, _utils.validateLayout)(layout, \"layout\");\n },\n\n //\n // Grid Dimensions\n //\n\n // Margin between items [x, y] in px\n margin: _propTypes2.default.arrayOf(_propTypes2.default.number),\n // Padding inside the container [x, y] in px\n containerPadding: _propTypes2.default.arrayOf(_propTypes2.default.number),\n // Rows have a static height, but you can change this based on breakpoints if you like\n rowHeight: _propTypes2.default.number,\n // Default Infinity, but you can specify a max here if you like.\n // Note that this isn't fully fleshed out and won't error if you specify a layout that\n // extends beyond the row capacity. It will, however, not allow users to drag/resize\n // an item past the barrier. They can push items beyond the barrier, though.\n // Intentionally not documented for this reason.\n maxRows: _propTypes2.default.number,\n\n //\n // Flags\n //\n isDraggable: _propTypes2.default.bool,\n isResizable: _propTypes2.default.bool,\n // If true, grid items won't change position when being dragged over.\n preventCollision: _propTypes2.default.bool,\n // Use CSS transforms instead of top/left\n useCSSTransforms: _propTypes2.default.bool,\n\n //\n // Callbacks\n //\n\n // Callback so you can save the layout. Calls after each drag & resize stops.\n onLayoutChange: _propTypes2.default.func,\n\n // Calls when drag starts. Callback is of the signature (layout, oldItem, newItem, placeholder, e, ?node).\n // All callbacks below have the same signature. 'start' and 'stop' callbacks omit the 'placeholder'.\n onDragStart: _propTypes2.default.func,\n // Calls on each drag movement.\n onDrag: _propTypes2.default.func,\n // Calls when drag is complete.\n onDragStop: _propTypes2.default.func,\n //Calls when resize starts.\n onResizeStart: _propTypes2.default.func,\n // Calls when resize movement happens.\n onResize: _propTypes2.default.func,\n // Calls when resize is complete.\n onResizeStop: _propTypes2.default.func,\n\n //\n // Other validations\n //\n\n // Children must not have duplicate keys.\n children: function children(props, propName) {\n var children = props[propName];\n\n // Check children keys for duplicates. Throw if found.\n var keys = {};\n _react2.default.Children.forEach(children, function (child) {\n if (keys[child.key]) {\n throw new Error('Duplicate child key \"' + child.key + '\" found! This will cause problems in ReactGridLayout.');\n }\n keys[child.key] = true;\n });\n }\n};\nReactGridLayout.defaultProps = {\n autoSize: true,\n cols: 12,\n className: \"\",\n style: {},\n draggableHandle: \"\",\n draggableCancel: \"\",\n containerPadding: null,\n rowHeight: 150,\n maxRows: Infinity, // infinite vertical growth\n layout: [],\n margin: [10, 10],\n isDraggable: true,\n isResizable: true,\n useCSSTransforms: true,\n verticalCompact: true,\n compactType: \"vertical\",\n preventCollision: false,\n onLayoutChange: _utils.noop,\n onDragStart: _utils.noop,\n onDrag: _utils.noop,\n onDragStop: _utils.noop,\n onResizeStart: _utils.noop,\n onResize: _utils.noop,\n onResizeStop: _utils.noop\n};\n\nvar _initialiseProps = function _initialiseProps() {\n this.state = {\n activeDrag: null,\n layout: (0, _utils.synchronizeLayoutWithChildren)(this.props.layout, this.props.children, this.props.cols,\n // Legacy support for verticalCompact: false\n this.compactType()),\n mounted: false,\n oldDragItem: null,\n oldLayout: null,\n oldResizeItem: null\n };\n};\n\nexports.default = ReactGridLayout;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n\t\t\treturn classNames;\n\t\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(7), __webpack_require__(0));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react-dom\", \"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactDraggable\"] = factory(require(\"react-dom\"), require(\"react\"));\n\telse\n\t\troot[\"ReactDraggable\"] = factory(root[\"ReactDOM\"], root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_6__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 12);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findInArray = findInArray;\nexports.isFunction = isFunction;\nexports.isNum = isNum;\nexports.int = int;\nexports.dontSetMe = dontSetMe;\n\n// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc\nfunction findInArray(array /*: Array | TouchList*/, callback /*: Function*/) /*: any*/ {\n for (var i = 0, length = array.length; i < length; i++) {\n if (callback.apply(callback, [array[i], i, array])) return array[i];\n }\n}\n\nfunction isFunction(func /*: any*/) /*: boolean*/ {\n return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';\n}\n\nfunction isNum(num /*: any*/) /*: boolean*/ {\n return typeof num === 'number' && !isNaN(num);\n}\n\nfunction int(a /*: string*/) /*: number*/ {\n return parseInt(a, 10);\n}\n\nfunction dontSetMe(props /*: Object*/, propName /*: string*/, componentName /*: string*/) {\n if (props[propName]) {\n return new Error('Invalid prop ' + propName + ' passed to ' + componentName + ' - do not set this, set it on the child.');\n }\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.matchesSelector = matchesSelector;\nexports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;\nexports.addEvent = addEvent;\nexports.removeEvent = removeEvent;\nexports.outerHeight = outerHeight;\nexports.outerWidth = outerWidth;\nexports.innerHeight = innerHeight;\nexports.innerWidth = innerWidth;\nexports.offsetXYFromParent = offsetXYFromParent;\nexports.createCSSTransform = createCSSTransform;\nexports.createSVGTransform = createSVGTransform;\nexports.getTouch = getTouch;\nexports.getTouchIdentifier = getTouchIdentifier;\nexports.addUserSelectStyles = addUserSelectStyles;\nexports.removeUserSelectStyles = removeUserSelectStyles;\nexports.styleHacks = styleHacks;\nexports.addClassName = addClassName;\nexports.removeClassName = removeClassName;\n\nvar _shims = __webpack_require__(0);\n\nvar _getPrefix = __webpack_require__(19);\n\nvar _getPrefix2 = _interopRequireDefault(_getPrefix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/*:: import type {ControlPosition, MouseTouchEvent} from './types';*/\n\n\nvar matchesSelectorFunc = '';\nfunction matchesSelector(el /*: Node*/, selector /*: string*/) /*: boolean*/ {\n if (!matchesSelectorFunc) {\n matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {\n // $FlowIgnore: Doesn't think elements are indexable\n return (0, _shims.isFunction)(el[method]);\n });\n }\n\n // Might not be found entirely (not an Element?) - in that case, bail\n // $FlowIgnore: Doesn't think elements are indexable\n if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false;\n\n // $FlowIgnore: Doesn't think elements are indexable\n return el[matchesSelectorFunc](selector);\n}\n\n// Works up the tree to the draggable itself attempting to match selector.\nfunction matchesSelectorAndParentsTo(el /*: Node*/, selector /*: string*/, baseNode /*: Node*/) /*: boolean*/ {\n var node = el;\n do {\n if (matchesSelector(node, selector)) return true;\n if (node === baseNode) return false;\n node = node.parentNode;\n } while (node);\n\n return false;\n}\n\nfunction addEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {\n if (!el) {\n return;\n }\n if (el.attachEvent) {\n el.attachEvent('on' + event, handler);\n } else if (el.addEventListener) {\n el.addEventListener(event, handler, true);\n } else {\n // $FlowIgnore: Doesn't think elements are indexable\n el['on' + event] = handler;\n }\n}\n\nfunction removeEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {\n if (!el) {\n return;\n }\n if (el.detachEvent) {\n el.detachEvent('on' + event, handler);\n } else if (el.removeEventListener) {\n el.removeEventListener(event, handler, true);\n } else {\n // $FlowIgnore: Doesn't think elements are indexable\n el['on' + event] = null;\n }\n}\n\nfunction outerHeight(node /*: HTMLElement*/) /*: number*/ {\n // This is deliberately excluding margin for our calculations, since we are using\n // offsetTop which is including margin. See getBoundPosition\n var height = node.clientHeight;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n height += (0, _shims.int)(computedStyle.borderTopWidth);\n height += (0, _shims.int)(computedStyle.borderBottomWidth);\n return height;\n}\n\nfunction outerWidth(node /*: HTMLElement*/) /*: number*/ {\n // This is deliberately excluding margin for our calculations, since we are using\n // offsetLeft which is including margin. See getBoundPosition\n var width = node.clientWidth;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n width += (0, _shims.int)(computedStyle.borderLeftWidth);\n width += (0, _shims.int)(computedStyle.borderRightWidth);\n return width;\n}\nfunction innerHeight(node /*: HTMLElement*/) /*: number*/ {\n var height = node.clientHeight;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n height -= (0, _shims.int)(computedStyle.paddingTop);\n height -= (0, _shims.int)(computedStyle.paddingBottom);\n return height;\n}\n\nfunction innerWidth(node /*: HTMLElement*/) /*: number*/ {\n var width = node.clientWidth;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n width -= (0, _shims.int)(computedStyle.paddingLeft);\n width -= (0, _shims.int)(computedStyle.paddingRight);\n return width;\n}\n\n// Get from offsetParent\nfunction offsetXYFromParent(evt /*: {clientX: number, clientY: number}*/, offsetParent /*: HTMLElement*/) /*: ControlPosition*/ {\n var isBody = offsetParent === offsetParent.ownerDocument.body;\n var offsetParentRect = isBody ? { left: 0, top: 0 } : offsetParent.getBoundingClientRect();\n\n var x = evt.clientX + offsetParent.scrollLeft - offsetParentRect.left;\n var y = evt.clientY + offsetParent.scrollTop - offsetParentRect.top;\n\n return { x: x, y: y };\n}\n\nfunction createCSSTransform(_ref) /*: Object*/ {\n var x = _ref.x,\n y = _ref.y;\n\n // Replace unitless items with px\n return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix2.default), 'translate(' + x + 'px,' + y + 'px)');\n}\n\nfunction createSVGTransform(_ref3) /*: string*/ {\n var x = _ref3.x,\n y = _ref3.y;\n\n return 'translate(' + x + ',' + y + ')';\n}\n\nfunction getTouch(e /*: MouseTouchEvent*/, identifier /*: number*/) /*: ?{clientX: number, clientY: number}*/ {\n return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) {\n return identifier === t.identifier;\n }) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) {\n return identifier === t.identifier;\n });\n}\n\nfunction getTouchIdentifier(e /*: MouseTouchEvent*/) /*: ?number*/ {\n if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;\n if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;\n}\n\n// User-select Hacks:\n//\n// Useful for preventing blue highlights all over everything when dragging.\n\n// Note we're passing `document` b/c we could be iframed\nfunction addUserSelectStyles(doc /*: ?Document*/) {\n if (!doc) return;\n var styleEl = doc.getElementById('react-draggable-style-el');\n if (!styleEl) {\n styleEl = doc.createElement('style');\n styleEl.type = 'text/css';\n styleEl.id = 'react-draggable-style-el';\n styleEl.innerHTML = '.react-draggable-transparent-selection *::-moz-selection {background: transparent;}\\n';\n styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {background: transparent;}\\n';\n doc.getElementsByTagName('head')[0].appendChild(styleEl);\n }\n if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection');\n}\n\nfunction removeUserSelectStyles(doc /*: ?Document*/) {\n try {\n if (doc && doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection');\n window.getSelection().removeAllRanges(); // remove selection caused by scroll\n } catch (e) {\n // probably IE\n }\n}\n\nfunction styleHacks() /*: Object*/ {\n var childStyle /*: Object*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n // Workaround IE pointer events; see #51\n // https://github.com/mzabriskie/react-draggable/issues/51#issuecomment-103488278\n return _extends({\n touchAction: 'none'\n }, childStyle);\n}\n\nfunction addClassName(el /*: HTMLElement*/, className /*: string*/) {\n if (el.classList) {\n el.classList.add(className);\n } else {\n if (!el.className.match(new RegExp('(?:^|\\\\s)' + className + '(?!\\\\S)'))) {\n el.className += ' ' + className;\n }\n }\n}\n\nfunction removeClassName(el /*: HTMLElement*/, className /*: string*/) {\n if (el.classList) {\n el.classList.remove(className);\n } else {\n el.className = el.className.replace(new RegExp('(?:^|\\\\s)' + className + '(?!\\\\S)', 'g'), '');\n }\n}\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_6__;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = __webpack_require__(14)(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(17)();\n}\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\nvar emptyFunction = __webpack_require__(1);\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getBoundPosition = getBoundPosition;\nexports.snapToGrid = snapToGrid;\nexports.canDragX = canDragX;\nexports.canDragY = canDragY;\nexports.getControlPosition = getControlPosition;\nexports.createCoreData = createCoreData;\nexports.createDraggableData = createDraggableData;\n\nvar _shims = __webpack_require__(0);\n\nvar _reactDom = __webpack_require__(4);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _domFns = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/*:: import type Draggable from '../Draggable';*/\n/*:: import type {Bounds, ControlPosition, DraggableData, MouseTouchEvent} from './types';*/\n/*:: import type DraggableCore from '../DraggableCore';*/\nfunction getBoundPosition(draggable /*: Draggable*/, x /*: number*/, y /*: number*/) /*: [number, number]*/ {\n // If no bounds, short-circuit and move on\n if (!draggable.props.bounds) return [x, y];\n\n // Clone new bounds\n var bounds = draggable.props.bounds;\n\n bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);\n var node = findDOMNode(draggable);\n\n if (typeof bounds === 'string') {\n var ownerDocument = node.ownerDocument;\n\n var ownerWindow = ownerDocument.defaultView;\n var boundNode = void 0;\n if (bounds === 'parent') {\n boundNode = node.parentNode;\n } else {\n boundNode = ownerDocument.querySelector(bounds);\n }\n if (!(boundNode instanceof HTMLElement)) {\n throw new Error('Bounds selector \"' + bounds + '\" could not find an element.');\n }\n var nodeStyle = ownerWindow.getComputedStyle(node);\n var boundNodeStyle = ownerWindow.getComputedStyle(boundNode);\n // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.\n bounds = {\n left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),\n top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),\n right: (0, _domFns.innerWidth)(boundNode) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),\n bottom: (0, _domFns.innerHeight)(boundNode) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)\n };\n }\n\n // Keep x and y below right and bottom limits...\n if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right);\n if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom);\n\n // But above left and top limits.\n if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left);\n if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top);\n\n return [x, y];\n}\n\nfunction snapToGrid(grid /*: [number, number]*/, pendingX /*: number*/, pendingY /*: number*/) /*: [number, number]*/ {\n var x = Math.round(pendingX / grid[0]) * grid[0];\n var y = Math.round(pendingY / grid[1]) * grid[1];\n return [x, y];\n}\n\nfunction canDragX(draggable /*: Draggable*/) /*: boolean*/ {\n return draggable.props.axis === 'both' || draggable.props.axis === 'x';\n}\n\nfunction canDragY(draggable /*: Draggable*/) /*: boolean*/ {\n return draggable.props.axis === 'both' || draggable.props.axis === 'y';\n}\n\n// Get {x, y} positions from event.\nfunction getControlPosition(e /*: MouseTouchEvent*/, touchIdentifier /*: ?number*/, draggableCore /*: DraggableCore*/) /*: ?ControlPosition*/ {\n var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;\n if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch\n var node = findDOMNode(draggableCore);\n // User can provide an offsetParent if desired.\n var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;\n return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent);\n}\n\n// Create an data object exposed by 's events\nfunction createCoreData(draggable /*: DraggableCore*/, x /*: number*/, y /*: number*/) /*: DraggableData*/ {\n var state = draggable.state;\n var isStart = !(0, _shims.isNum)(state.lastX);\n var node = findDOMNode(draggable);\n\n if (isStart) {\n // If this is our first move, use the x and y as last coords.\n return {\n node: node,\n deltaX: 0, deltaY: 0,\n lastX: x, lastY: y,\n x: x, y: y\n };\n } else {\n // Otherwise calculate proper values.\n return {\n node: node,\n deltaX: x - state.lastX, deltaY: y - state.lastY,\n lastX: state.lastX, lastY: state.lastY,\n x: x, y: y\n };\n }\n}\n\n// Create an data exposed by 's events\nfunction createDraggableData(draggable /*: Draggable*/, coreData /*: DraggableData*/) /*: DraggableData*/ {\n return {\n node: coreData.node,\n x: draggable.state.x + coreData.deltaX,\n y: draggable.state.y + coreData.deltaY,\n deltaX: coreData.deltaX,\n deltaY: coreData.deltaY,\n lastX: draggable.state.x,\n lastY: draggable.state.y\n };\n}\n\n// A lot faster than stringify/parse\nfunction cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}\n\nfunction findDOMNode(draggable /*: Draggable | DraggableCore*/) /*: HTMLElement*/ {\n var node = _reactDom2.default.findDOMNode(draggable);\n if (!node) {\n throw new Error(': Unmounted during event!');\n }\n // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME\n return node;\n}\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(6);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(7);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = __webpack_require__(4);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _domFns = __webpack_require__(5);\n\nvar _positionFns = __webpack_require__(9);\n\nvar _shims = __webpack_require__(0);\n\nvar _log = __webpack_require__(11);\n\nvar _log2 = _interopRequireDefault(_log);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/*:: import type {EventHandler, MouseTouchEvent} from './utils/types';*/\n\n\n// Simple abstraction for dragging events names.\n/*:: import type {Element as ReactElement} from 'react';*/\nvar eventsFor = {\n touch: {\n start: 'touchstart',\n move: 'touchmove',\n stop: 'touchend'\n },\n mouse: {\n start: 'mousedown',\n move: 'mousemove',\n stop: 'mouseup'\n }\n};\n\n// Default to mouse events.\nvar dragEventFor = eventsFor.mouse;\n\n/*:: type DraggableCoreState = {\n dragging: boolean,\n lastX: number,\n lastY: number,\n touchIdentifier: ?number\n};*/\n/*:: export type DraggableBounds = {\n left: number,\n right: number,\n top: number,\n bottom: number,\n};*/\n/*:: export type DraggableData = {\n node: HTMLElement,\n x: number, y: number,\n deltaX: number, deltaY: number,\n lastX: number, lastY: number,\n};*/\n/*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void;*/\n/*:: export type ControlPosition = {x: number, y: number};*/\n\n\n//\n// Define .\n//\n// is for advanced usage of . It maintains minimal internal state so it can\n// work well with libraries that require more control over the element.\n//\n\n/*:: export type DraggableCoreProps = {\n allowAnyClick: boolean,\n cancel: string,\n children: ReactElement,\n disabled: boolean,\n enableUserSelectHack: boolean,\n offsetParent: HTMLElement,\n grid: [number, number],\n handle: string,\n onStart: DraggableEventHandler,\n onDrag: DraggableEventHandler,\n onStop: DraggableEventHandler,\n onMouseDown: (e: MouseEvent) => void,\n};*/\n\nvar DraggableCore = function (_React$Component) {\n _inherits(DraggableCore, _React$Component);\n\n function DraggableCore() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, DraggableCore);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DraggableCore.__proto__ || Object.getPrototypeOf(DraggableCore)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n dragging: false,\n // Used while dragging to determine deltas.\n lastX: NaN, lastY: NaN,\n touchIdentifier: null\n }, _this.handleDragStart = function (e) {\n // Make it possible to attach event handlers on top of this one.\n _this.props.onMouseDown(e);\n\n // Only accept left-clicks.\n if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false;\n\n // Get nodes. Be sure to grab relative document (could be iframed)\n var thisNode = _reactDom2.default.findDOMNode(_this);\n if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {\n throw new Error(' not mounted on DragStart!');\n }\n var ownerDocument = thisNode.ownerDocument;\n\n // Short circuit if handle or cancel prop was provided and selector doesn't match.\n\n if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) {\n return;\n }\n\n // Set touch identifier in component state if this is a touch event. This allows us to\n // distinguish between individual touches on multitouch screens by identifying which\n // touchpoint was set to this element.\n var touchIdentifier = (0, _domFns.getTouchIdentifier)(e);\n _this.setState({ touchIdentifier: touchIdentifier });\n\n // Get the current drag point from the event. This is used as the offset.\n var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _this);\n if (position == null) return; // not possible but satisfies flow\n var x = position.x,\n y = position.y;\n\n // Create an event object with all the data parents need to make a decision here.\n\n var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);\n\n (0, _log2.default)('DraggableCore: handleDragStart: %j', coreEvent);\n\n // Call event handler. If it returns explicit false, cancel.\n (0, _log2.default)('calling', _this.props.onStart);\n var shouldUpdate = _this.props.onStart(e, coreEvent);\n if (shouldUpdate === false) return;\n\n // Add a style to the body to disable user-select. This prevents text from\n // being selected all over the page.\n if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument);\n\n // Initiate dragging. Set the current x and y as offsets\n // so we know how much we've moved during the drag. This allows us\n // to drag elements around even if they have been moved, without issue.\n _this.setState({\n dragging: true,\n\n lastX: x,\n lastY: y\n });\n\n // Add events to the document directly so we catch when the user's mouse/touch moves outside of\n // this element. We use different events depending on whether or not we have detected that this\n // is a touch-capable device.\n (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);\n (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);\n }, _this.handleDrag = function (e) {\n\n // Prevent scrolling on mobile devices, like ipad/iphone.\n if (e.type === 'touchmove') e.preventDefault();\n\n // Get the current drag point from the event. This is used as the offset.\n var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _this);\n if (position == null) return;\n var x = position.x,\n y = position.y;\n\n // Snap to grid if prop has been provided\n\n if (Array.isArray(_this.props.grid)) {\n var _deltaX = x - _this.state.lastX,\n _deltaY = y - _this.state.lastY;\n\n var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, _deltaX, _deltaY);\n\n var _snapToGrid2 = _slicedToArray(_snapToGrid, 2);\n\n _deltaX = _snapToGrid2[0];\n _deltaY = _snapToGrid2[1];\n\n if (!_deltaX && !_deltaY) return; // skip useless drag\n x = _this.state.lastX + _deltaX, y = _this.state.lastY + _deltaY;\n }\n\n var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);\n\n (0, _log2.default)('DraggableCore: handleDrag: %j', coreEvent);\n\n // Call event handler. If it returns explicit false, trigger end.\n var shouldUpdate = _this.props.onDrag(e, coreEvent);\n if (shouldUpdate === false) {\n try {\n // $FlowIgnore\n _this.handleDragStop(new MouseEvent('mouseup'));\n } catch (err) {\n // Old browsers\n var event = ((document.createEvent('MouseEvents') /*: any*/) /*: MouseTouchEvent*/);\n // I see why this insanity was deprecated\n // $FlowIgnore\n event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n _this.handleDragStop(event);\n }\n return;\n }\n\n _this.setState({\n lastX: x,\n lastY: y\n });\n }, _this.handleDragStop = function (e) {\n if (!_this.state.dragging) return;\n\n var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _this);\n if (position == null) return;\n var x = position.x,\n y = position.y;\n\n var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);\n\n var thisNode = _reactDom2.default.findDOMNode(_this);\n if (thisNode) {\n // Remove user-select hack\n if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);\n }\n\n (0, _log2.default)('DraggableCore: handleDragStop: %j', coreEvent);\n\n // Reset the el.\n _this.setState({\n dragging: false,\n lastX: NaN,\n lastY: NaN\n });\n\n // Call event handler\n _this.props.onStop(e, coreEvent);\n\n if (thisNode) {\n // Remove event handlers\n (0, _log2.default)('DraggableCore: Removing handlers');\n (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);\n (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);\n }\n }, _this.onMouseDown = function (e) {\n dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse\n\n return _this.handleDragStart(e);\n }, _this.onMouseUp = function (e) {\n dragEventFor = eventsFor.mouse;\n\n return _this.handleDragStop(e);\n }, _this.onTouchStart = function (e) {\n // We're on a touch device now, so change the event handlers\n dragEventFor = eventsFor.touch;\n\n return _this.handleDragStart(e);\n }, _this.onTouchEnd = function (e) {\n // We're on a touch device now, so change the event handlers\n dragEventFor = eventsFor.touch;\n\n return _this.handleDragStop(e);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(DraggableCore, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n // Remove any leftover event handlers. Remove both touch and mouse handlers in case\n // some browser quirk caused a touch event to fire during a mouse move, or vice versa.\n var thisNode = _reactDom2.default.findDOMNode(this);\n if (thisNode) {\n var ownerDocument = thisNode.ownerDocument;\n\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);\n if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument);\n }\n }\n\n // Same as onMouseDown (start drag), but now consider this a touch device.\n\n }, {\n key: 'render',\n value: function render() {\n // Reuse the child provided\n // This makes it flexible to use whatever element is wanted (div, ul, etc)\n return _react2.default.cloneElement(_react2.default.Children.only(this.props.children), {\n style: (0, _domFns.styleHacks)(this.props.children.props.style),\n\n // Note: mouseMove handler is attached to document so it will still function\n // when the user drags quickly and leaves the bounds of the element.\n onMouseDown: this.onMouseDown,\n onTouchStart: this.onTouchStart,\n onMouseUp: this.onMouseUp,\n onTouchEnd: this.onTouchEnd\n });\n }\n }]);\n\n return DraggableCore;\n}(_react2.default.Component);\n\nDraggableCore.displayName = 'DraggableCore';\nDraggableCore.propTypes = {\n /**\n * `allowAnyClick` allows dragging using any mouse button.\n * By default, we only accept the left button.\n *\n * Defaults to `false`.\n */\n allowAnyClick: _propTypes2.default.bool,\n\n /**\n * `disabled`, if true, stops the from dragging. All handlers,\n * with the exception of `onMouseDown`, will not fire.\n */\n disabled: _propTypes2.default.bool,\n\n /**\n * By default, we add 'user-select:none' attributes to the document body\n * to prevent ugly text selection during drag. If this is causing problems\n * for your app, set this to `false`.\n */\n enableUserSelectHack: _propTypes2.default.bool,\n\n /**\n * `offsetParent`, if set, uses the passed DOM node to compute drag offsets\n * instead of using the parent node.\n */\n offsetParent: function offsetParent(props /*: DraggableCoreProps*/, propName /*: $Keys*/) {\n if (process.browser === true && props[propName] && props[propName].nodeType !== 1) {\n throw new Error('Draggable\\'s offsetParent must be a DOM Node.');\n }\n },\n\n /**\n * `grid` specifies the x and y that dragging should snap to.\n */\n grid: _propTypes2.default.arrayOf(_propTypes2.default.number),\n\n /**\n * `handle` specifies a selector to be used as the handle that initiates drag.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
\n *
Click me to drag
\n *
This is some other content
\n *
\n *
\n * );\n * }\n * });\n * ```\n */\n handle: _propTypes2.default.string,\n\n /**\n * `cancel` specifies a selector to be used to prevent drag initialization.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return(\n * \n *
\n *
You can't drag from here
\n *
Dragging here works fine
\n *
\n *
\n * );\n * }\n * });\n * ```\n */\n cancel: _propTypes2.default.string,\n\n /**\n * Called when dragging starts.\n * If this function returns the boolean false, dragging will be canceled.\n */\n onStart: _propTypes2.default.func,\n\n /**\n * Called while dragging.\n * If this function returns the boolean false, dragging will be canceled.\n */\n onDrag: _propTypes2.default.func,\n\n /**\n * Called when dragging stops.\n * If this function returns the boolean false, the drag will remain active.\n */\n onStop: _propTypes2.default.func,\n\n /**\n * A workaround option which can be passed if onMouseDown needs to be accessed,\n * since it'll always be blocked (as there is internal use of onMouseDown)\n */\n onMouseDown: _propTypes2.default.func,\n\n /**\n * These properties should be defined on the child, not here.\n */\n className: _shims.dontSetMe,\n style: _shims.dontSetMe,\n transform: _shims.dontSetMe\n};\nDraggableCore.defaultProps = {\n allowAnyClick: false, // by default only accept left click\n cancel: null,\n disabled: false,\n enableUserSelectHack: true,\n offsetParent: null,\n handle: null,\n grid: null,\n transform: null,\n onStart: function onStart() {},\n onDrag: function onDrag() {},\n onStop: function onStop() {},\n onMouseDown: function onMouseDown() {}\n};\nexports.default = DraggableCore;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = log;\n\n/*eslint no-console:0*/\nfunction log() {\n var _console;\n\n if (undefined) (_console = console).log.apply(_console, arguments);\n}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar Draggable = __webpack_require__(13).default;\n\n// Previous versions of this lib exported as the root export. As to not break\n// them, or TypeScript, we export *both* as the root and as 'default'.\n// See https://github.com/mzabriskie/react-draggable/pull/254\n// and https://github.com/mzabriskie/react-draggable/issues/266\nmodule.exports = Draggable;\nmodule.exports.default = Draggable;\nmodule.exports.DraggableCore = __webpack_require__(10).default;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(6);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(7);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = __webpack_require__(4);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _classnames = __webpack_require__(18);\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _domFns = __webpack_require__(5);\n\nvar _positionFns = __webpack_require__(9);\n\nvar _shims = __webpack_require__(0);\n\nvar _DraggableCore = __webpack_require__(10);\n\nvar _DraggableCore2 = _interopRequireDefault(_DraggableCore);\n\nvar _log = __webpack_require__(11);\n\nvar _log2 = _interopRequireDefault(_log);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/*:: import type {ControlPosition, DraggableBounds, DraggableCoreProps} from './DraggableCore';*/\n/*:: import type {DraggableEventHandler} from './utils/types';*/\n/*:: import type {Element as ReactElement} from 'react';*/\n/*:: type DraggableState = {\n dragging: boolean,\n dragged: boolean,\n x: number, y: number,\n slackX: number, slackY: number,\n isElementSVG: boolean\n};*/\n\n\n//\n// Define \n//\n\n/*:: export type DraggableProps = {\n ...$Exact,\n axis: 'both' | 'x' | 'y' | 'none',\n bounds: DraggableBounds | string | false,\n defaultClassName: string,\n defaultClassNameDragging: string,\n defaultClassNameDragged: string,\n defaultPosition: ControlPosition,\n position: ControlPosition,\n};*/\n\nvar Draggable = function (_React$Component) {\n _inherits(Draggable, _React$Component);\n\n function Draggable(props /*: DraggableProps*/) {\n _classCallCheck(this, Draggable);\n\n var _this = _possibleConstructorReturn(this, (Draggable.__proto__ || Object.getPrototypeOf(Draggable)).call(this, props));\n\n _this.onDragStart = function (e, coreData) {\n (0, _log2.default)('Draggable: onDragStart: %j', coreData);\n\n // Short-circuit if user's callback killed it.\n var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_this, coreData));\n // Kills start event on core as well, so move handlers are never bound.\n if (shouldStart === false) return false;\n\n _this.setState({ dragging: true, dragged: true });\n };\n\n _this.onDrag = function (e, coreData) {\n if (!_this.state.dragging) return false;\n (0, _log2.default)('Draggable: onDrag: %j', coreData);\n\n var uiData = (0, _positionFns.createDraggableData)(_this, coreData);\n\n var newState /*: $Shape*/ = {\n x: uiData.x,\n y: uiData.y\n };\n\n // Keep within bounds.\n if (_this.props.bounds) {\n // Save original x and y.\n var _x = newState.x,\n _y = newState.y;\n\n // Add slack to the values used to calculate bound position. This will ensure that if\n // we start removing slack, the element won't react to it right away until it's been\n // completely removed.\n\n newState.x += _this.state.slackX;\n newState.y += _this.state.slackY;\n\n // Get bound position. This will ceil/floor the x and y within the boundaries.\n\n var _getBoundPosition = (0, _positionFns.getBoundPosition)(_this, newState.x, newState.y),\n _getBoundPosition2 = _slicedToArray(_getBoundPosition, 2),\n newStateX = _getBoundPosition2[0],\n newStateY = _getBoundPosition2[1];\n\n newState.x = newStateX;\n newState.y = newStateY;\n\n // Recalculate slack by noting how much was shaved by the boundPosition handler.\n newState.slackX = _this.state.slackX + (_x - newState.x);\n newState.slackY = _this.state.slackY + (_y - newState.y);\n\n // Update the event we fire to reflect what really happened after bounds took effect.\n uiData.x = newState.x;\n uiData.y = newState.y;\n uiData.deltaX = newState.x - _this.state.x;\n uiData.deltaY = newState.y - _this.state.y;\n }\n\n // Short-circuit if user's callback killed it.\n var shouldUpdate = _this.props.onDrag(e, uiData);\n if (shouldUpdate === false) return false;\n\n _this.setState(newState);\n };\n\n _this.onDragStop = function (e, coreData) {\n if (!_this.state.dragging) return false;\n\n // Short-circuit if user's callback killed it.\n var shouldStop = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_this, coreData));\n if (shouldStop === false) return false;\n\n (0, _log2.default)('Draggable: onDragStop: %j', coreData);\n\n var newState /*: $Shape*/ = {\n dragging: false,\n slackX: 0,\n slackY: 0\n };\n\n // If this is a controlled component, the result of this operation will be to\n // revert back to the old position. We expect a handler on `onDragStop`, at the least.\n var controlled = Boolean(_this.props.position);\n if (controlled) {\n var _this$props$position = _this.props.position,\n _x2 = _this$props$position.x,\n _y2 = _this$props$position.y;\n\n newState.x = _x2;\n newState.y = _y2;\n }\n\n _this.setState(newState);\n };\n\n _this.state = {\n // Whether or not we are currently dragging.\n dragging: false,\n\n // Whether or not we have been dragged before.\n dragged: false,\n\n // Current transform x and y.\n x: props.position ? props.position.x : props.defaultPosition.x,\n y: props.position ? props.position.y : props.defaultPosition.y,\n\n // Used for compensating for out-of-bounds drags\n slackX: 0, slackY: 0,\n\n // Can only determine if SVG after mounting\n isElementSVG: false\n };\n return _this;\n }\n\n _createClass(Draggable, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n if (this.props.position && !(this.props.onDrag || this.props.onStop)) {\n // eslint-disable-next-line\n console.warn('A `position` was applied to this , without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.');\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n // Check to see if the element passed is an instanceof SVGElement\n if (typeof window.SVGElement !== 'undefined' && _reactDom2.default.findDOMNode(this) instanceof window.SVGElement) {\n this.setState({ isElementSVG: true });\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps /*: Object*/) {\n // Set x/y if position has changed\n if (nextProps.position && (!this.props.position || nextProps.position.x !== this.props.position.x || nextProps.position.y !== this.props.position.y)) {\n this.setState({ x: nextProps.position.x, y: nextProps.position.y });\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.setState({ dragging: false }); // prevents invariant if unmounted while dragging\n }\n }, {\n key: 'render',\n value: function render() /*: ReactElement*/ {\n var _classNames;\n\n var style = {},\n svgTransform = null;\n\n // If this is controlled, we don't want to move it - unless it's dragging.\n var controlled = Boolean(this.props.position);\n var draggable = !controlled || this.state.dragging;\n\n var position = this.props.position || this.props.defaultPosition;\n var transformOpts = {\n // Set left if horizontal drag is enabled\n x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : position.x,\n\n // Set top if vertical drag is enabled\n y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : position.y\n };\n\n // If this element was SVG, we use the `transform` attribute.\n if (this.state.isElementSVG) {\n svgTransform = (0, _domFns.createSVGTransform)(transformOpts);\n } else {\n // Add a CSS transform to move the element around. This allows us to move the element around\n // without worrying about whether or not it is relatively or absolutely positioned.\n // If the item you are dragging already has a transform set, wrap it in a so \n // has a clean slate.\n style = (0, _domFns.createCSSTransform)(transformOpts);\n }\n\n var _props = this.props,\n defaultClassName = _props.defaultClassName,\n defaultClassNameDragging = _props.defaultClassNameDragging,\n defaultClassNameDragged = _props.defaultClassNameDragged;\n\n\n var children = _react2.default.Children.only(this.props.children);\n\n // Mark with class while dragging\n var className = (0, _classnames2.default)(children.props.className || '', defaultClassName, (_classNames = {}, _defineProperty(_classNames, defaultClassNameDragging, this.state.dragging), _defineProperty(_classNames, defaultClassNameDragged, this.state.dragged), _classNames));\n\n // Reuse the child provided\n // This makes it flexible to use whatever element is wanted (div, ul, etc)\n return _react2.default.createElement(\n _DraggableCore2.default,\n _extends({}, this.props, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }),\n _react2.default.cloneElement(children, {\n className: className,\n style: _extends({}, children.props.style, style),\n transform: svgTransform\n })\n );\n }\n }]);\n\n return Draggable;\n}(_react2.default.Component);\n\nDraggable.displayName = 'Draggable';\nDraggable.propTypes = _extends({}, _DraggableCore2.default.propTypes, {\n\n /**\n * `axis` determines which axis the draggable can move.\n *\n * Note that all callbacks will still return data as normal. This only\n * controls flushing to the DOM.\n *\n * 'both' allows movement horizontally and vertically.\n * 'x' limits movement to horizontal axis.\n * 'y' limits movement to vertical axis.\n * 'none' limits all movement.\n *\n * Defaults to 'both'.\n */\n axis: _propTypes2.default.oneOf(['both', 'x', 'y', 'none']),\n\n /**\n * `bounds` determines the range of movement available to the element.\n * Available values are:\n *\n * 'parent' restricts movement within the Draggable's parent node.\n *\n * Alternatively, pass an object with the following properties, all of which are optional:\n *\n * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}\n *\n * All values are in px.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
Content
\n *
\n * );\n * }\n * });\n * ```\n */\n bounds: _propTypes2.default.oneOfType([_propTypes2.default.shape({\n left: _propTypes2.default.number,\n right: _propTypes2.default.number,\n top: _propTypes2.default.number,\n bottom: _propTypes2.default.number\n }), _propTypes2.default.string, _propTypes2.default.oneOf([false])]),\n\n defaultClassName: _propTypes2.default.string,\n defaultClassNameDragging: _propTypes2.default.string,\n defaultClassNameDragged: _propTypes2.default.string,\n\n /**\n * `defaultPosition` specifies the x and y that the dragged item should start at\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
I start with transformX: 25px and transformY: 25px;
\n *
\n * );\n * }\n * });\n * ```\n */\n defaultPosition: _propTypes2.default.shape({\n x: _propTypes2.default.number,\n y: _propTypes2.default.number\n }),\n\n /**\n * `position`, if present, defines the current position of the element.\n *\n * This is similar to how form elements in React work - if no `position` is supplied, the component\n * is uncontrolled.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
I start with transformX: 25px and transformY: 25px;
\n *
\n * );\n * }\n * });\n * ```\n */\n position: _propTypes2.default.shape({\n x: _propTypes2.default.number,\n y: _propTypes2.default.number\n }),\n\n /**\n * These properties should be defined on the child, not here.\n */\n className: _shims.dontSetMe,\n style: _shims.dontSetMe,\n transform: _shims.dontSetMe\n});\nDraggable.defaultProps = _extends({}, _DraggableCore2.default.defaultProps, {\n axis: 'both',\n bounds: false,\n defaultClassName: 'react-draggable',\n defaultClassNameDragging: 'react-draggable-dragging',\n defaultClassNameDragged: 'react-draggable-dragged',\n defaultPosition: { x: 0, y: 0 },\n position: null\n});\nexports.default = Draggable;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(1);\nvar invariant = __webpack_require__(2);\nvar warning = __webpack_require__(8);\nvar assign = __webpack_require__(15);\n\nvar ReactPropTypesSecret = __webpack_require__(3);\nvar checkPropTypes = __webpack_require__(16);\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n warning(\n false,\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received %s at index %s.',\n getPostfixForTypeWarning(checker),\n i\n );\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var invariant = __webpack_require__(2);\n var warning = __webpack_require__(8);\n var ReactPropTypesSecret = __webpack_require__(3);\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(1);\nvar invariant = __webpack_require__(2);\nvar ReactPropTypesSecret = __webpack_require__(3);\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t\t\treturn classNames;\n\t\t}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getPrefix = getPrefix;\nexports.browserPrefixToKey = browserPrefixToKey;\nexports.browserPrefixToStyle = browserPrefixToStyle;\nvar prefixes = ['Moz', 'Webkit', 'O', 'ms'];\nfunction getPrefix() /*: string*/ {\n var prop /*: string*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';\n\n // Checking specifically for 'window.document' is for pseudo-browser server-side\n // environments that define 'window' as the global context.\n // E.g. React-rails (see https://github.com/reactjs/react-rails/pull/84)\n if (typeof window === 'undefined' || typeof window.document === 'undefined') return '';\n\n var style = window.document.documentElement.style;\n\n if (prop in style) return '';\n\n for (var i = 0; i < prefixes.length; i++) {\n if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];\n }\n\n return '';\n}\n\nfunction browserPrefixToKey(prop /*: string*/, prefix /*: string*/) /*: string*/ {\n return prefix ? '' + prefix + kebabToTitleCase(prop) : prop;\n}\n\nfunction browserPrefixToStyle(prop /*: string*/, prefix /*: string*/) /*: string*/ {\n return prefix ? '-' + prefix.toLowerCase() + '-' + prop : prop;\n}\n\nfunction kebabToTitleCase(str /*: string*/) /*: string*/ {\n var out = '';\n var shouldCapitalize = true;\n for (var i = 0; i < str.length; i++) {\n if (shouldCapitalize) {\n out += str[i].toUpperCase();\n shouldCapitalize = false;\n } else if (str[i] === '-') {\n shouldCapitalize = true;\n } else {\n out += str[i];\n }\n }\n return out;\n}\n\n// Default export is the prefix itself, like 'Moz', 'Webkit', etc\n// Note that you may have to re-test for certain things; for instance, Chrome 50\n// can handle unprefixed `transform`, but not unprefixed `user-select`\nexports.default = getPrefix();\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=react-draggable.js.map\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_7__;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(1);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDraggable = __webpack_require__(6);\n\nvar _cloneElement = __webpack_require__(19);\n\nvar _cloneElement2 = _interopRequireDefault(_cloneElement);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Resizable = function (_React$Component) {\n _inherits(Resizable, _React$Component);\n\n function Resizable() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Resizable);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n resizing: false,\n width: _this.props.width, height: _this.props.height,\n slackW: 0, slackH: 0\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Resizable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n // If parent changes height/width, set that in our state.\n if (!this.state.resizing && (nextProps.width !== this.props.width || nextProps.height !== this.props.height)) {\n this.setState({\n width: nextProps.width,\n height: nextProps.height\n });\n }\n };\n\n Resizable.prototype.lockAspectRatio = function lockAspectRatio(width, height, aspectRatio) {\n height = width / aspectRatio;\n width = height * aspectRatio;\n return [width, height];\n };\n\n // If you do this, be careful of constraints\n\n\n Resizable.prototype.runConstraints = function runConstraints(width, height) {\n var _ref = [this.props.minConstraints, this.props.maxConstraints],\n min = _ref[0],\n max = _ref[1];\n\n\n if (this.props.lockAspectRatio) {\n var ratio = this.state.width / this.state.height;\n height = width / ratio;\n width = height * ratio;\n }\n\n if (!min && !max) return [width, height];\n\n var oldW = width,\n oldH = height;\n\n // Add slack to the values used to calculate bound position. This will ensure that if\n // we start removing slack, the element won't react to it right away until it's been\n // completely removed.\n\n var _state = this.state,\n slackW = _state.slackW,\n slackH = _state.slackH;\n\n width += slackW;\n height += slackH;\n\n if (min) {\n width = Math.max(min[0], width);\n height = Math.max(min[1], height);\n }\n if (max) {\n width = Math.min(max[0], width);\n height = Math.min(max[1], height);\n }\n\n // If the numbers changed, we must have introduced some slack. Record it for the next iteration.\n slackW += oldW - width;\n slackH += oldH - height;\n if (slackW !== this.state.slackW || slackH !== this.state.slackH) {\n this.setState({ slackW: slackW, slackH: slackH });\n }\n\n return [width, height];\n };\n\n /**\n * Wrapper around drag events to provide more useful data.\n *\n * @param {String} handlerName Handler name to wrap.\n * @return {Function} Handler function.\n */\n\n\n Resizable.prototype.resizeHandler = function resizeHandler(handlerName) {\n var _this2 = this;\n\n return function (e, _ref2) {\n var node = _ref2.node,\n deltaX = _ref2.deltaX,\n deltaY = _ref2.deltaY;\n\n\n // Axis restrictions\n var canDragX = _this2.props.axis === 'both' || _this2.props.axis === 'x';\n var canDragY = _this2.props.axis === 'both' || _this2.props.axis === 'y';\n\n // Update w/h\n var width = _this2.state.width + (canDragX ? deltaX : 0);\n var height = _this2.state.height + (canDragY ? deltaY : 0);\n\n // Early return if no change\n var widthChanged = width !== _this2.state.width,\n heightChanged = height !== _this2.state.height;\n if (handlerName === 'onResize' && !widthChanged && !heightChanged) return;\n\n // Set the appropriate state for this handler.\n var _runConstraints = _this2.runConstraints(width, height);\n\n width = _runConstraints[0];\n height = _runConstraints[1];\n var newState = {};\n if (handlerName === 'onResizeStart') {\n newState.resizing = true;\n } else if (handlerName === 'onResizeStop') {\n newState.resizing = false;\n newState.slackW = newState.slackH = 0;\n } else {\n // Early return if no change after constraints\n if (width === _this2.state.width && height === _this2.state.height) return;\n newState.width = width;\n newState.height = height;\n }\n\n var hasCb = typeof _this2.props[handlerName] === 'function';\n if (hasCb) {\n if (typeof e.persist === 'function') e.persist();\n _this2.setState(newState, function () {\n return _this2.props[handlerName](e, { node: node, size: { width: width, height: height } });\n });\n } else {\n _this2.setState(newState);\n }\n };\n };\n\n Resizable.prototype.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _props = this.props,\n children = _props.children,\n draggableOpts = _props.draggableOpts,\n width = _props.width,\n height = _props.height,\n handleSize = _props.handleSize,\n lockAspectRatio = _props.lockAspectRatio,\n axis = _props.axis,\n minConstraints = _props.minConstraints,\n maxConstraints = _props.maxConstraints,\n onResize = _props.onResize,\n onResizeStop = _props.onResizeStop,\n onResizeStart = _props.onResizeStart,\n p = _objectWithoutProperties(_props, ['children', 'draggableOpts', 'width', 'height', 'handleSize', 'lockAspectRatio', 'axis', 'minConstraints', 'maxConstraints', 'onResize', 'onResizeStop', 'onResizeStart']);\n\n var className = p.className ? p.className + ' react-resizable' : 'react-resizable';\n\n // What we're doing here is getting the child of this element, and cloning it with this element's props.\n // We are then defining its children as:\n // Its original children (resizable's child's children), and\n // A draggable handle.\n return (0, _cloneElement2.default)(children, _extends({}, p, {\n className: className,\n children: [children.props.children, _react2.default.createElement(\n _reactDraggable.DraggableCore,\n _extends({}, draggableOpts, {\n key: 'resizableHandle',\n onStop: this.resizeHandler('onResizeStop'),\n onStart: this.resizeHandler('onResizeStart'),\n onDrag: this.resizeHandler('onResize')\n }),\n _react2.default.createElement('span', { className: 'react-resizable-handle' })\n )]\n }));\n };\n\n return Resizable;\n}(_react2.default.Component);\n\nResizable.propTypes = {\n //\n // Required Props\n //\n\n // Require that one and only one child be present.\n children: _propTypes2.default.element.isRequired,\n\n // Initial w/h\n width: _propTypes2.default.number.isRequired,\n height: _propTypes2.default.number.isRequired,\n\n //\n // Optional props\n //\n\n // If you change this, be sure to update your css\n handleSize: _propTypes2.default.array,\n\n // If true, will only allow width/height to move in lockstep\n lockAspectRatio: _propTypes2.default.bool,\n\n // Restricts resizing to a particular axis (default: 'both')\n // 'both' - allows resizing by width or height\n // 'x' - only allows the width to be changed\n // 'y' - only allows the height to be changed\n // 'none' - disables resizing altogether\n axis: _propTypes2.default.oneOf(['both', 'x', 'y', 'none']),\n\n // Min/max size\n minConstraints: _propTypes2.default.arrayOf(_propTypes2.default.number),\n maxConstraints: _propTypes2.default.arrayOf(_propTypes2.default.number),\n\n // Callbacks\n onResizeStop: _propTypes2.default.func,\n onResizeStart: _propTypes2.default.func,\n onResize: _propTypes2.default.func,\n\n // These will be passed wholesale to react-draggable's DraggableCore\n draggableOpts: _propTypes2.default.object\n};\nResizable.defaultProps = {\n handleSize: [20, 20],\n lockAspectRatio: false,\n axis: 'both',\n minConstraints: [20, 20],\n maxConstraints: [Infinity, Infinity]\n};\nexports.default = Resizable;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getBreakpointFromWidth = getBreakpointFromWidth;\nexports.getColsFromBreakpoint = getColsFromBreakpoint;\nexports.findOrGenerateResponsiveLayout = findOrGenerateResponsiveLayout;\nexports.sortBreakpoints = sortBreakpoints;\n\nvar _utils = __webpack_require__(2);\n\n/**\n * Given a width, find the highest breakpoint that matches is valid for it (width > breakpoint).\n *\n * @param {Object} breakpoints Breakpoints object (e.g. {lg: 1200, md: 960, ...})\n * @param {Number} width Screen width.\n * @return {String} Highest breakpoint that is less than width.\n */\nfunction getBreakpointFromWidth(breakpoints, width) {\n var sorted = sortBreakpoints(breakpoints);\n var matching = sorted[0];\n for (var i = 1, len = sorted.length; i < len; i++) {\n var breakpointName = sorted[i];\n if (width > breakpoints[breakpointName]) matching = breakpointName;\n }\n return matching;\n}\n\n/**\n * Given a breakpoint, get the # of cols set for it.\n * @param {String} breakpoint Breakpoint name.\n * @param {Object} cols Map of breakpoints to cols.\n * @return {Number} Number of cols.\n */\n\n\nfunction getColsFromBreakpoint(breakpoint, cols) {\n if (!cols[breakpoint]) {\n throw new Error(\"ResponsiveReactGridLayout: `cols` entry for breakpoint \" + breakpoint + \" is missing!\");\n }\n return cols[breakpoint];\n}\n\n/**\n * Given existing layouts and a new breakpoint, find or generate a new layout.\n *\n * This finds the layout above the new one and generates from it, if it exists.\n *\n * @param {Object} layouts Existing layouts.\n * @param {Array} breakpoints All breakpoints.\n * @param {String} breakpoint New breakpoint.\n * @param {String} breakpoint Last breakpoint (for fallback).\n * @param {Number} cols Column count at new breakpoint.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} New layout.\n */\nfunction findOrGenerateResponsiveLayout(layouts, breakpoints, breakpoint, lastBreakpoint, cols, compactType) {\n // If it already exists, just return it.\n if (layouts[breakpoint]) return (0, _utils.cloneLayout)(layouts[breakpoint]);\n // Find or generate the next layout\n var layout = layouts[lastBreakpoint];\n var breakpointsSorted = sortBreakpoints(breakpoints);\n var breakpointsAbove = breakpointsSorted.slice(breakpointsSorted.indexOf(breakpoint));\n for (var i = 0, len = breakpointsAbove.length; i < len; i++) {\n var b = breakpointsAbove[i];\n if (layouts[b]) {\n layout = layouts[b];\n break;\n }\n }\n layout = (0, _utils.cloneLayout)(layout || []); // clone layout so we don't modify existing items\n return (0, _utils.compact)((0, _utils.correctBounds)(layout, { cols: cols }), compactType, cols);\n}\n\n/**\n * Given breakpoints, return an array of breakpoints sorted by width. This is usually\n * e.g. ['xxs', 'xs', 'sm', ...]\n *\n * @param {Object} breakpoints Key/value pair of breakpoint names to widths.\n * @return {Array} Sorted breakpoints.\n */\nfunction sortBreakpoints(breakpoints) {\n var keys = Object.keys(breakpoints);\n return keys.sort(function (a, b) {\n return breakpoints[a] - breakpoints[b];\n });\n}\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = __webpack_require__(4).default;\nmodule.exports.utils = __webpack_require__(2);\nmodule.exports.Responsive = __webpack_require__(21).default;\nmodule.exports.Responsive.utils = __webpack_require__(9);\nmodule.exports.WidthProvider = __webpack_require__(22).default;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(12);\nvar invariant = __webpack_require__(13);\nvar ReactPropTypesSecret = __webpack_require__(14);\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (false) {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\nvar g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif(!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(1);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDraggable = __webpack_require__(6);\n\nvar _reactResizable = __webpack_require__(18);\n\nvar _utils = __webpack_require__(2);\n\nvar _classnames = __webpack_require__(5);\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * An individual item within a ReactGridLayout.\n */\nvar GridItem = function (_React$Component) {\n _inherits(GridItem, _React$Component);\n\n function GridItem() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, GridItem);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n resizing: null,\n dragging: null,\n className: \"\"\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n // Helper for generating column width\n GridItem.prototype.calcColWidth = function calcColWidth() {\n var _props = this.props,\n margin = _props.margin,\n containerPadding = _props.containerPadding,\n containerWidth = _props.containerWidth,\n cols = _props.cols;\n\n return (containerWidth - margin[0] * (cols - 1) - containerPadding[0] * 2) / cols;\n };\n\n /**\n * Return position on the page given an x, y, w, h.\n * left, top, width, height are all in pixels.\n * @param {Number} x X coordinate in grid units.\n * @param {Number} y Y coordinate in grid units.\n * @param {Number} w W coordinate in grid units.\n * @param {Number} h H coordinate in grid units.\n * @return {Object} Object containing coords.\n */\n\n\n GridItem.prototype.calcPosition = function calcPosition(x, y, w, h, state) {\n var _props2 = this.props,\n margin = _props2.margin,\n containerPadding = _props2.containerPadding,\n rowHeight = _props2.rowHeight;\n\n var colWidth = this.calcColWidth();\n\n var out = {\n left: Math.round((colWidth + margin[0]) * x + containerPadding[0]),\n top: Math.round((rowHeight + margin[1]) * y + containerPadding[1]),\n // 0 * Infinity === NaN, which causes problems with resize constraints;\n // Fix this if it occurs.\n // Note we do it here rather than later because Math.round(Infinity) causes deopt\n width: w === Infinity ? w : Math.round(colWidth * w + Math.max(0, w - 1) * margin[0]),\n height: h === Infinity ? h : Math.round(rowHeight * h + Math.max(0, h - 1) * margin[1])\n };\n\n if (state && state.resizing) {\n out.width = Math.round(state.resizing.width);\n out.height = Math.round(state.resizing.height);\n }\n\n if (state && state.dragging) {\n out.top = Math.round(state.dragging.top);\n out.left = Math.round(state.dragging.left);\n }\n\n return out;\n };\n\n /**\n * Translate x and y coordinates from pixels to grid units.\n * @param {Number} top Top position (relative to parent) in pixels.\n * @param {Number} left Left position (relative to parent) in pixels.\n * @return {Object} x and y in grid units.\n */\n\n\n GridItem.prototype.calcXY = function calcXY(top, left) {\n var _props3 = this.props,\n margin = _props3.margin,\n cols = _props3.cols,\n rowHeight = _props3.rowHeight,\n w = _props3.w,\n h = _props3.h,\n maxRows = _props3.maxRows;\n\n var colWidth = this.calcColWidth();\n\n // left = colWidth * x + margin * (x + 1)\n // l = cx + m(x+1)\n // l = cx + mx + m\n // l - m = cx + mx\n // l - m = x(c + m)\n // (l - m) / (c + m) = x\n // x = (left - margin) / (coldWidth + margin)\n var x = Math.round((left - margin[0]) / (colWidth + margin[0]));\n var y = Math.round((top - margin[1]) / (rowHeight + margin[1]));\n\n // Capping\n x = Math.max(Math.min(x, cols - w), 0);\n y = Math.max(Math.min(y, maxRows - h), 0);\n\n return { x: x, y: y };\n };\n\n /**\n * Given a height and width in pixel values, calculate grid units.\n * @param {Number} height Height in pixels.\n * @param {Number} width Width in pixels.\n * @return {Object} w, h as grid units.\n */\n\n\n GridItem.prototype.calcWH = function calcWH(_ref) {\n var height = _ref.height,\n width = _ref.width;\n var _props4 = this.props,\n margin = _props4.margin,\n maxRows = _props4.maxRows,\n cols = _props4.cols,\n rowHeight = _props4.rowHeight,\n x = _props4.x,\n y = _props4.y;\n\n var colWidth = this.calcColWidth();\n\n // width = colWidth * w - (margin * (w - 1))\n // ...\n // w = (width + margin) / (colWidth + margin)\n var w = Math.round((width + margin[0]) / (colWidth + margin[0]));\n var h = Math.round((height + margin[1]) / (rowHeight + margin[1]));\n\n // Capping\n w = Math.max(Math.min(w, cols - x), 0);\n h = Math.max(Math.min(h, maxRows - y), 0);\n return { w: w, h: h };\n };\n\n /**\n * This is where we set the grid item's absolute placement. It gets a little tricky because we want to do it\n * well when server rendering, and the only way to do that properly is to use percentage width/left because\n * we don't know exactly what the browser viewport is.\n * Unfortunately, CSS Transforms, which are great for performance, break in this instance because a percentage\n * left is relative to the item itself, not its container! So we cannot use them on the server rendering pass.\n *\n * @param {Object} pos Position object with width, height, left, top.\n * @return {Object} Style object.\n */\n\n\n GridItem.prototype.createStyle = function createStyle(pos) {\n var _props5 = this.props,\n usePercentages = _props5.usePercentages,\n containerWidth = _props5.containerWidth,\n useCSSTransforms = _props5.useCSSTransforms;\n\n\n var style = void 0;\n // CSS Transforms support (default)\n if (useCSSTransforms) {\n style = (0, _utils.setTransform)(pos);\n } else {\n // top,left (slow)\n style = (0, _utils.setTopLeft)(pos);\n\n // This is used for server rendering.\n if (usePercentages) {\n style.left = (0, _utils.perc)(pos.left / containerWidth);\n style.width = (0, _utils.perc)(pos.width / containerWidth);\n }\n }\n\n return style;\n };\n\n /**\n * Mix a Draggable instance into a child.\n * @param {Element} child Child element.\n * @return {Element} Child wrapped in Draggable.\n */\n\n\n GridItem.prototype.mixinDraggable = function mixinDraggable(child) {\n return _react2.default.createElement(\n _reactDraggable.DraggableCore,\n {\n onStart: this.onDragHandler(\"onDragStart\"),\n onDrag: this.onDragHandler(\"onDrag\"),\n onStop: this.onDragHandler(\"onDragStop\"),\n handle: this.props.handle,\n cancel: \".react-resizable-handle\" + (this.props.cancel ? \",\" + this.props.cancel : \"\")\n },\n child\n );\n };\n\n /**\n * Mix a Resizable instance into a child.\n * @param {Element} child Child element.\n * @param {Object} position Position object (pixel values)\n * @return {Element} Child wrapped in Resizable.\n */\n\n\n GridItem.prototype.mixinResizable = function mixinResizable(child, position) {\n var _props6 = this.props,\n cols = _props6.cols,\n x = _props6.x,\n minW = _props6.minW,\n minH = _props6.minH,\n maxW = _props6.maxW,\n maxH = _props6.maxH;\n\n // This is the max possible width - doesn't go to infinity because of the width of the window\n\n var maxWidth = this.calcPosition(0, 0, cols - x, 0).width;\n\n // Calculate min/max constraints using our min & maxes\n var mins = this.calcPosition(0, 0, minW, minH);\n var maxes = this.calcPosition(0, 0, maxW, maxH);\n var minConstraints = [mins.width, mins.height];\n var maxConstraints = [Math.min(maxes.width, maxWidth), Math.min(maxes.height, Infinity)];\n return _react2.default.createElement(\n _reactResizable.Resizable,\n {\n width: position.width,\n height: position.height,\n minConstraints: minConstraints,\n maxConstraints: maxConstraints,\n onResizeStop: this.onResizeHandler(\"onResizeStop\"),\n onResizeStart: this.onResizeHandler(\"onResizeStart\"),\n onResize: this.onResizeHandler(\"onResize\")\n },\n child\n );\n };\n\n /**\n * Wrapper around drag events to provide more useful data.\n * All drag events call the function with the given handler name,\n * with the signature (index, x, y).\n *\n * @param {String} handlerName Handler name to wrap.\n * @return {Function} Handler function.\n */\n\n\n GridItem.prototype.onDragHandler = function onDragHandler(handlerName) {\n var _this2 = this;\n\n return function (e, _ref2) {\n var node = _ref2.node,\n deltaX = _ref2.deltaX,\n deltaY = _ref2.deltaY;\n\n var handler = _this2.props[handlerName];\n if (!handler) return;\n\n var newPosition = { top: 0, left: 0 };\n\n // Get new XY\n switch (handlerName) {\n case \"onDragStart\":\n {\n // TODO: this wont work on nested parents\n var offsetParent = node.offsetParent;\n\n if (!offsetParent) return;\n var parentRect = offsetParent.getBoundingClientRect();\n var clientRect = node.getBoundingClientRect();\n newPosition.left = clientRect.left - parentRect.left + offsetParent.scrollLeft;\n newPosition.top = clientRect.top - parentRect.top + offsetParent.scrollTop;\n _this2.setState({ dragging: newPosition });\n break;\n }\n case \"onDrag\":\n if (!_this2.state.dragging) throw new Error(\"onDrag called before onDragStart.\");\n newPosition.left = _this2.state.dragging.left + deltaX;\n newPosition.top = _this2.state.dragging.top + deltaY;\n _this2.setState({ dragging: newPosition });\n break;\n case \"onDragStop\":\n if (!_this2.state.dragging) throw new Error(\"onDragEnd called before onDragStart.\");\n newPosition.left = _this2.state.dragging.left;\n newPosition.top = _this2.state.dragging.top;\n _this2.setState({ dragging: null });\n break;\n default:\n throw new Error(\"onDragHandler called with unrecognized handlerName: \" + handlerName);\n }\n\n var _calcXY = _this2.calcXY(newPosition.top, newPosition.left),\n x = _calcXY.x,\n y = _calcXY.y;\n\n return handler.call(_this2, _this2.props.i, x, y, { e: e, node: node, newPosition: newPosition });\n };\n };\n\n /**\n * Wrapper around drag events to provide more useful data.\n * All drag events call the function with the given handler name,\n * with the signature (index, x, y).\n *\n * @param {String} handlerName Handler name to wrap.\n * @return {Function} Handler function.\n */\n\n\n GridItem.prototype.onResizeHandler = function onResizeHandler(handlerName) {\n var _this3 = this;\n\n return function (e, _ref3) {\n var node = _ref3.node,\n size = _ref3.size;\n\n var handler = _this3.props[handlerName];\n if (!handler) return;\n var _props7 = _this3.props,\n cols = _props7.cols,\n x = _props7.x,\n i = _props7.i,\n maxW = _props7.maxW,\n minW = _props7.minW,\n maxH = _props7.maxH,\n minH = _props7.minH;\n\n // Get new XY\n\n var _calcWH = _this3.calcWH(size),\n w = _calcWH.w,\n h = _calcWH.h;\n\n // Cap w at numCols\n\n\n w = Math.min(w, cols - x);\n // Ensure w is at least 1\n w = Math.max(w, 1);\n\n // Min/max capping\n w = Math.max(Math.min(w, maxW), minW);\n h = Math.max(Math.min(h, maxH), minH);\n\n _this3.setState({ resizing: handlerName === \"onResizeStop\" ? null : size });\n\n handler.call(_this3, i, w, h, { e: e, node: node, size: size });\n };\n };\n\n GridItem.prototype.render = function render() {\n var _props8 = this.props,\n x = _props8.x,\n y = _props8.y,\n w = _props8.w,\n h = _props8.h,\n isDraggable = _props8.isDraggable,\n isResizable = _props8.isResizable,\n useCSSTransforms = _props8.useCSSTransforms;\n\n\n var pos = this.calcPosition(x, y, w, h, this.state);\n var child = _react2.default.Children.only(this.props.children);\n\n // Create the child element. We clone the existing element but modify its className and style.\n var newChild = _react2.default.cloneElement(child, {\n className: (0, _classnames2.default)(\"react-grid-item\", child.props.className, this.props.className, {\n static: this.props.static,\n resizing: Boolean(this.state.resizing),\n \"react-draggable\": isDraggable,\n \"react-draggable-dragging\": Boolean(this.state.dragging),\n cssTransforms: useCSSTransforms\n }),\n // We can set the width and height on the child, but unfortunately we can't set the position.\n style: _extends({}, this.props.style, child.props.style, this.createStyle(pos))\n });\n\n // Resizable support. This is usually on but the user can toggle it off.\n if (isResizable) newChild = this.mixinResizable(newChild, pos);\n\n // Draggable support. This is always on, except for with placeholders.\n if (isDraggable) newChild = this.mixinDraggable(newChild);\n\n return newChild;\n };\n\n return GridItem;\n}(_react2.default.Component);\n\nGridItem.propTypes = {\n // Children must be only a single element\n children: _propTypes2.default.element,\n\n // General grid attributes\n cols: _propTypes2.default.number.isRequired,\n containerWidth: _propTypes2.default.number.isRequired,\n rowHeight: _propTypes2.default.number.isRequired,\n margin: _propTypes2.default.array.isRequired,\n maxRows: _propTypes2.default.number.isRequired,\n containerPadding: _propTypes2.default.array.isRequired,\n\n // These are all in grid units\n x: _propTypes2.default.number.isRequired,\n y: _propTypes2.default.number.isRequired,\n w: _propTypes2.default.number.isRequired,\n h: _propTypes2.default.number.isRequired,\n\n // All optional\n minW: function minW(props, propName) {\n var value = props[propName];\n if (typeof value !== \"number\") return new Error(\"minWidth not Number\");\n if (value > props.w || value > props.maxW) return new Error(\"minWidth larger than item width/maxWidth\");\n },\n\n maxW: function maxW(props, propName) {\n var value = props[propName];\n if (typeof value !== \"number\") return new Error(\"maxWidth not Number\");\n if (value < props.w || value < props.minW) return new Error(\"maxWidth smaller than item width/minWidth\");\n },\n\n minH: function minH(props, propName) {\n var value = props[propName];\n if (typeof value !== \"number\") return new Error(\"minHeight not Number\");\n if (value > props.h || value > props.maxH) return new Error(\"minHeight larger than item height/maxHeight\");\n },\n\n maxH: function maxH(props, propName) {\n var value = props[propName];\n if (typeof value !== \"number\") return new Error(\"maxHeight not Number\");\n if (value < props.h || value < props.minH) return new Error(\"maxHeight smaller than item height/minHeight\");\n },\n\n // ID is nice to have for callbacks\n i: _propTypes2.default.string.isRequired,\n\n // Functions\n onDragStop: _propTypes2.default.func,\n onDragStart: _propTypes2.default.func,\n onDrag: _propTypes2.default.func,\n onResizeStop: _propTypes2.default.func,\n onResizeStart: _propTypes2.default.func,\n onResize: _propTypes2.default.func,\n\n // Flags\n isDraggable: _propTypes2.default.bool.isRequired,\n isResizable: _propTypes2.default.bool.isRequired,\n static: _propTypes2.default.bool,\n\n // Use CSS transforms instead of top/left\n useCSSTransforms: _propTypes2.default.bool.isRequired,\n\n // Others\n className: _propTypes2.default.string,\n // Selector for draggable handle\n handle: _propTypes2.default.string,\n // Selector for draggable cancel (see react-draggable)\n cancel: _propTypes2.default.string\n};\nGridItem.defaultProps = {\n className: \"\",\n cancel: \"\",\n handle: \"\",\n minH: 1,\n minW: 1,\n maxH: Infinity,\n maxW: Infinity\n};\nexports.default = GridItem;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nmodule.exports = function() {\n throw new Error(\"Don't instantiate Resizable directly! Use require('react-resizable').Resizable\");\n};\n\nmodule.exports.Resizable = __webpack_require__(8).default;\nmodule.exports.ResizableBox = __webpack_require__(20).default;\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// React.addons.cloneWithProps look-alike that merges style & className.\nmodule.exports = function cloneElement(element, props) {\n if (props.style && element.props.style) {\n props.style = _extends({}, element.props.style, props.style);\n }\n if (props.className && element.props.className) {\n props.className = element.props.className + ' ' + props.className;\n }\n return _react2.default.cloneElement(element, props);\n};\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(1);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _Resizable = __webpack_require__(8);\n\nvar _Resizable2 = _interopRequireDefault(_Resizable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// An example use of Resizable.\nvar ResizableBox = function (_React$Component) {\n _inherits(ResizableBox, _React$Component);\n\n function ResizableBox() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, ResizableBox);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n width: _this.props.width,\n height: _this.props.height\n }, _this.onResize = function (e, data) {\n var size = data.size;\n var width = size.width,\n height = size.height;\n\n\n if (_this.props.onResize) {\n e.persist && e.persist();\n _this.setState(size, function () {\n return _this.props.onResize && _this.props.onResize(e, data);\n });\n } else {\n _this.setState(size);\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n ResizableBox.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (nextProps.width !== this.props.width || nextProps.height !== this.props.height) {\n this.setState({\n width: nextProps.width,\n height: nextProps.height\n });\n }\n };\n\n ResizableBox.prototype.render = function render() {\n // Basic wrapper around a Resizable instance.\n // If you use Resizable directly, you are responsible for updating the child component\n // with a new width and height.\n var _props = this.props,\n handleSize = _props.handleSize,\n onResize = _props.onResize,\n onResizeStart = _props.onResizeStart,\n onResizeStop = _props.onResizeStop,\n draggableOpts = _props.draggableOpts,\n minConstraints = _props.minConstraints,\n maxConstraints = _props.maxConstraints,\n lockAspectRatio = _props.lockAspectRatio,\n axis = _props.axis,\n width = _props.width,\n height = _props.height,\n props = _objectWithoutProperties(_props, ['handleSize', 'onResize', 'onResizeStart', 'onResizeStop', 'draggableOpts', 'minConstraints', 'maxConstraints', 'lockAspectRatio', 'axis', 'width', 'height']);\n\n return _react2.default.createElement(\n _Resizable2.default,\n {\n handleSize: handleSize,\n width: this.state.width,\n height: this.state.height,\n onResizeStart: onResizeStart,\n onResize: this.onResize,\n onResizeStop: onResizeStop,\n draggableOpts: draggableOpts,\n minConstraints: minConstraints,\n maxConstraints: maxConstraints,\n lockAspectRatio: lockAspectRatio,\n axis: axis\n },\n _react2.default.createElement('div', _extends({ style: { width: this.state.width + 'px', height: this.state.height + 'px' } }, props))\n );\n };\n\n return ResizableBox;\n}(_react2.default.Component);\n\nResizableBox.propTypes = {\n height: _propTypes2.default.number,\n width: _propTypes2.default.number\n};\nResizableBox.defaultProps = {\n handleSize: [20, 20]\n};\nexports.default = ResizableBox;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(1);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _lodash = __webpack_require__(3);\n\nvar _lodash2 = _interopRequireDefault(_lodash);\n\nvar _utils = __webpack_require__(2);\n\nvar _responsiveUtils = __webpack_require__(9);\n\nvar _ReactGridLayout = __webpack_require__(4);\n\nvar _ReactGridLayout2 = _interopRequireDefault(_ReactGridLayout);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar type = function type(obj) {\n return Object.prototype.toString.call(obj);\n};\n\nvar ResponsiveReactGridLayout = function (_React$Component) {\n _inherits(ResponsiveReactGridLayout, _React$Component);\n\n function ResponsiveReactGridLayout() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, ResponsiveReactGridLayout);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = _this.generateInitialState(), _this.onLayoutChange = function (layout) {\n var _extends2;\n\n _this.props.onLayoutChange(layout, _extends({}, _this.props.layouts, (_extends2 = {}, _extends2[_this.state.breakpoint] = layout, _extends2)));\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n // This should only include propTypes needed in this code; RGL itself\n // will do validation of the rest props passed to it.\n\n\n ResponsiveReactGridLayout.prototype.generateInitialState = function generateInitialState() {\n var _props = this.props,\n width = _props.width,\n breakpoints = _props.breakpoints,\n layouts = _props.layouts,\n cols = _props.cols;\n\n var breakpoint = (0, _responsiveUtils.getBreakpointFromWidth)(breakpoints, width);\n var colNo = (0, _responsiveUtils.getColsFromBreakpoint)(breakpoint, cols);\n // verticalCompact compatibility, now deprecated\n var compactType = this.props.verticalCompact === false ? null : this.props.compactType;\n // Get the initial layout. This can tricky; we try to generate one however possible if one doesn't exist\n // for this layout.\n var initialLayout = (0, _responsiveUtils.findOrGenerateResponsiveLayout)(layouts, breakpoints, breakpoint, breakpoint, colNo, compactType);\n\n return {\n layout: initialLayout,\n breakpoint: breakpoint,\n cols: colNo\n };\n };\n\n ResponsiveReactGridLayout.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n // Allow parent to set width or breakpoint directly.\n if (nextProps.width != this.props.width || nextProps.breakpoint !== this.props.breakpoint || !(0, _lodash2.default)(nextProps.breakpoints, this.props.breakpoints) || !(0, _lodash2.default)(nextProps.cols, this.props.cols)) {\n this.onWidthChange(nextProps);\n } else if (!(0, _lodash2.default)(nextProps.layouts, this.props.layouts)) {\n // Allow parent to set layouts directly.\n var _state = this.state,\n _breakpoint = _state.breakpoint,\n _cols = _state.cols;\n\n // Since we're setting an entirely new layout object, we must generate a new responsive layout\n // if one does not exist.\n\n var newLayout = (0, _responsiveUtils.findOrGenerateResponsiveLayout)(nextProps.layouts, nextProps.breakpoints, _breakpoint, _breakpoint, _cols, nextProps.compactType);\n this.setState({ layout: newLayout });\n }\n };\n\n // wrap layouts so we do not need to pass layouts to child\n\n\n /**\n * When the width changes work through breakpoints and reset state with the new width & breakpoint.\n * Width changes are necessary to figure out the widget widths.\n */\n ResponsiveReactGridLayout.prototype.onWidthChange = function onWidthChange(nextProps) {\n var breakpoints = nextProps.breakpoints,\n cols = nextProps.cols,\n layouts = nextProps.layouts,\n compactType = nextProps.compactType;\n\n var newBreakpoint = nextProps.breakpoint || (0, _responsiveUtils.getBreakpointFromWidth)(nextProps.breakpoints, nextProps.width);\n\n var lastBreakpoint = this.state.breakpoint;\n\n // Breakpoint change\n if (lastBreakpoint !== newBreakpoint || this.props.breakpoints !== breakpoints || this.props.cols !== cols) {\n // Preserve the current layout if the current breakpoint is not present in the next layouts.\n if (!(lastBreakpoint in layouts)) layouts[lastBreakpoint] = (0, _utils.cloneLayout)(this.state.layout);\n\n // Find or generate a new layout.\n var newCols = (0, _responsiveUtils.getColsFromBreakpoint)(newBreakpoint, cols);\n var _layout = (0, _responsiveUtils.findOrGenerateResponsiveLayout)(layouts, breakpoints, newBreakpoint, lastBreakpoint, newCols, compactType);\n\n // This adds missing items.\n _layout = (0, _utils.synchronizeLayoutWithChildren)(_layout, nextProps.children, newCols, compactType);\n\n // Store the new layout.\n layouts[newBreakpoint] = _layout;\n\n // callbacks\n this.props.onLayoutChange(_layout, layouts);\n this.props.onBreakpointChange(newBreakpoint, newCols);\n this.props.onWidthChange(nextProps.width, nextProps.margin, newCols, nextProps.containerPadding);\n\n this.setState({\n breakpoint: newBreakpoint,\n layout: _layout,\n cols: newCols\n });\n }\n };\n\n ResponsiveReactGridLayout.prototype.render = function render() {\n /* eslint-disable no-unused-vars */\n var _props2 = this.props,\n breakpoint = _props2.breakpoint,\n breakpoints = _props2.breakpoints,\n cols = _props2.cols,\n layouts = _props2.layouts,\n onBreakpointChange = _props2.onBreakpointChange,\n onLayoutChange = _props2.onLayoutChange,\n onWidthChange = _props2.onWidthChange,\n other = _objectWithoutProperties(_props2, [\"breakpoint\", \"breakpoints\", \"cols\", \"layouts\", \"onBreakpointChange\", \"onLayoutChange\", \"onWidthChange\"]);\n /* eslint-enable no-unused-vars */\n\n return _react2.default.createElement(_ReactGridLayout2.default, _extends({}, other, {\n onLayoutChange: this.onLayoutChange,\n layout: this.state.layout,\n cols: this.state.cols\n }));\n };\n\n return ResponsiveReactGridLayout;\n}(_react2.default.Component);\n\nResponsiveReactGridLayout.propTypes = {\n //\n // Basic props\n //\n\n // Optional, but if you are managing width yourself you may want to set the breakpoint\n // yourself as well.\n breakpoint: _propTypes2.default.string,\n\n // {name: pxVal}, e.g. {lg: 1200, md: 996, sm: 768, xs: 480}\n breakpoints: _propTypes2.default.object,\n\n // # of cols. This is a breakpoint -> cols map\n cols: _propTypes2.default.object,\n\n // layouts is an object mapping breakpoints to layouts.\n // e.g. {lg: Layout, md: Layout, ...}\n layouts: function layouts(props, propName) {\n if (type(props[propName]) !== \"[object Object]\") {\n throw new Error(\"Layout property must be an object. Received: \" + type(props[propName]));\n }\n Object.keys(props[propName]).forEach(function (key) {\n if (!(key in props.breakpoints)) {\n throw new Error(\"Each key in layouts must align with a key in breakpoints.\");\n }\n (0, _utils.validateLayout)(props.layouts[key], \"layouts.\" + key);\n });\n },\n\n\n // The width of this component.\n // Required in this propTypes stanza because generateInitialState() will fail without it.\n width: _propTypes2.default.number.isRequired,\n\n //\n // Callbacks\n //\n\n // Calls back with breakpoint and new # cols\n onBreakpointChange: _propTypes2.default.func,\n\n // Callback so you can save the layout.\n // Calls back with (currentLayout, allLayouts). allLayouts are keyed by breakpoint.\n onLayoutChange: _propTypes2.default.func,\n\n // Calls back with (containerWidth, margin, cols, containerPadding)\n onWidthChange: _propTypes2.default.func\n};\nResponsiveReactGridLayout.defaultProps = {\n breakpoints: { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 },\n cols: { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 },\n layouts: {},\n onBreakpointChange: _utils.noop,\n onLayoutChange: _utils.noop,\n onWidthChange: _utils.noop\n};\nexports.default = ResponsiveReactGridLayout;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.default = WidthProvider;\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(1);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = __webpack_require__(7);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/*\n * A simple HOC that provides facility for listening to container resizes.\n */\nfunction WidthProvider(ComposedComponent) {\n var _class, _temp2;\n\n return _temp2 = _class = function (_React$Component) {\n _inherits(WidthProvider, _React$Component);\n\n function WidthProvider() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, WidthProvider);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n width: 1280\n }, _this.mounted = false, _this.onWindowResize = function () {\n if (!_this.mounted) return;\n // eslint-disable-next-line\n var node = _reactDom2.default.findDOMNode(_this); // Flow casts this to Text | Element\n if (node instanceof HTMLElement) _this.setState({ width: node.offsetWidth });\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n WidthProvider.prototype.componentDidMount = function componentDidMount() {\n this.mounted = true;\n\n window.addEventListener(\"resize\", this.onWindowResize);\n // Call to properly set the breakpoint and resize the elements.\n // Note that if you're doing a full-width element, this can get a little wonky if a scrollbar\n // appears because of the grid. In that case, fire your own resize event, or set `overflow: scroll` on your body.\n this.onWindowResize();\n };\n\n WidthProvider.prototype.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n window.removeEventListener(\"resize\", this.onWindowResize);\n };\n\n WidthProvider.prototype.render = function render() {\n var _props = this.props,\n measureBeforeMount = _props.measureBeforeMount,\n rest = _objectWithoutProperties(_props, [\"measureBeforeMount\"]);\n\n if (measureBeforeMount && !this.mounted) {\n return _react2.default.createElement(\"div\", { className: this.props.className, style: this.props.style });\n }\n\n return _react2.default.createElement(ComposedComponent, _extends({}, rest, this.state));\n };\n\n return WidthProvider;\n }(_react2.default.Component), _class.defaultProps = {\n measureBeforeMount: false\n }, _class.propTypes = {\n // If true, will not render children until mounted. Useful for getting the exact width before\n // rendering, to prevent any unsightly resizing.\n measureBeforeMount: _propTypes2.default.bool\n }, _temp2;\n}\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// react-grid-layout.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ea671ef715fdb569cc44","module.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"react\",\"root\":\"React\"}\n// module id = 0\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/prop-types/index.js\n// module id = 1\n// module chunks = 0","// @flow\nimport isEqual from \"lodash.isequal\";\nimport React from \"react\";\nimport type {\n ChildrenArray as ReactChildrenArray,\n Element as ReactElement\n} from \"react\";\nexport type LayoutItem = {\n w: number,\n h: number,\n x: number,\n y: number,\n i: string,\n minW?: number,\n minH?: number,\n maxW?: number,\n maxH?: number,\n moved?: boolean,\n static?: boolean,\n isDraggable?: ?boolean,\n isResizable?: ?boolean\n};\nexport type Layout = Array;\nexport type Position = {\n left: number,\n top: number,\n width: number,\n height: number\n};\nexport type ReactDraggableCallbackData = {\n node: HTMLElement,\n x: number,\n y: number,\n deltaX: number,\n deltaY: number,\n lastX: number,\n lastY: number\n};\n\nexport type PartialPosition = { left: number, top: number };\nexport type Size = { width: number, height: number };\nexport type GridDragEvent = {\n e: Event,\n node: HTMLElement,\n newPosition: PartialPosition\n};\nexport type GridResizeEvent = { e: Event, node: HTMLElement, size: Size };\n\ntype REl = ReactElement;\nexport type ReactChildren = ReactChildrenArray;\n\n// All callbacks are of the signature (layout, oldItem, newItem, placeholder, e).\nexport type EventCallback = (\n Layout,\n oldItem: ?LayoutItem,\n newItem: ?LayoutItem,\n placeholder: ?LayoutItem,\n Event,\n ?HTMLElement\n) => void;\nexport type CompactType = ?(\"horizontal\" | \"vertical\");\n\nconst isProduction = process.env.NODE_ENV === \"production\";\nconst DEBUG = false;\n\n/**\n * Return the bottom coordinate of the layout.\n *\n * @param {Array} layout Layout array.\n * @return {Number} Bottom coordinate.\n */\nexport function bottom(layout: Layout): number {\n let max = 0,\n bottomY;\n for (let i = 0, len = layout.length; i < len; i++) {\n bottomY = layout[i].y + layout[i].h;\n if (bottomY > max) max = bottomY;\n }\n return max;\n}\n\nexport function cloneLayout(layout: Layout): Layout {\n const newLayout = Array(layout.length);\n for (let i = 0, len = layout.length; i < len; i++) {\n newLayout[i] = cloneLayoutItem(layout[i]);\n }\n return newLayout;\n}\n\n// Fast path to cloning, since this is monomorphic\nexport function cloneLayoutItem(layoutItem: LayoutItem): LayoutItem {\n return {\n w: layoutItem.w,\n h: layoutItem.h,\n x: layoutItem.x,\n y: layoutItem.y,\n i: layoutItem.i,\n minW: layoutItem.minW,\n maxW: layoutItem.maxW,\n minH: layoutItem.minH,\n maxH: layoutItem.maxH,\n moved: Boolean(layoutItem.moved),\n static: Boolean(layoutItem.static),\n // These can be null\n isDraggable: layoutItem.isDraggable,\n isResizable: layoutItem.isResizable\n };\n}\n\n/**\n * Comparing React `children` is a bit difficult. This is a good way to compare them.\n * This will catch differences in keys, order, and length.\n */\nexport function childrenEqual(a: ReactChildren, b: ReactChildren): boolean {\n return isEqual(\n React.Children.map(a, c => c.key),\n React.Children.map(b, c => c.key)\n );\n}\n\n/**\n * Given two layoutitems, check if they collide.\n */\nexport function collides(l1: LayoutItem, l2: LayoutItem): boolean {\n if (l1 === l2) return false; // same element\n if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2\n if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2\n if (l1.y + l1.h <= l2.y) return false; // l1 is above l2\n if (l1.y >= l2.y + l2.h) return false; // l1 is below l2\n return true; // boxes overlap\n}\n\n/**\n * Given a layout, compact it. This involves going down each y coordinate and removing gaps\n * between items.\n *\n * @param {Array} layout Layout.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} Compacted Layout.\n */\nexport function compact(\n layout: Layout,\n compactType: CompactType,\n cols: number\n): Layout {\n // Statics go in the compareWith array right away so items flow around them.\n const compareWith = getStatics(layout);\n // We go through the items by row and column.\n const sorted = sortLayoutItems(layout, compactType);\n // Holding for new items.\n const out = Array(layout.length);\n\n for (let i = 0, len = sorted.length; i < len; i++) {\n let l = cloneLayoutItem(sorted[i]);\n\n // Don't move static elements\n if (!l.static) {\n l = compactItem(compareWith, l, compactType, cols, sorted);\n\n // Add to comparison array. We only collide with items before this one.\n // Statics are already in this array.\n compareWith.push(l);\n }\n\n // Add to output array to make sure they still come out in the right order.\n out[layout.indexOf(sorted[i])] = l;\n\n // Clear moved flag, if it exists.\n l.moved = false;\n }\n\n return out;\n}\n\nconst heightWidth = { x: \"w\", y: \"h\" };\n/**\n * Before moving item down, it will check if the movement will cause collisions and move those items down before.\n */\nfunction resolveCompactionCollision(\n layout: Layout,\n item: LayoutItem,\n moveToCoord: number,\n axis: \"x\" | \"y\"\n) {\n const sizeProp = heightWidth[axis];\n item[axis] += 1;\n const itemIndex = layout.indexOf(item);\n\n // Go through each item we collide with.\n for (let i = itemIndex + 1; i < layout.length; i++) {\n const otherItem = layout[i];\n // Ignore static items\n if (otherItem.static) continue;\n\n // Optimization: we can break early if we know we're past this el\n // We can do this b/c it's a sorted layout\n if (otherItem.y > (item.y + item.h)) break;\n\n if (collides(item, otherItem)) {\n resolveCompactionCollision(\n layout,\n otherItem,\n moveToCoord + item[sizeProp],\n axis\n );\n }\n }\n\n item[axis] = moveToCoord;\n}\n\n/**\n * Compact an item in the layout.\n */\nexport function compactItem(\n compareWith: Layout,\n l: LayoutItem,\n compactType: CompactType,\n cols: number,\n fullLayout: Layout\n): LayoutItem {\n const compactV = compactType === \"vertical\";\n const compactH = compactType === \"horizontal\";\n if (compactV) {\n // Bottom 'y' possible is the bottom of the layout.\n // This allows you to do nice stuff like specify {y: Infinity}\n // This is here because the layout must be sorted in order to get the correct bottom `y`.\n l.y = Math.min(bottom(compareWith), l.y);\n // Move the element up as far as it can go without colliding.\n while (l.y > 0 && !getFirstCollision(compareWith, l)) {\n l.y--;\n }\n } else if (compactH) {\n l.y = Math.min(bottom(compareWith), l.y);\n // Move the element left as far as it can go without colliding.\n while (l.x > 0 && !getFirstCollision(compareWith, l)) {\n l.x--;\n }\n }\n\n // Move it down, and keep moving it down if it's colliding.\n let collides;\n while ((collides = getFirstCollision(compareWith, l))) {\n if (compactH) {\n resolveCompactionCollision(fullLayout, l, collides.x + collides.w, \"x\");\n } else {\n resolveCompactionCollision(fullLayout, l, collides.y + collides.h, \"y\");\n }\n // Since we can't grow without bounds horizontally, if we've overflown, let's move it down and try again.\n if (compactH && l.x + l.w > cols) {\n l.x = cols - l.w;\n l.y++;\n }\n }\n return l;\n}\n\n/**\n * Given a layout, make sure all elements fit within its bounds.\n *\n * @param {Array} layout Layout array.\n * @param {Number} bounds Number of columns.\n */\nexport function correctBounds(\n layout: Layout,\n bounds: { cols: number }\n): Layout {\n const collidesWith = getStatics(layout);\n for (let i = 0, len = layout.length; i < len; i++) {\n const l = layout[i];\n // Overflows right\n if (l.x + l.w > bounds.cols) l.x = bounds.cols - l.w;\n // Overflows left\n if (l.x < 0) {\n l.x = 0;\n l.w = bounds.cols;\n }\n if (!l.static) collidesWith.push(l);\n else {\n // If this is static and collides with other statics, we must move it down.\n // We have to do something nicer than just letting them overlap.\n while (getFirstCollision(collidesWith, l)) {\n l.y++;\n }\n }\n }\n return layout;\n}\n\n/**\n * Get a layout item by ID. Used so we can override later on if necessary.\n *\n * @param {Array} layout Layout array.\n * @param {String} id ID\n * @return {LayoutItem} Item at ID.\n */\nexport function getLayoutItem(layout: Layout, id: string): ?LayoutItem {\n for (let i = 0, len = layout.length; i < len; i++) {\n if (layout[i].i === id) return layout[i];\n }\n}\n\n/**\n * Returns the first item this layout collides with.\n * It doesn't appear to matter which order we approach this from, although\n * perhaps that is the wrong thing to do.\n *\n * @param {Object} layoutItem Layout item.\n * @return {Object|undefined} A colliding layout item, or undefined.\n */\nexport function getFirstCollision(\n layout: Layout,\n layoutItem: LayoutItem\n): ?LayoutItem {\n for (let i = 0, len = layout.length; i < len; i++) {\n if (collides(layout[i], layoutItem)) return layout[i];\n }\n}\n\nexport function getAllCollisions(\n layout: Layout,\n layoutItem: LayoutItem\n): Array {\n return layout.filter(l => collides(l, layoutItem));\n}\n\n/**\n * Get all static elements.\n * @param {Array} layout Array of layout objects.\n * @return {Array} Array of static layout items..\n */\nexport function getStatics(layout: Layout): Array {\n return layout.filter(l => l.static);\n}\n\n/**\n * Move an element. Responsible for doing cascading movements of other elements.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} l element to move.\n * @param {Number} [x] X position in grid units.\n * @param {Number} [y] Y position in grid units.\n */\nexport function moveElement(\n layout: Layout,\n l: LayoutItem,\n x: ?number,\n y: ?number,\n isUserAction: ?boolean,\n preventCollision: ?boolean,\n compactType: CompactType,\n cols: number,\n): Layout {\n if (l.static) return layout;\n\n // Short-circuit if nothing to do.\n if (l.y === y && l.x === x) return layout;\n\n log(`Moving element ${l.i} to [${String(x)},${String(y)}] from [${l.x},${l.y}]`);\n const oldX = l.x;\n const oldY = l.y;\n\n // This is quite a bit faster than extending the object\n if (typeof x === 'number') l.x = x;\n if (typeof y === 'number') l.y = y;\n l.moved = true;\n\n // If this collides with anything, move it.\n // When doing this comparison, we have to sort the items we compare with\n // to ensure, in the case of multiple collisions, that we're getting the\n // nearest collision.\n let sorted = sortLayoutItems(layout, compactType);\n const movingUp =\n compactType === \"vertical\" && typeof y === 'number' ? oldY >= y\n : compactType === \"horizontal\" && typeof x === 'number' ? oldX >= x\n : false;\n if (movingUp) sorted = sorted.reverse();\n const collisions = getAllCollisions(sorted, l);\n\n // There was a collision; abort\n if (preventCollision && collisions.length) {\n log(`Collision prevented on ${l.i}, reverting.`);\n l.x = oldX;\n l.y = oldY;\n l.moved = false;\n return layout;\n }\n\n // Move each item that collides away from this element.\n for (let i = 0, len = collisions.length; i < len; i++) {\n const collision = collisions[i];\n log(\n `Resolving collision between ${l.i} at [${l.x},${l.y}] and ${\n collision.i\n } at [${collision.x},${collision.y}]`\n );\n\n // Short circuit so we can't infinite loop\n if (collision.moved) continue;\n\n // Don't move static items - we have to move *this* element away\n if (collision.static) {\n layout = moveElementAwayFromCollision(\n layout,\n collision,\n l,\n isUserAction,\n compactType,\n cols\n );\n } else {\n layout = moveElementAwayFromCollision(\n layout,\n l,\n collision,\n isUserAction,\n compactType,\n cols\n );\n }\n }\n\n return layout;\n}\n\n/**\n * This is where the magic needs to happen - given a collision, move an element away from the collision.\n * We attempt to move it up if there's room, otherwise it goes below.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} collidesWith Layout item we're colliding with.\n * @param {LayoutItem} itemToMove Layout item we're moving.\n */\nexport function moveElementAwayFromCollision(\n layout: Layout,\n collidesWith: LayoutItem,\n itemToMove: LayoutItem,\n isUserAction: ?boolean,\n compactType: CompactType,\n cols: number\n): Layout {\n const compactH = compactType === \"horizontal\";\n const compactV = compactType === \"vertical\";\n const preventCollision = false; // we're already colliding\n\n // If there is enough space above the collision to put this element, move it there.\n // We only do this on the main collision as this can get funky in cascades and cause\n // unwanted swapping behavior.\n if (isUserAction) {\n // Reset isUserAction flag because we're not in the main collision anymore.\n isUserAction = false;\n\n // Make a mock item so we don't modify the item here, only modify in moveElement.\n const fakeItem: LayoutItem = {\n x: compactH ? Math.max(collidesWith.x - itemToMove.w, 0) : itemToMove.x,\n y: compactV ? Math.max(collidesWith.y - itemToMove.h, 0) : itemToMove.y,\n w: itemToMove.w,\n h: itemToMove.h,\n i: \"-1\"\n };\n\n // No collision? If so, we can go up there; otherwise, we'll end up moving down as normal\n if (!getFirstCollision(layout, fakeItem)) {\n log(\n `Doing reverse collision on ${itemToMove.i} up to [${fakeItem.x},${\n fakeItem.y\n }].`\n );\n return moveElement(\n layout,\n itemToMove,\n compactH ? fakeItem.x : undefined,\n compactV ? fakeItem.y : undefined,\n isUserAction,\n preventCollision,\n compactType,\n cols\n );\n }\n }\n\n return moveElement(\n layout,\n itemToMove,\n compactH ? itemToMove.x + 1 : undefined,\n compactV ? itemToMove.y + 1 : undefined,\n isUserAction,\n preventCollision,\n compactType,\n cols\n );\n}\n\n/**\n * Helper to convert a number to a percentage string.\n *\n * @param {Number} num Any number\n * @return {String} That number as a percentage.\n */\nexport function perc(num: number): string {\n return num * 100 + \"%\";\n}\n\nexport function setTransform({ top, left, width, height }: Position): Object {\n // Replace unitless items with px\n const translate = `translate(${left}px,${top}px)`;\n return {\n transform: translate,\n WebkitTransform: translate,\n MozTransform: translate,\n msTransform: translate,\n OTransform: translate,\n width: `${width}px`,\n height: `${height}px`,\n position: \"absolute\"\n };\n}\n\nexport function setTopLeft({ top, left, width, height }: Position): Object {\n return {\n top: `${top}px`,\n left: `${left}px`,\n width: `${width}px`,\n height: `${height}px`,\n position: \"absolute\"\n };\n}\n\n/**\n * Get layout items sorted from top left to right and down.\n *\n * @return {Array} Array of layout objects.\n * @return {Array} Layout, sorted static items first.\n */\nexport function sortLayoutItems(\n layout: Layout,\n compactType: CompactType\n): Layout {\n if (compactType === \"horizontal\") return sortLayoutItemsByColRow(layout);\n else return sortLayoutItemsByRowCol(layout);\n}\n\nexport function sortLayoutItemsByRowCol(layout: Layout): Layout {\n return [].concat(layout).sort(function(a, b) {\n if (a.y > b.y || (a.y === b.y && a.x > b.x)) {\n return 1;\n } else if (a.y === b.y && a.x === b.x) {\n // Without this, we can get different sort results in IE vs. Chrome/FF\n return 0;\n }\n return -1;\n });\n}\n\nexport function sortLayoutItemsByColRow(layout: Layout): Layout {\n return [].concat(layout).sort(function(a, b) {\n if (a.x > b.x || (a.x === b.x && a.y > b.y)) {\n return 1;\n }\n return -1;\n });\n}\n\n/**\n * Generate a layout using the initialLayout and children as a template.\n * Missing entries will be added, extraneous ones will be truncated.\n *\n * @param {Array} initialLayout Layout passed in through props.\n * @param {String} breakpoint Current responsive breakpoint.\n * @param {?String} compact Compaction option.\n * @return {Array} Working layout.\n */\nexport function synchronizeLayoutWithChildren(\n initialLayout: Layout,\n children: ReactChildren,\n cols: number,\n compactType: CompactType\n): Layout {\n initialLayout = initialLayout || [];\n\n // Generate one layout item per child.\n let layout: Layout = [];\n React.Children.forEach(children, (child: ReactElement, i: number) => {\n // Don't overwrite if it already exists.\n const exists = getLayoutItem(initialLayout, String(child.key));\n if (exists) {\n layout[i] = cloneLayoutItem(exists);\n } else {\n if (!isProduction && child.props._grid) {\n console.warn(\n \"`_grid` properties on children have been deprecated as of React 15.2. \" + // eslint-disable-line\n \"Please use `data-grid` or add your properties directly to the `layout`.\"\n );\n }\n const g = child.props[\"data-grid\"] || child.props._grid;\n\n // Hey, this item has a data-grid property, use it.\n if (g) {\n if (!isProduction) {\n validateLayout([g], \"ReactGridLayout.children\");\n }\n layout[i] = cloneLayoutItem({ ...g, i: child.key });\n } else {\n // Nothing provided: ensure this is added to the bottom\n layout[i] = cloneLayoutItem({\n w: 1,\n h: 1,\n x: 0,\n y: bottom(layout),\n i: String(child.key)\n });\n }\n }\n });\n\n // Correct the layout.\n layout = correctBounds(layout, { cols: cols });\n layout = compact(layout, compactType, cols);\n\n return layout;\n}\n\n/**\n * Validate a layout. Throws errors.\n *\n * @param {Array} layout Array of layout items.\n * @param {String} [contextName] Context name for errors.\n * @throw {Error} Validation error.\n */\nexport function validateLayout(\n layout: Layout,\n contextName: string = \"Layout\"\n): void {\n const subProps = [\"x\", \"y\", \"w\", \"h\"];\n if (!Array.isArray(layout))\n throw new Error(contextName + \" must be an array!\");\n for (let i = 0, len = layout.length; i < len; i++) {\n const item = layout[i];\n for (let j = 0; j < subProps.length; j++) {\n if (typeof item[subProps[j]] !== \"number\") {\n throw new Error(\n \"ReactGridLayout: \" +\n contextName +\n \"[\" +\n i +\n \"].\" +\n subProps[j] +\n \" must be a number!\"\n );\n }\n }\n if (item.i && typeof item.i !== \"string\") {\n throw new Error(\n \"ReactGridLayout: \" + contextName + \"[\" + i + \"].i must be a string!\"\n );\n }\n if (item.static !== undefined && typeof item.static !== \"boolean\") {\n throw new Error(\n \"ReactGridLayout: \" +\n contextName +\n \"[\" +\n i +\n \"].static must be a boolean!\"\n );\n }\n }\n}\n\n// Flow can't really figure this out, so we just use Object\nexport function autoBindHandlers(el: Object, fns: Array): void {\n fns.forEach(key => (el[key] = el[key].bind(el)));\n}\n\nfunction log(...args) {\n if (!DEBUG) return;\n // eslint-disable-next-line no-console\n console.log(...args);\n}\n\nexport const noop = () => {};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/utils.js","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash.isequal/index.js\n// module id = 3\n// module chunks = 0","// @flow\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport isEqual from \"lodash.isequal\";\nimport classNames from \"classnames\";\nimport {\n autoBindHandlers,\n bottom,\n childrenEqual,\n cloneLayoutItem,\n compact,\n getLayoutItem,\n moveElement,\n synchronizeLayoutWithChildren,\n validateLayout,\n getAllCollisions,\n noop\n} from \"./utils\";\nimport GridItem from \"./GridItem\";\nimport type {\n ChildrenArray as ReactChildrenArray,\n Element as ReactElement\n} from \"react\";\n\n// Types\nimport type {\n EventCallback,\n CompactType,\n GridResizeEvent,\n GridDragEvent,\n Layout,\n LayoutItem\n} from \"./utils\";\n\ntype State = {\n activeDrag: ?LayoutItem,\n layout: Layout,\n mounted: boolean,\n oldDragItem: ?LayoutItem,\n oldLayout: ?Layout,\n oldResizeItem: ?LayoutItem\n};\n\nexport type Props = {\n className: string,\n style: Object,\n width: number,\n autoSize: boolean,\n cols: number,\n draggableCancel: string,\n draggableHandle: string,\n verticalCompact: boolean,\n compactType: ?(\"horizontal\" | \"vertical\"),\n layout: Layout,\n margin: [number, number],\n containerPadding: [number, number] | null,\n rowHeight: number,\n maxRows: number,\n isDraggable: boolean,\n isResizable: boolean,\n preventCollision: boolean,\n useCSSTransforms: boolean,\n\n // Callbacks\n onLayoutChange: Layout => void,\n onDrag: EventCallback,\n onDragStart: EventCallback,\n onDragStop: EventCallback,\n onResize: EventCallback,\n onResizeStart: EventCallback,\n onResizeStop: EventCallback,\n children: ReactChildrenArray>\n};\n// End Types\n\n/**\n * A reactive, fluid grid layout with draggable, resizable components.\n */\n\nexport default class ReactGridLayout extends React.Component {\n // TODO publish internal ReactClass displayName transform\n static displayName = \"ReactGridLayout\";\n\n static propTypes = {\n //\n // Basic props\n //\n className: PropTypes.string,\n style: PropTypes.object,\n\n // This can be set explicitly. If it is not set, it will automatically\n // be set to the container width. Note that resizes will *not* cause this to adjust.\n // If you need that behavior, use WidthProvider.\n width: PropTypes.number,\n\n // If true, the container height swells and contracts to fit contents\n autoSize: PropTypes.bool,\n // # of cols.\n cols: PropTypes.number,\n\n // A selector that will not be draggable.\n draggableCancel: PropTypes.string,\n // A selector for the draggable handler\n draggableHandle: PropTypes.string,\n\n // Deprecated\n verticalCompact: function(props: Props) {\n if (\n props.verticalCompact === false &&\n process.env.NODE_ENV !== \"production\"\n ) {\n console.warn(\n // eslint-disable-line no-console\n \"`verticalCompact` on is deprecated and will be removed soon. \" +\n 'Use `compactType`: \"horizontal\" | \"vertical\" | null.'\n );\n }\n },\n // Choose vertical or hotizontal compaction\n compactType: PropTypes.oneOf([\"vertical\", \"horizontal\"]),\n\n // layout is an array of object with the format:\n // {x: Number, y: Number, w: Number, h: Number, i: String}\n layout: function(props: Props) {\n var layout = props.layout;\n // I hope you're setting the data-grid property on the grid items\n if (layout === undefined) return;\n validateLayout(layout, \"layout\");\n },\n\n //\n // Grid Dimensions\n //\n\n // Margin between items [x, y] in px\n margin: PropTypes.arrayOf(PropTypes.number),\n // Padding inside the container [x, y] in px\n containerPadding: PropTypes.arrayOf(PropTypes.number),\n // Rows have a static height, but you can change this based on breakpoints if you like\n rowHeight: PropTypes.number,\n // Default Infinity, but you can specify a max here if you like.\n // Note that this isn't fully fleshed out and won't error if you specify a layout that\n // extends beyond the row capacity. It will, however, not allow users to drag/resize\n // an item past the barrier. They can push items beyond the barrier, though.\n // Intentionally not documented for this reason.\n maxRows: PropTypes.number,\n\n //\n // Flags\n //\n isDraggable: PropTypes.bool,\n isResizable: PropTypes.bool,\n // If true, grid items won't change position when being dragged over.\n preventCollision: PropTypes.bool,\n // Use CSS transforms instead of top/left\n useCSSTransforms: PropTypes.bool,\n\n //\n // Callbacks\n //\n\n // Callback so you can save the layout. Calls after each drag & resize stops.\n onLayoutChange: PropTypes.func,\n\n // Calls when drag starts. Callback is of the signature (layout, oldItem, newItem, placeholder, e, ?node).\n // All callbacks below have the same signature. 'start' and 'stop' callbacks omit the 'placeholder'.\n onDragStart: PropTypes.func,\n // Calls on each drag movement.\n onDrag: PropTypes.func,\n // Calls when drag is complete.\n onDragStop: PropTypes.func,\n //Calls when resize starts.\n onResizeStart: PropTypes.func,\n // Calls when resize movement happens.\n onResize: PropTypes.func,\n // Calls when resize is complete.\n onResizeStop: PropTypes.func,\n\n //\n // Other validations\n //\n\n // Children must not have duplicate keys.\n children: function(props: Props, propName: string) {\n var children = props[propName];\n\n // Check children keys for duplicates. Throw if found.\n var keys = {};\n React.Children.forEach(children, function(child) {\n if (keys[child.key]) {\n throw new Error(\n 'Duplicate child key \"' +\n child.key +\n '\" found! This will cause problems in ReactGridLayout.'\n );\n }\n keys[child.key] = true;\n });\n }\n };\n\n static defaultProps = {\n autoSize: true,\n cols: 12,\n className: \"\",\n style: {},\n draggableHandle: \"\",\n draggableCancel: \"\",\n containerPadding: null,\n rowHeight: 150,\n maxRows: Infinity, // infinite vertical growth\n layout: [],\n margin: [10, 10],\n isDraggable: true,\n isResizable: true,\n useCSSTransforms: true,\n verticalCompact: true,\n compactType: \"vertical\",\n preventCollision: false,\n onLayoutChange: noop,\n onDragStart: noop,\n onDrag: noop,\n onDragStop: noop,\n onResizeStart: noop,\n onResize: noop,\n onResizeStop: noop\n };\n\n state: State = {\n activeDrag: null,\n layout: synchronizeLayoutWithChildren(\n this.props.layout,\n this.props.children,\n this.props.cols,\n // Legacy support for verticalCompact: false\n this.compactType()\n ),\n mounted: false,\n oldDragItem: null,\n oldLayout: null,\n oldResizeItem: null\n };\n\n constructor(props: Props, context: any): void {\n super(props, context);\n autoBindHandlers(this, [\n \"onDragStart\",\n \"onDrag\",\n \"onDragStop\",\n \"onResizeStart\",\n \"onResize\",\n \"onResizeStop\"\n ]);\n }\n\n componentDidMount() {\n this.setState({ mounted: true });\n // Possibly call back with layout on mount. This should be done after correcting the layout width\n // to ensure we don't rerender with the wrong width.\n this.onLayoutMaybeChanged(this.state.layout, this.props.layout);\n }\n\n componentWillReceiveProps(nextProps: Props) {\n let newLayoutBase;\n // Legacy support for compactType\n // Allow parent to set layout directly.\n if (\n !isEqual(nextProps.layout, this.props.layout) ||\n nextProps.compactType !== this.props.compactType\n ) {\n newLayoutBase = nextProps.layout;\n } else if (!childrenEqual(this.props.children, nextProps.children)) {\n // If children change, also regenerate the layout. Use our state\n // as the base in case because it may be more up to date than\n // what is in props.\n newLayoutBase = this.state.layout;\n }\n\n // We need to regenerate the layout.\n if (newLayoutBase) {\n const newLayout = synchronizeLayoutWithChildren(\n newLayoutBase,\n nextProps.children,\n nextProps.cols,\n this.compactType(nextProps)\n );\n const oldLayout = this.state.layout;\n this.setState({ layout: newLayout });\n this.onLayoutMaybeChanged(newLayout, oldLayout);\n }\n }\n\n /**\n * Calculates a pixel value for the container.\n * @return {String} Container height in pixels.\n */\n containerHeight() {\n if (!this.props.autoSize) return;\n const nbRow = bottom(this.state.layout);\n const containerPaddingY = this.props.containerPadding\n ? this.props.containerPadding[1]\n : this.props.margin[1];\n return (\n nbRow * this.props.rowHeight +\n (nbRow - 1) * this.props.margin[1] +\n containerPaddingY * 2 +\n \"px\"\n );\n }\n\n compactType(props: ?Object): CompactType {\n if (!props) props = this.props;\n return props.verticalCompact === false ? null : props.compactType;\n }\n\n /**\n * When dragging starts\n * @param {String} i Id of the child\n * @param {Number} x X position of the move\n * @param {Number} y Y position of the move\n * @param {Event} e The mousedown event\n * @param {Element} node The current dragging DOM element\n */\n onDragStart(i: string, x: number, y: number, { e, node }: GridDragEvent) {\n const { layout } = this.state;\n var l = getLayoutItem(layout, i);\n if (!l) return;\n\n this.setState({\n oldDragItem: cloneLayoutItem(l),\n oldLayout: this.state.layout\n });\n\n return this.props.onDragStart(layout, l, l, null, e, node);\n }\n\n /**\n * Each drag movement create a new dragelement and move the element to the dragged location\n * @param {String} i Id of the child\n * @param {Number} x X position of the move\n * @param {Number} y Y position of the move\n * @param {Event} e The mousedown event\n * @param {Element} node The current dragging DOM element\n */\n onDrag(i: string, x: number, y: number, { e, node }: GridDragEvent) {\n const { oldDragItem } = this.state;\n let { layout } = this.state;\n const { cols } = this.props;\n var l = getLayoutItem(layout, i);\n if (!l) return;\n\n // Create placeholder (display only)\n var placeholder = {\n w: l.w,\n h: l.h,\n x: l.x,\n y: l.y,\n placeholder: true,\n i: i\n };\n\n // Move the element to the dragged location.\n const isUserAction = true;\n layout = moveElement(\n layout,\n l,\n x,\n y,\n isUserAction,\n this.props.preventCollision,\n this.compactType(),\n cols\n );\n\n this.props.onDrag(layout, oldDragItem, l, placeholder, e, node);\n\n this.setState({\n layout: compact(layout, this.compactType(), cols),\n activeDrag: placeholder\n });\n }\n\n /**\n * When dragging stops, figure out which position the element is closest to and update its x and y.\n * @param {String} i Index of the child.\n * @param {Number} x X position of the move\n * @param {Number} y Y position of the move\n * @param {Event} e The mousedown event\n * @param {Element} node The current dragging DOM element\n */\n onDragStop(i: string, x: number, y: number, { e, node }: GridDragEvent) {\n const { oldDragItem } = this.state;\n let { layout } = this.state;\n const { cols, preventCollision } = this.props;\n const l = getLayoutItem(layout, i);\n if (!l) return;\n\n // Move the element here\n const isUserAction = true;\n layout = moveElement(\n layout,\n l,\n x,\n y,\n isUserAction,\n preventCollision,\n this.compactType(),\n cols\n );\n\n this.props.onDragStop(layout, oldDragItem, l, null, e, node);\n\n // Set state\n const newLayout = compact(layout, this.compactType(), cols);\n const { oldLayout } = this.state;\n this.setState({\n activeDrag: null,\n layout: newLayout,\n oldDragItem: null,\n oldLayout: null\n });\n\n this.onLayoutMaybeChanged(newLayout, oldLayout);\n }\n\n onLayoutMaybeChanged(newLayout: Layout, oldLayout: ?Layout) {\n if (!oldLayout) oldLayout = this.state.layout;\n if (!isEqual(oldLayout, newLayout)) {\n this.props.onLayoutChange(newLayout);\n }\n }\n\n onResizeStart(i: string, w: number, h: number, { e, node }: GridResizeEvent) {\n const { layout } = this.state;\n var l = getLayoutItem(layout, i);\n if (!l) return;\n\n this.setState({\n oldResizeItem: cloneLayoutItem(l),\n oldLayout: this.state.layout\n });\n\n this.props.onResizeStart(layout, l, l, null, e, node);\n }\n\n onResize(i: string, w: number, h: number, { e, node }: GridResizeEvent) {\n const { layout, oldResizeItem } = this.state;\n const { cols, preventCollision } = this.props;\n const l: ?LayoutItem = getLayoutItem(layout, i);\n if (!l) return;\n\n // Something like quad tree should be used\n // to find collisions faster\n let hasCollisions;\n if (preventCollision) {\n const collisions = getAllCollisions(layout, { ...l, w, h }).filter(\n layoutItem => layoutItem.i !== l.i\n );\n hasCollisions = collisions.length > 0;\n\n // If we're colliding, we need adjust the placeholder.\n if (hasCollisions) {\n // adjust w && h to maximum allowed space\n let leastX = Infinity,\n leastY = Infinity;\n collisions.forEach(layoutItem => {\n if (layoutItem.x > l.x) leastX = Math.min(leastX, layoutItem.x);\n if (layoutItem.y > l.y) leastY = Math.min(leastY, layoutItem.y);\n });\n\n if (Number.isFinite(leastX)) l.w = leastX - l.x;\n if (Number.isFinite(leastY)) l.h = leastY - l.y;\n }\n }\n\n if (!hasCollisions) {\n // Set new width and height.\n l.w = w;\n l.h = h;\n }\n\n // Create placeholder element (display only)\n var placeholder = {\n w: l.w,\n h: l.h,\n x: l.x,\n y: l.y,\n static: true,\n i: i\n };\n\n this.props.onResize(layout, oldResizeItem, l, placeholder, e, node);\n\n // Re-compact the layout and set the drag placeholder.\n this.setState({\n layout: compact(layout, this.compactType(), cols),\n activeDrag: placeholder\n });\n }\n\n onResizeStop(i: string, w: number, h: number, { e, node }: GridResizeEvent) {\n const { layout, oldResizeItem } = this.state;\n const { cols } = this.props;\n var l = getLayoutItem(layout, i);\n\n this.props.onResizeStop(layout, oldResizeItem, l, null, e, node);\n\n // Set state\n const newLayout = compact(layout, this.compactType(), cols);\n const { oldLayout } = this.state;\n this.setState({\n activeDrag: null,\n layout: newLayout,\n oldResizeItem: null,\n oldLayout: null\n });\n\n this.onLayoutMaybeChanged(newLayout, oldLayout);\n }\n\n /**\n * Create a placeholder object.\n * @return {Element} Placeholder div.\n */\n placeholder(): ?ReactElement {\n const { activeDrag } = this.state;\n if (!activeDrag) return null;\n const {\n width,\n cols,\n margin,\n containerPadding,\n rowHeight,\n maxRows,\n useCSSTransforms\n } = this.props;\n\n // {...this.state.activeDrag} is pretty slow, actually\n return (\n \n
\n \n );\n }\n\n /**\n * Given a grid item, set its style attributes & surround in a .\n * @param {Element} child React element.\n * @return {Element} Element wrapped in draggable and properly placed.\n */\n processGridItem(child: ReactElement): ?ReactElement {\n if (!child || !child.key) return;\n const l = getLayoutItem(this.state.layout, String(child.key));\n if (!l) return null;\n const {\n width,\n cols,\n margin,\n containerPadding,\n rowHeight,\n maxRows,\n isDraggable,\n isResizable,\n useCSSTransforms,\n draggableCancel,\n draggableHandle\n } = this.props;\n const { mounted } = this.state;\n\n // Parse 'static'. Any properties defined directly on the grid item will take precedence.\n const draggable = Boolean(\n !l.static && isDraggable && (l.isDraggable || l.isDraggable == null)\n );\n const resizable = Boolean(\n !l.static && isResizable && (l.isResizable || l.isResizable == null)\n );\n\n return (\n \n {child}\n \n );\n }\n\n render() {\n const { className, style } = this.props;\n\n const mergedClassName = classNames(\"react-grid-layout\", className);\n const mergedStyle = {\n height: this.containerHeight(),\n ...style\n };\n\n return (\n
\n {React.Children.map(this.props.children, child =>\n this.processGridItem(child)\n )}\n {this.placeholder()}\n
\n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/ReactGridLayout.jsx","/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/classnames/index.js\n// module id = 5\n// module chunks = 0","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react-dom\"), require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react-dom\", \"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactDraggable\"] = factory(require(\"react-dom\"), require(\"react\"));\n\telse\n\t\troot[\"ReactDraggable\"] = factory(root[\"ReactDOM\"], root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_6__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 12);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findInArray = findInArray;\nexports.isFunction = isFunction;\nexports.isNum = isNum;\nexports.int = int;\nexports.dontSetMe = dontSetMe;\n\n// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc\nfunction findInArray(array /*: Array | TouchList*/, callback /*: Function*/) /*: any*/ {\n for (var i = 0, length = array.length; i < length; i++) {\n if (callback.apply(callback, [array[i], i, array])) return array[i];\n }\n}\n\nfunction isFunction(func /*: any*/) /*: boolean*/ {\n return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';\n}\n\nfunction isNum(num /*: any*/) /*: boolean*/ {\n return typeof num === 'number' && !isNaN(num);\n}\n\nfunction int(a /*: string*/) /*: number*/ {\n return parseInt(a, 10);\n}\n\nfunction dontSetMe(props /*: Object*/, propName /*: string*/, componentName /*: string*/) {\n if (props[propName]) {\n return new Error('Invalid prop ' + propName + ' passed to ' + componentName + ' - do not set this, set it on the child.');\n }\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.matchesSelector = matchesSelector;\nexports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;\nexports.addEvent = addEvent;\nexports.removeEvent = removeEvent;\nexports.outerHeight = outerHeight;\nexports.outerWidth = outerWidth;\nexports.innerHeight = innerHeight;\nexports.innerWidth = innerWidth;\nexports.offsetXYFromParent = offsetXYFromParent;\nexports.createCSSTransform = createCSSTransform;\nexports.createSVGTransform = createSVGTransform;\nexports.getTouch = getTouch;\nexports.getTouchIdentifier = getTouchIdentifier;\nexports.addUserSelectStyles = addUserSelectStyles;\nexports.removeUserSelectStyles = removeUserSelectStyles;\nexports.styleHacks = styleHacks;\nexports.addClassName = addClassName;\nexports.removeClassName = removeClassName;\n\nvar _shims = __webpack_require__(0);\n\nvar _getPrefix = __webpack_require__(19);\n\nvar _getPrefix2 = _interopRequireDefault(_getPrefix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/*:: import type {ControlPosition, MouseTouchEvent} from './types';*/\n\n\nvar matchesSelectorFunc = '';\nfunction matchesSelector(el /*: Node*/, selector /*: string*/) /*: boolean*/ {\n if (!matchesSelectorFunc) {\n matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {\n // $FlowIgnore: Doesn't think elements are indexable\n return (0, _shims.isFunction)(el[method]);\n });\n }\n\n // Might not be found entirely (not an Element?) - in that case, bail\n // $FlowIgnore: Doesn't think elements are indexable\n if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false;\n\n // $FlowIgnore: Doesn't think elements are indexable\n return el[matchesSelectorFunc](selector);\n}\n\n// Works up the tree to the draggable itself attempting to match selector.\nfunction matchesSelectorAndParentsTo(el /*: Node*/, selector /*: string*/, baseNode /*: Node*/) /*: boolean*/ {\n var node = el;\n do {\n if (matchesSelector(node, selector)) return true;\n if (node === baseNode) return false;\n node = node.parentNode;\n } while (node);\n\n return false;\n}\n\nfunction addEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {\n if (!el) {\n return;\n }\n if (el.attachEvent) {\n el.attachEvent('on' + event, handler);\n } else if (el.addEventListener) {\n el.addEventListener(event, handler, true);\n } else {\n // $FlowIgnore: Doesn't think elements are indexable\n el['on' + event] = handler;\n }\n}\n\nfunction removeEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {\n if (!el) {\n return;\n }\n if (el.detachEvent) {\n el.detachEvent('on' + event, handler);\n } else if (el.removeEventListener) {\n el.removeEventListener(event, handler, true);\n } else {\n // $FlowIgnore: Doesn't think elements are indexable\n el['on' + event] = null;\n }\n}\n\nfunction outerHeight(node /*: HTMLElement*/) /*: number*/ {\n // This is deliberately excluding margin for our calculations, since we are using\n // offsetTop which is including margin. See getBoundPosition\n var height = node.clientHeight;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n height += (0, _shims.int)(computedStyle.borderTopWidth);\n height += (0, _shims.int)(computedStyle.borderBottomWidth);\n return height;\n}\n\nfunction outerWidth(node /*: HTMLElement*/) /*: number*/ {\n // This is deliberately excluding margin for our calculations, since we are using\n // offsetLeft which is including margin. See getBoundPosition\n var width = node.clientWidth;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n width += (0, _shims.int)(computedStyle.borderLeftWidth);\n width += (0, _shims.int)(computedStyle.borderRightWidth);\n return width;\n}\nfunction innerHeight(node /*: HTMLElement*/) /*: number*/ {\n var height = node.clientHeight;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n height -= (0, _shims.int)(computedStyle.paddingTop);\n height -= (0, _shims.int)(computedStyle.paddingBottom);\n return height;\n}\n\nfunction innerWidth(node /*: HTMLElement*/) /*: number*/ {\n var width = node.clientWidth;\n var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);\n width -= (0, _shims.int)(computedStyle.paddingLeft);\n width -= (0, _shims.int)(computedStyle.paddingRight);\n return width;\n}\n\n// Get from offsetParent\nfunction offsetXYFromParent(evt /*: {clientX: number, clientY: number}*/, offsetParent /*: HTMLElement*/) /*: ControlPosition*/ {\n var isBody = offsetParent === offsetParent.ownerDocument.body;\n var offsetParentRect = isBody ? { left: 0, top: 0 } : offsetParent.getBoundingClientRect();\n\n var x = evt.clientX + offsetParent.scrollLeft - offsetParentRect.left;\n var y = evt.clientY + offsetParent.scrollTop - offsetParentRect.top;\n\n return { x: x, y: y };\n}\n\nfunction createCSSTransform(_ref) /*: Object*/ {\n var x = _ref.x,\n y = _ref.y;\n\n // Replace unitless items with px\n return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix2.default), 'translate(' + x + 'px,' + y + 'px)');\n}\n\nfunction createSVGTransform(_ref3) /*: string*/ {\n var x = _ref3.x,\n y = _ref3.y;\n\n return 'translate(' + x + ',' + y + ')';\n}\n\nfunction getTouch(e /*: MouseTouchEvent*/, identifier /*: number*/) /*: ?{clientX: number, clientY: number}*/ {\n return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) {\n return identifier === t.identifier;\n }) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) {\n return identifier === t.identifier;\n });\n}\n\nfunction getTouchIdentifier(e /*: MouseTouchEvent*/) /*: ?number*/ {\n if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;\n if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;\n}\n\n// User-select Hacks:\n//\n// Useful for preventing blue highlights all over everything when dragging.\n\n// Note we're passing `document` b/c we could be iframed\nfunction addUserSelectStyles(doc /*: ?Document*/) {\n if (!doc) return;\n var styleEl = doc.getElementById('react-draggable-style-el');\n if (!styleEl) {\n styleEl = doc.createElement('style');\n styleEl.type = 'text/css';\n styleEl.id = 'react-draggable-style-el';\n styleEl.innerHTML = '.react-draggable-transparent-selection *::-moz-selection {background: transparent;}\\n';\n styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {background: transparent;}\\n';\n doc.getElementsByTagName('head')[0].appendChild(styleEl);\n }\n if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection');\n}\n\nfunction removeUserSelectStyles(doc /*: ?Document*/) {\n try {\n if (doc && doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection');\n window.getSelection().removeAllRanges(); // remove selection caused by scroll\n } catch (e) {\n // probably IE\n }\n}\n\nfunction styleHacks() /*: Object*/ {\n var childStyle /*: Object*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n // Workaround IE pointer events; see #51\n // https://github.com/mzabriskie/react-draggable/issues/51#issuecomment-103488278\n return _extends({\n touchAction: 'none'\n }, childStyle);\n}\n\nfunction addClassName(el /*: HTMLElement*/, className /*: string*/) {\n if (el.classList) {\n el.classList.add(className);\n } else {\n if (!el.className.match(new RegExp('(?:^|\\\\s)' + className + '(?!\\\\S)'))) {\n el.className += ' ' + className;\n }\n }\n}\n\nfunction removeClassName(el /*: HTMLElement*/, className /*: string*/) {\n if (el.classList) {\n el.classList.remove(className);\n } else {\n el.className = el.className.replace(new RegExp('(?:^|\\\\s)' + className + '(?!\\\\S)', 'g'), '');\n }\n}\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_6__;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = __webpack_require__(14)(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(17)();\n}\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\nvar emptyFunction = __webpack_require__(1);\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getBoundPosition = getBoundPosition;\nexports.snapToGrid = snapToGrid;\nexports.canDragX = canDragX;\nexports.canDragY = canDragY;\nexports.getControlPosition = getControlPosition;\nexports.createCoreData = createCoreData;\nexports.createDraggableData = createDraggableData;\n\nvar _shims = __webpack_require__(0);\n\nvar _reactDom = __webpack_require__(4);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _domFns = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/*:: import type Draggable from '../Draggable';*/\n/*:: import type {Bounds, ControlPosition, DraggableData, MouseTouchEvent} from './types';*/\n/*:: import type DraggableCore from '../DraggableCore';*/\nfunction getBoundPosition(draggable /*: Draggable*/, x /*: number*/, y /*: number*/) /*: [number, number]*/ {\n // If no bounds, short-circuit and move on\n if (!draggable.props.bounds) return [x, y];\n\n // Clone new bounds\n var bounds = draggable.props.bounds;\n\n bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);\n var node = findDOMNode(draggable);\n\n if (typeof bounds === 'string') {\n var ownerDocument = node.ownerDocument;\n\n var ownerWindow = ownerDocument.defaultView;\n var boundNode = void 0;\n if (bounds === 'parent') {\n boundNode = node.parentNode;\n } else {\n boundNode = ownerDocument.querySelector(bounds);\n }\n if (!(boundNode instanceof HTMLElement)) {\n throw new Error('Bounds selector \"' + bounds + '\" could not find an element.');\n }\n var nodeStyle = ownerWindow.getComputedStyle(node);\n var boundNodeStyle = ownerWindow.getComputedStyle(boundNode);\n // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.\n bounds = {\n left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),\n top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),\n right: (0, _domFns.innerWidth)(boundNode) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),\n bottom: (0, _domFns.innerHeight)(boundNode) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)\n };\n }\n\n // Keep x and y below right and bottom limits...\n if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right);\n if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom);\n\n // But above left and top limits.\n if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left);\n if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top);\n\n return [x, y];\n}\n\nfunction snapToGrid(grid /*: [number, number]*/, pendingX /*: number*/, pendingY /*: number*/) /*: [number, number]*/ {\n var x = Math.round(pendingX / grid[0]) * grid[0];\n var y = Math.round(pendingY / grid[1]) * grid[1];\n return [x, y];\n}\n\nfunction canDragX(draggable /*: Draggable*/) /*: boolean*/ {\n return draggable.props.axis === 'both' || draggable.props.axis === 'x';\n}\n\nfunction canDragY(draggable /*: Draggable*/) /*: boolean*/ {\n return draggable.props.axis === 'both' || draggable.props.axis === 'y';\n}\n\n// Get {x, y} positions from event.\nfunction getControlPosition(e /*: MouseTouchEvent*/, touchIdentifier /*: ?number*/, draggableCore /*: DraggableCore*/) /*: ?ControlPosition*/ {\n var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;\n if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch\n var node = findDOMNode(draggableCore);\n // User can provide an offsetParent if desired.\n var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;\n return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent);\n}\n\n// Create an data object exposed by 's events\nfunction createCoreData(draggable /*: DraggableCore*/, x /*: number*/, y /*: number*/) /*: DraggableData*/ {\n var state = draggable.state;\n var isStart = !(0, _shims.isNum)(state.lastX);\n var node = findDOMNode(draggable);\n\n if (isStart) {\n // If this is our first move, use the x and y as last coords.\n return {\n node: node,\n deltaX: 0, deltaY: 0,\n lastX: x, lastY: y,\n x: x, y: y\n };\n } else {\n // Otherwise calculate proper values.\n return {\n node: node,\n deltaX: x - state.lastX, deltaY: y - state.lastY,\n lastX: state.lastX, lastY: state.lastY,\n x: x, y: y\n };\n }\n}\n\n// Create an data exposed by 's events\nfunction createDraggableData(draggable /*: Draggable*/, coreData /*: DraggableData*/) /*: DraggableData*/ {\n return {\n node: coreData.node,\n x: draggable.state.x + coreData.deltaX,\n y: draggable.state.y + coreData.deltaY,\n deltaX: coreData.deltaX,\n deltaY: coreData.deltaY,\n lastX: draggable.state.x,\n lastY: draggable.state.y\n };\n}\n\n// A lot faster than stringify/parse\nfunction cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}\n\nfunction findDOMNode(draggable /*: Draggable | DraggableCore*/) /*: HTMLElement*/ {\n var node = _reactDom2.default.findDOMNode(draggable);\n if (!node) {\n throw new Error(': Unmounted during event!');\n }\n // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME\n return node;\n}\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(6);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(7);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = __webpack_require__(4);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _domFns = __webpack_require__(5);\n\nvar _positionFns = __webpack_require__(9);\n\nvar _shims = __webpack_require__(0);\n\nvar _log = __webpack_require__(11);\n\nvar _log2 = _interopRequireDefault(_log);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/*:: import type {EventHandler, MouseTouchEvent} from './utils/types';*/\n\n\n// Simple abstraction for dragging events names.\n/*:: import type {Element as ReactElement} from 'react';*/\nvar eventsFor = {\n touch: {\n start: 'touchstart',\n move: 'touchmove',\n stop: 'touchend'\n },\n mouse: {\n start: 'mousedown',\n move: 'mousemove',\n stop: 'mouseup'\n }\n};\n\n// Default to mouse events.\nvar dragEventFor = eventsFor.mouse;\n\n/*:: type DraggableCoreState = {\n dragging: boolean,\n lastX: number,\n lastY: number,\n touchIdentifier: ?number\n};*/\n/*:: export type DraggableBounds = {\n left: number,\n right: number,\n top: number,\n bottom: number,\n};*/\n/*:: export type DraggableData = {\n node: HTMLElement,\n x: number, y: number,\n deltaX: number, deltaY: number,\n lastX: number, lastY: number,\n};*/\n/*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void;*/\n/*:: export type ControlPosition = {x: number, y: number};*/\n\n\n//\n// Define .\n//\n// is for advanced usage of . It maintains minimal internal state so it can\n// work well with libraries that require more control over the element.\n//\n\n/*:: export type DraggableCoreProps = {\n allowAnyClick: boolean,\n cancel: string,\n children: ReactElement,\n disabled: boolean,\n enableUserSelectHack: boolean,\n offsetParent: HTMLElement,\n grid: [number, number],\n handle: string,\n onStart: DraggableEventHandler,\n onDrag: DraggableEventHandler,\n onStop: DraggableEventHandler,\n onMouseDown: (e: MouseEvent) => void,\n};*/\n\nvar DraggableCore = function (_React$Component) {\n _inherits(DraggableCore, _React$Component);\n\n function DraggableCore() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, DraggableCore);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DraggableCore.__proto__ || Object.getPrototypeOf(DraggableCore)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n dragging: false,\n // Used while dragging to determine deltas.\n lastX: NaN, lastY: NaN,\n touchIdentifier: null\n }, _this.handleDragStart = function (e) {\n // Make it possible to attach event handlers on top of this one.\n _this.props.onMouseDown(e);\n\n // Only accept left-clicks.\n if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false;\n\n // Get nodes. Be sure to grab relative document (could be iframed)\n var thisNode = _reactDom2.default.findDOMNode(_this);\n if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {\n throw new Error(' not mounted on DragStart!');\n }\n var ownerDocument = thisNode.ownerDocument;\n\n // Short circuit if handle or cancel prop was provided and selector doesn't match.\n\n if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) {\n return;\n }\n\n // Set touch identifier in component state if this is a touch event. This allows us to\n // distinguish between individual touches on multitouch screens by identifying which\n // touchpoint was set to this element.\n var touchIdentifier = (0, _domFns.getTouchIdentifier)(e);\n _this.setState({ touchIdentifier: touchIdentifier });\n\n // Get the current drag point from the event. This is used as the offset.\n var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _this);\n if (position == null) return; // not possible but satisfies flow\n var x = position.x,\n y = position.y;\n\n // Create an event object with all the data parents need to make a decision here.\n\n var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);\n\n (0, _log2.default)('DraggableCore: handleDragStart: %j', coreEvent);\n\n // Call event handler. If it returns explicit false, cancel.\n (0, _log2.default)('calling', _this.props.onStart);\n var shouldUpdate = _this.props.onStart(e, coreEvent);\n if (shouldUpdate === false) return;\n\n // Add a style to the body to disable user-select. This prevents text from\n // being selected all over the page.\n if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument);\n\n // Initiate dragging. Set the current x and y as offsets\n // so we know how much we've moved during the drag. This allows us\n // to drag elements around even if they have been moved, without issue.\n _this.setState({\n dragging: true,\n\n lastX: x,\n lastY: y\n });\n\n // Add events to the document directly so we catch when the user's mouse/touch moves outside of\n // this element. We use different events depending on whether or not we have detected that this\n // is a touch-capable device.\n (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);\n (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);\n }, _this.handleDrag = function (e) {\n\n // Prevent scrolling on mobile devices, like ipad/iphone.\n if (e.type === 'touchmove') e.preventDefault();\n\n // Get the current drag point from the event. This is used as the offset.\n var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _this);\n if (position == null) return;\n var x = position.x,\n y = position.y;\n\n // Snap to grid if prop has been provided\n\n if (Array.isArray(_this.props.grid)) {\n var _deltaX = x - _this.state.lastX,\n _deltaY = y - _this.state.lastY;\n\n var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, _deltaX, _deltaY);\n\n var _snapToGrid2 = _slicedToArray(_snapToGrid, 2);\n\n _deltaX = _snapToGrid2[0];\n _deltaY = _snapToGrid2[1];\n\n if (!_deltaX && !_deltaY) return; // skip useless drag\n x = _this.state.lastX + _deltaX, y = _this.state.lastY + _deltaY;\n }\n\n var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);\n\n (0, _log2.default)('DraggableCore: handleDrag: %j', coreEvent);\n\n // Call event handler. If it returns explicit false, trigger end.\n var shouldUpdate = _this.props.onDrag(e, coreEvent);\n if (shouldUpdate === false) {\n try {\n // $FlowIgnore\n _this.handleDragStop(new MouseEvent('mouseup'));\n } catch (err) {\n // Old browsers\n var event = ((document.createEvent('MouseEvents') /*: any*/) /*: MouseTouchEvent*/);\n // I see why this insanity was deprecated\n // $FlowIgnore\n event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n _this.handleDragStop(event);\n }\n return;\n }\n\n _this.setState({\n lastX: x,\n lastY: y\n });\n }, _this.handleDragStop = function (e) {\n if (!_this.state.dragging) return;\n\n var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _this);\n if (position == null) return;\n var x = position.x,\n y = position.y;\n\n var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);\n\n var thisNode = _reactDom2.default.findDOMNode(_this);\n if (thisNode) {\n // Remove user-select hack\n if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);\n }\n\n (0, _log2.default)('DraggableCore: handleDragStop: %j', coreEvent);\n\n // Reset the el.\n _this.setState({\n dragging: false,\n lastX: NaN,\n lastY: NaN\n });\n\n // Call event handler\n _this.props.onStop(e, coreEvent);\n\n if (thisNode) {\n // Remove event handlers\n (0, _log2.default)('DraggableCore: Removing handlers');\n (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);\n (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);\n }\n }, _this.onMouseDown = function (e) {\n dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse\n\n return _this.handleDragStart(e);\n }, _this.onMouseUp = function (e) {\n dragEventFor = eventsFor.mouse;\n\n return _this.handleDragStop(e);\n }, _this.onTouchStart = function (e) {\n // We're on a touch device now, so change the event handlers\n dragEventFor = eventsFor.touch;\n\n return _this.handleDragStart(e);\n }, _this.onTouchEnd = function (e) {\n // We're on a touch device now, so change the event handlers\n dragEventFor = eventsFor.touch;\n\n return _this.handleDragStop(e);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(DraggableCore, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n // Remove any leftover event handlers. Remove both touch and mouse handlers in case\n // some browser quirk caused a touch event to fire during a mouse move, or vice versa.\n var thisNode = _reactDom2.default.findDOMNode(this);\n if (thisNode) {\n var ownerDocument = thisNode.ownerDocument;\n\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);\n (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);\n if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument);\n }\n }\n\n // Same as onMouseDown (start drag), but now consider this a touch device.\n\n }, {\n key: 'render',\n value: function render() {\n // Reuse the child provided\n // This makes it flexible to use whatever element is wanted (div, ul, etc)\n return _react2.default.cloneElement(_react2.default.Children.only(this.props.children), {\n style: (0, _domFns.styleHacks)(this.props.children.props.style),\n\n // Note: mouseMove handler is attached to document so it will still function\n // when the user drags quickly and leaves the bounds of the element.\n onMouseDown: this.onMouseDown,\n onTouchStart: this.onTouchStart,\n onMouseUp: this.onMouseUp,\n onTouchEnd: this.onTouchEnd\n });\n }\n }]);\n\n return DraggableCore;\n}(_react2.default.Component);\n\nDraggableCore.displayName = 'DraggableCore';\nDraggableCore.propTypes = {\n /**\n * `allowAnyClick` allows dragging using any mouse button.\n * By default, we only accept the left button.\n *\n * Defaults to `false`.\n */\n allowAnyClick: _propTypes2.default.bool,\n\n /**\n * `disabled`, if true, stops the from dragging. All handlers,\n * with the exception of `onMouseDown`, will not fire.\n */\n disabled: _propTypes2.default.bool,\n\n /**\n * By default, we add 'user-select:none' attributes to the document body\n * to prevent ugly text selection during drag. If this is causing problems\n * for your app, set this to `false`.\n */\n enableUserSelectHack: _propTypes2.default.bool,\n\n /**\n * `offsetParent`, if set, uses the passed DOM node to compute drag offsets\n * instead of using the parent node.\n */\n offsetParent: function offsetParent(props /*: DraggableCoreProps*/, propName /*: $Keys*/) {\n if (process.browser === true && props[propName] && props[propName].nodeType !== 1) {\n throw new Error('Draggable\\'s offsetParent must be a DOM Node.');\n }\n },\n\n /**\n * `grid` specifies the x and y that dragging should snap to.\n */\n grid: _propTypes2.default.arrayOf(_propTypes2.default.number),\n\n /**\n * `handle` specifies a selector to be used as the handle that initiates drag.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
\n *
Click me to drag
\n *
This is some other content
\n *
\n *
\n * );\n * }\n * });\n * ```\n */\n handle: _propTypes2.default.string,\n\n /**\n * `cancel` specifies a selector to be used to prevent drag initialization.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return(\n * \n *
\n *
You can't drag from here
\n *
Dragging here works fine
\n *
\n *
\n * );\n * }\n * });\n * ```\n */\n cancel: _propTypes2.default.string,\n\n /**\n * Called when dragging starts.\n * If this function returns the boolean false, dragging will be canceled.\n */\n onStart: _propTypes2.default.func,\n\n /**\n * Called while dragging.\n * If this function returns the boolean false, dragging will be canceled.\n */\n onDrag: _propTypes2.default.func,\n\n /**\n * Called when dragging stops.\n * If this function returns the boolean false, the drag will remain active.\n */\n onStop: _propTypes2.default.func,\n\n /**\n * A workaround option which can be passed if onMouseDown needs to be accessed,\n * since it'll always be blocked (as there is internal use of onMouseDown)\n */\n onMouseDown: _propTypes2.default.func,\n\n /**\n * These properties should be defined on the child, not here.\n */\n className: _shims.dontSetMe,\n style: _shims.dontSetMe,\n transform: _shims.dontSetMe\n};\nDraggableCore.defaultProps = {\n allowAnyClick: false, // by default only accept left click\n cancel: null,\n disabled: false,\n enableUserSelectHack: true,\n offsetParent: null,\n handle: null,\n grid: null,\n transform: null,\n onStart: function onStart() {},\n onDrag: function onDrag() {},\n onStop: function onStop() {},\n onMouseDown: function onMouseDown() {}\n};\nexports.default = DraggableCore;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = log;\n\n/*eslint no-console:0*/\nfunction log() {\n var _console;\n\n if (undefined) (_console = console).log.apply(_console, arguments);\n}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar Draggable = __webpack_require__(13).default;\n\n// Previous versions of this lib exported as the root export. As to not break\n// them, or TypeScript, we export *both* as the root and as 'default'.\n// See https://github.com/mzabriskie/react-draggable/pull/254\n// and https://github.com/mzabriskie/react-draggable/issues/266\nmodule.exports = Draggable;\nmodule.exports.default = Draggable;\nmodule.exports.DraggableCore = __webpack_require__(10).default;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(6);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(7);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = __webpack_require__(4);\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _classnames = __webpack_require__(18);\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _domFns = __webpack_require__(5);\n\nvar _positionFns = __webpack_require__(9);\n\nvar _shims = __webpack_require__(0);\n\nvar _DraggableCore = __webpack_require__(10);\n\nvar _DraggableCore2 = _interopRequireDefault(_DraggableCore);\n\nvar _log = __webpack_require__(11);\n\nvar _log2 = _interopRequireDefault(_log);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/*:: import type {ControlPosition, DraggableBounds, DraggableCoreProps} from './DraggableCore';*/\n/*:: import type {DraggableEventHandler} from './utils/types';*/\n/*:: import type {Element as ReactElement} from 'react';*/\n/*:: type DraggableState = {\n dragging: boolean,\n dragged: boolean,\n x: number, y: number,\n slackX: number, slackY: number,\n isElementSVG: boolean\n};*/\n\n\n//\n// Define \n//\n\n/*:: export type DraggableProps = {\n ...$Exact,\n axis: 'both' | 'x' | 'y' | 'none',\n bounds: DraggableBounds | string | false,\n defaultClassName: string,\n defaultClassNameDragging: string,\n defaultClassNameDragged: string,\n defaultPosition: ControlPosition,\n position: ControlPosition,\n};*/\n\nvar Draggable = function (_React$Component) {\n _inherits(Draggable, _React$Component);\n\n function Draggable(props /*: DraggableProps*/) {\n _classCallCheck(this, Draggable);\n\n var _this = _possibleConstructorReturn(this, (Draggable.__proto__ || Object.getPrototypeOf(Draggable)).call(this, props));\n\n _this.onDragStart = function (e, coreData) {\n (0, _log2.default)('Draggable: onDragStart: %j', coreData);\n\n // Short-circuit if user's callback killed it.\n var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_this, coreData));\n // Kills start event on core as well, so move handlers are never bound.\n if (shouldStart === false) return false;\n\n _this.setState({ dragging: true, dragged: true });\n };\n\n _this.onDrag = function (e, coreData) {\n if (!_this.state.dragging) return false;\n (0, _log2.default)('Draggable: onDrag: %j', coreData);\n\n var uiData = (0, _positionFns.createDraggableData)(_this, coreData);\n\n var newState /*: $Shape*/ = {\n x: uiData.x,\n y: uiData.y\n };\n\n // Keep within bounds.\n if (_this.props.bounds) {\n // Save original x and y.\n var _x = newState.x,\n _y = newState.y;\n\n // Add slack to the values used to calculate bound position. This will ensure that if\n // we start removing slack, the element won't react to it right away until it's been\n // completely removed.\n\n newState.x += _this.state.slackX;\n newState.y += _this.state.slackY;\n\n // Get bound position. This will ceil/floor the x and y within the boundaries.\n\n var _getBoundPosition = (0, _positionFns.getBoundPosition)(_this, newState.x, newState.y),\n _getBoundPosition2 = _slicedToArray(_getBoundPosition, 2),\n newStateX = _getBoundPosition2[0],\n newStateY = _getBoundPosition2[1];\n\n newState.x = newStateX;\n newState.y = newStateY;\n\n // Recalculate slack by noting how much was shaved by the boundPosition handler.\n newState.slackX = _this.state.slackX + (_x - newState.x);\n newState.slackY = _this.state.slackY + (_y - newState.y);\n\n // Update the event we fire to reflect what really happened after bounds took effect.\n uiData.x = newState.x;\n uiData.y = newState.y;\n uiData.deltaX = newState.x - _this.state.x;\n uiData.deltaY = newState.y - _this.state.y;\n }\n\n // Short-circuit if user's callback killed it.\n var shouldUpdate = _this.props.onDrag(e, uiData);\n if (shouldUpdate === false) return false;\n\n _this.setState(newState);\n };\n\n _this.onDragStop = function (e, coreData) {\n if (!_this.state.dragging) return false;\n\n // Short-circuit if user's callback killed it.\n var shouldStop = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_this, coreData));\n if (shouldStop === false) return false;\n\n (0, _log2.default)('Draggable: onDragStop: %j', coreData);\n\n var newState /*: $Shape*/ = {\n dragging: false,\n slackX: 0,\n slackY: 0\n };\n\n // If this is a controlled component, the result of this operation will be to\n // revert back to the old position. We expect a handler on `onDragStop`, at the least.\n var controlled = Boolean(_this.props.position);\n if (controlled) {\n var _this$props$position = _this.props.position,\n _x2 = _this$props$position.x,\n _y2 = _this$props$position.y;\n\n newState.x = _x2;\n newState.y = _y2;\n }\n\n _this.setState(newState);\n };\n\n _this.state = {\n // Whether or not we are currently dragging.\n dragging: false,\n\n // Whether or not we have been dragged before.\n dragged: false,\n\n // Current transform x and y.\n x: props.position ? props.position.x : props.defaultPosition.x,\n y: props.position ? props.position.y : props.defaultPosition.y,\n\n // Used for compensating for out-of-bounds drags\n slackX: 0, slackY: 0,\n\n // Can only determine if SVG after mounting\n isElementSVG: false\n };\n return _this;\n }\n\n _createClass(Draggable, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n if (this.props.position && !(this.props.onDrag || this.props.onStop)) {\n // eslint-disable-next-line\n console.warn('A `position` was applied to this , without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.');\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n // Check to see if the element passed is an instanceof SVGElement\n if (typeof window.SVGElement !== 'undefined' && _reactDom2.default.findDOMNode(this) instanceof window.SVGElement) {\n this.setState({ isElementSVG: true });\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps /*: Object*/) {\n // Set x/y if position has changed\n if (nextProps.position && (!this.props.position || nextProps.position.x !== this.props.position.x || nextProps.position.y !== this.props.position.y)) {\n this.setState({ x: nextProps.position.x, y: nextProps.position.y });\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.setState({ dragging: false }); // prevents invariant if unmounted while dragging\n }\n }, {\n key: 'render',\n value: function render() /*: ReactElement*/ {\n var _classNames;\n\n var style = {},\n svgTransform = null;\n\n // If this is controlled, we don't want to move it - unless it's dragging.\n var controlled = Boolean(this.props.position);\n var draggable = !controlled || this.state.dragging;\n\n var position = this.props.position || this.props.defaultPosition;\n var transformOpts = {\n // Set left if horizontal drag is enabled\n x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : position.x,\n\n // Set top if vertical drag is enabled\n y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : position.y\n };\n\n // If this element was SVG, we use the `transform` attribute.\n if (this.state.isElementSVG) {\n svgTransform = (0, _domFns.createSVGTransform)(transformOpts);\n } else {\n // Add a CSS transform to move the element around. This allows us to move the element around\n // without worrying about whether or not it is relatively or absolutely positioned.\n // If the item you are dragging already has a transform set, wrap it in a so \n // has a clean slate.\n style = (0, _domFns.createCSSTransform)(transformOpts);\n }\n\n var _props = this.props,\n defaultClassName = _props.defaultClassName,\n defaultClassNameDragging = _props.defaultClassNameDragging,\n defaultClassNameDragged = _props.defaultClassNameDragged;\n\n\n var children = _react2.default.Children.only(this.props.children);\n\n // Mark with class while dragging\n var className = (0, _classnames2.default)(children.props.className || '', defaultClassName, (_classNames = {}, _defineProperty(_classNames, defaultClassNameDragging, this.state.dragging), _defineProperty(_classNames, defaultClassNameDragged, this.state.dragged), _classNames));\n\n // Reuse the child provided\n // This makes it flexible to use whatever element is wanted (div, ul, etc)\n return _react2.default.createElement(\n _DraggableCore2.default,\n _extends({}, this.props, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }),\n _react2.default.cloneElement(children, {\n className: className,\n style: _extends({}, children.props.style, style),\n transform: svgTransform\n })\n );\n }\n }]);\n\n return Draggable;\n}(_react2.default.Component);\n\nDraggable.displayName = 'Draggable';\nDraggable.propTypes = _extends({}, _DraggableCore2.default.propTypes, {\n\n /**\n * `axis` determines which axis the draggable can move.\n *\n * Note that all callbacks will still return data as normal. This only\n * controls flushing to the DOM.\n *\n * 'both' allows movement horizontally and vertically.\n * 'x' limits movement to horizontal axis.\n * 'y' limits movement to vertical axis.\n * 'none' limits all movement.\n *\n * Defaults to 'both'.\n */\n axis: _propTypes2.default.oneOf(['both', 'x', 'y', 'none']),\n\n /**\n * `bounds` determines the range of movement available to the element.\n * Available values are:\n *\n * 'parent' restricts movement within the Draggable's parent node.\n *\n * Alternatively, pass an object with the following properties, all of which are optional:\n *\n * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}\n *\n * All values are in px.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
Content
\n *
\n * );\n * }\n * });\n * ```\n */\n bounds: _propTypes2.default.oneOfType([_propTypes2.default.shape({\n left: _propTypes2.default.number,\n right: _propTypes2.default.number,\n top: _propTypes2.default.number,\n bottom: _propTypes2.default.number\n }), _propTypes2.default.string, _propTypes2.default.oneOf([false])]),\n\n defaultClassName: _propTypes2.default.string,\n defaultClassNameDragging: _propTypes2.default.string,\n defaultClassNameDragged: _propTypes2.default.string,\n\n /**\n * `defaultPosition` specifies the x and y that the dragged item should start at\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
I start with transformX: 25px and transformY: 25px;
\n *
\n * );\n * }\n * });\n * ```\n */\n defaultPosition: _propTypes2.default.shape({\n x: _propTypes2.default.number,\n y: _propTypes2.default.number\n }),\n\n /**\n * `position`, if present, defines the current position of the element.\n *\n * This is similar to how form elements in React work - if no `position` is supplied, the component\n * is uncontrolled.\n *\n * Example:\n *\n * ```jsx\n * let App = React.createClass({\n * render: function () {\n * return (\n * \n *
I start with transformX: 25px and transformY: 25px;
\n *
\n * );\n * }\n * });\n * ```\n */\n position: _propTypes2.default.shape({\n x: _propTypes2.default.number,\n y: _propTypes2.default.number\n }),\n\n /**\n * These properties should be defined on the child, not here.\n */\n className: _shims.dontSetMe,\n style: _shims.dontSetMe,\n transform: _shims.dontSetMe\n});\nDraggable.defaultProps = _extends({}, _DraggableCore2.default.defaultProps, {\n axis: 'both',\n bounds: false,\n defaultClassName: 'react-draggable',\n defaultClassNameDragging: 'react-draggable-dragging',\n defaultClassNameDragged: 'react-draggable-dragged',\n defaultPosition: { x: 0, y: 0 },\n position: null\n});\nexports.default = Draggable;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(1);\nvar invariant = __webpack_require__(2);\nvar warning = __webpack_require__(8);\nvar assign = __webpack_require__(15);\n\nvar ReactPropTypesSecret = __webpack_require__(3);\nvar checkPropTypes = __webpack_require__(16);\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n warning(\n false,\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received %s at index %s.',\n getPostfixForTypeWarning(checker),\n i\n );\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n var invariant = __webpack_require__(2);\n var warning = __webpack_require__(8);\n var ReactPropTypesSecret = __webpack_require__(3);\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (Object({\"DRAGGABLE_DEBUG\":undefined}).NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(1);\nvar invariant = __webpack_require__(2);\nvar ReactPropTypesSecret = __webpack_require__(3);\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t\t\treturn classNames;\n\t\t}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getPrefix = getPrefix;\nexports.browserPrefixToKey = browserPrefixToKey;\nexports.browserPrefixToStyle = browserPrefixToStyle;\nvar prefixes = ['Moz', 'Webkit', 'O', 'ms'];\nfunction getPrefix() /*: string*/ {\n var prop /*: string*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';\n\n // Checking specifically for 'window.document' is for pseudo-browser server-side\n // environments that define 'window' as the global context.\n // E.g. React-rails (see https://github.com/reactjs/react-rails/pull/84)\n if (typeof window === 'undefined' || typeof window.document === 'undefined') return '';\n\n var style = window.document.documentElement.style;\n\n if (prop in style) return '';\n\n for (var i = 0; i < prefixes.length; i++) {\n if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];\n }\n\n return '';\n}\n\nfunction browserPrefixToKey(prop /*: string*/, prefix /*: string*/) /*: string*/ {\n return prefix ? '' + prefix + kebabToTitleCase(prop) : prop;\n}\n\nfunction browserPrefixToStyle(prop /*: string*/, prefix /*: string*/) /*: string*/ {\n return prefix ? '-' + prefix.toLowerCase() + '-' + prop : prop;\n}\n\nfunction kebabToTitleCase(str /*: string*/) /*: string*/ {\n var out = '';\n var shouldCapitalize = true;\n for (var i = 0; i < str.length; i++) {\n if (shouldCapitalize) {\n out += str[i].toUpperCase();\n shouldCapitalize = false;\n } else if (str[i] === '-') {\n shouldCapitalize = true;\n } else {\n out += str[i];\n }\n }\n return out;\n}\n\n// Default export is the prefix itself, like 'Moz', 'Webkit', etc\n// Note that you may have to re-test for certain things; for instance, Chrome 50\n// can handle unprefixed `transform`, but not unprefixed `user-select`\nexports.default = getPrefix();\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=react-draggable.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/react-draggable/dist/react-draggable.js\n// module id = 6\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_7__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"react-dom\",\"commonjs2\":\"react-dom\",\"amd\":\"react-dom\",\"root\":\"ReactDOM\"}\n// module id = 7\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDraggable = require('react-draggable');\n\nvar _cloneElement = require('./cloneElement');\n\nvar _cloneElement2 = _interopRequireDefault(_cloneElement);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Resizable = function (_React$Component) {\n _inherits(Resizable, _React$Component);\n\n function Resizable() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Resizable);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n resizing: false,\n width: _this.props.width, height: _this.props.height,\n slackW: 0, slackH: 0\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Resizable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n // If parent changes height/width, set that in our state.\n if (!this.state.resizing && (nextProps.width !== this.props.width || nextProps.height !== this.props.height)) {\n this.setState({\n width: nextProps.width,\n height: nextProps.height\n });\n }\n };\n\n Resizable.prototype.lockAspectRatio = function lockAspectRatio(width, height, aspectRatio) {\n height = width / aspectRatio;\n width = height * aspectRatio;\n return [width, height];\n };\n\n // If you do this, be careful of constraints\n\n\n Resizable.prototype.runConstraints = function runConstraints(width, height) {\n var _ref = [this.props.minConstraints, this.props.maxConstraints],\n min = _ref[0],\n max = _ref[1];\n\n\n if (this.props.lockAspectRatio) {\n var ratio = this.state.width / this.state.height;\n height = width / ratio;\n width = height * ratio;\n }\n\n if (!min && !max) return [width, height];\n\n var oldW = width,\n oldH = height;\n\n // Add slack to the values used to calculate bound position. This will ensure that if\n // we start removing slack, the element won't react to it right away until it's been\n // completely removed.\n\n var _state = this.state,\n slackW = _state.slackW,\n slackH = _state.slackH;\n\n width += slackW;\n height += slackH;\n\n if (min) {\n width = Math.max(min[0], width);\n height = Math.max(min[1], height);\n }\n if (max) {\n width = Math.min(max[0], width);\n height = Math.min(max[1], height);\n }\n\n // If the numbers changed, we must have introduced some slack. Record it for the next iteration.\n slackW += oldW - width;\n slackH += oldH - height;\n if (slackW !== this.state.slackW || slackH !== this.state.slackH) {\n this.setState({ slackW: slackW, slackH: slackH });\n }\n\n return [width, height];\n };\n\n /**\n * Wrapper around drag events to provide more useful data.\n *\n * @param {String} handlerName Handler name to wrap.\n * @return {Function} Handler function.\n */\n\n\n Resizable.prototype.resizeHandler = function resizeHandler(handlerName) {\n var _this2 = this;\n\n return function (e, _ref2) {\n var node = _ref2.node,\n deltaX = _ref2.deltaX,\n deltaY = _ref2.deltaY;\n\n\n // Axis restrictions\n var canDragX = _this2.props.axis === 'both' || _this2.props.axis === 'x';\n var canDragY = _this2.props.axis === 'both' || _this2.props.axis === 'y';\n\n // Update w/h\n var width = _this2.state.width + (canDragX ? deltaX : 0);\n var height = _this2.state.height + (canDragY ? deltaY : 0);\n\n // Early return if no change\n var widthChanged = width !== _this2.state.width,\n heightChanged = height !== _this2.state.height;\n if (handlerName === 'onResize' && !widthChanged && !heightChanged) return;\n\n // Set the appropriate state for this handler.\n var _runConstraints = _this2.runConstraints(width, height);\n\n width = _runConstraints[0];\n height = _runConstraints[1];\n var newState = {};\n if (handlerName === 'onResizeStart') {\n newState.resizing = true;\n } else if (handlerName === 'onResizeStop') {\n newState.resizing = false;\n newState.slackW = newState.slackH = 0;\n } else {\n // Early return if no change after constraints\n if (width === _this2.state.width && height === _this2.state.height) return;\n newState.width = width;\n newState.height = height;\n }\n\n var hasCb = typeof _this2.props[handlerName] === 'function';\n if (hasCb) {\n if (typeof e.persist === 'function') e.persist();\n _this2.setState(newState, function () {\n return _this2.props[handlerName](e, { node: node, size: { width: width, height: height } });\n });\n } else {\n _this2.setState(newState);\n }\n };\n };\n\n Resizable.prototype.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _props = this.props,\n children = _props.children,\n draggableOpts = _props.draggableOpts,\n width = _props.width,\n height = _props.height,\n handleSize = _props.handleSize,\n lockAspectRatio = _props.lockAspectRatio,\n axis = _props.axis,\n minConstraints = _props.minConstraints,\n maxConstraints = _props.maxConstraints,\n onResize = _props.onResize,\n onResizeStop = _props.onResizeStop,\n onResizeStart = _props.onResizeStart,\n p = _objectWithoutProperties(_props, ['children', 'draggableOpts', 'width', 'height', 'handleSize', 'lockAspectRatio', 'axis', 'minConstraints', 'maxConstraints', 'onResize', 'onResizeStop', 'onResizeStart']);\n\n var className = p.className ? p.className + ' react-resizable' : 'react-resizable';\n\n // What we're doing here is getting the child of this element, and cloning it with this element's props.\n // We are then defining its children as:\n // Its original children (resizable's child's children), and\n // A draggable handle.\n return (0, _cloneElement2.default)(children, _extends({}, p, {\n className: className,\n children: [children.props.children, _react2.default.createElement(\n _reactDraggable.DraggableCore,\n _extends({}, draggableOpts, {\n key: 'resizableHandle',\n onStop: this.resizeHandler('onResizeStop'),\n onStart: this.resizeHandler('onResizeStart'),\n onDrag: this.resizeHandler('onResize')\n }),\n _react2.default.createElement('span', { className: 'react-resizable-handle' })\n )]\n }));\n };\n\n return Resizable;\n}(_react2.default.Component);\n\nResizable.propTypes = {\n //\n // Required Props\n //\n\n // Require that one and only one child be present.\n children: _propTypes2.default.element.isRequired,\n\n // Initial w/h\n width: _propTypes2.default.number.isRequired,\n height: _propTypes2.default.number.isRequired,\n\n //\n // Optional props\n //\n\n // If you change this, be sure to update your css\n handleSize: _propTypes2.default.array,\n\n // If true, will only allow width/height to move in lockstep\n lockAspectRatio: _propTypes2.default.bool,\n\n // Restricts resizing to a particular axis (default: 'both')\n // 'both' - allows resizing by width or height\n // 'x' - only allows the width to be changed\n // 'y' - only allows the height to be changed\n // 'none' - disables resizing altogether\n axis: _propTypes2.default.oneOf(['both', 'x', 'y', 'none']),\n\n // Min/max size\n minConstraints: _propTypes2.default.arrayOf(_propTypes2.default.number),\n maxConstraints: _propTypes2.default.arrayOf(_propTypes2.default.number),\n\n // Callbacks\n onResizeStop: _propTypes2.default.func,\n onResizeStart: _propTypes2.default.func,\n onResize: _propTypes2.default.func,\n\n // These will be passed wholesale to react-draggable's DraggableCore\n draggableOpts: _propTypes2.default.object\n};\nResizable.defaultProps = {\n handleSize: [20, 20],\n lockAspectRatio: false,\n axis: 'both',\n minConstraints: [20, 20],\n maxConstraints: [Infinity, Infinity]\n};\nexports.default = Resizable;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/react-resizable/build/Resizable.js\n// module id = 8\n// module chunks = 0","// @flow\n\nimport { cloneLayout, compact, correctBounds } from \"./utils\";\n\nimport type { CompactType, Layout } from \"./utils\";\n\nexport type ResponsiveLayout = {\n lg?: Layout,\n md?: Layout,\n sm?: Layout,\n xs?: Layout,\n xxs?: Layout\n};\n\ntype Breakpoint = string;\n\ntype Breakpoints = {\n lg?: number,\n md?: number,\n sm?: number,\n xs?: number,\n xxs?: number\n};\n\n/**\n * Given a width, find the highest breakpoint that matches is valid for it (width > breakpoint).\n *\n * @param {Object} breakpoints Breakpoints object (e.g. {lg: 1200, md: 960, ...})\n * @param {Number} width Screen width.\n * @return {String} Highest breakpoint that is less than width.\n */\nexport function getBreakpointFromWidth(\n breakpoints: Breakpoints,\n width: number\n): Breakpoint {\n const sorted = sortBreakpoints(breakpoints);\n let matching = sorted[0];\n for (let i = 1, len = sorted.length; i < len; i++) {\n const breakpointName = sorted[i];\n if (width > breakpoints[breakpointName]) matching = breakpointName;\n }\n return matching;\n}\n\n/**\n * Given a breakpoint, get the # of cols set for it.\n * @param {String} breakpoint Breakpoint name.\n * @param {Object} cols Map of breakpoints to cols.\n * @return {Number} Number of cols.\n */\nexport function getColsFromBreakpoint(\n breakpoint: Breakpoint,\n cols: Breakpoints\n): number {\n if (!cols[breakpoint]) {\n throw new Error(\n \"ResponsiveReactGridLayout: `cols` entry for breakpoint \" +\n breakpoint +\n \" is missing!\"\n );\n }\n return cols[breakpoint];\n}\n\n/**\n * Given existing layouts and a new breakpoint, find or generate a new layout.\n *\n * This finds the layout above the new one and generates from it, if it exists.\n *\n * @param {Object} layouts Existing layouts.\n * @param {Array} breakpoints All breakpoints.\n * @param {String} breakpoint New breakpoint.\n * @param {String} breakpoint Last breakpoint (for fallback).\n * @param {Number} cols Column count at new breakpoint.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} New layout.\n */\nexport function findOrGenerateResponsiveLayout(\n layouts: ResponsiveLayout,\n breakpoints: Breakpoints,\n breakpoint: Breakpoint,\n lastBreakpoint: Breakpoint,\n cols: number,\n compactType: CompactType\n): Layout {\n // If it already exists, just return it.\n if (layouts[breakpoint]) return cloneLayout(layouts[breakpoint]);\n // Find or generate the next layout\n let layout = layouts[lastBreakpoint];\n const breakpointsSorted = sortBreakpoints(breakpoints);\n const breakpointsAbove = breakpointsSorted.slice(\n breakpointsSorted.indexOf(breakpoint)\n );\n for (let i = 0, len = breakpointsAbove.length; i < len; i++) {\n const b = breakpointsAbove[i];\n if (layouts[b]) {\n layout = layouts[b];\n break;\n }\n }\n layout = cloneLayout(layout || []); // clone layout so we don't modify existing items\n return compact(correctBounds(layout, { cols: cols }), compactType, cols);\n}\n\n/**\n * Given breakpoints, return an array of breakpoints sorted by width. This is usually\n * e.g. ['xxs', 'xs', 'sm', ...]\n *\n * @param {Object} breakpoints Key/value pair of breakpoint names to widths.\n * @return {Array} Sorted breakpoints.\n */\nexport function sortBreakpoints(breakpoints: Breakpoints): Array {\n const keys: Array = Object.keys(breakpoints);\n return keys.sort(function(a, b) {\n return breakpoints[a] - breakpoints[b];\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/responsiveUtils.js","module.exports = require('./lib/ReactGridLayout').default;\nmodule.exports.utils = require('./lib/utils');\nmodule.exports.Responsive = require('./lib/ResponsiveReactGridLayout').default;\nmodule.exports.Responsive.utils = require('./lib/responsiveUtils');\nmodule.exports.WidthProvider = require('./lib/components/WidthProvider').default;\n\n\n\n// WEBPACK FOOTER //\n// ./index-dev.js","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/prop-types/factoryWithThrowingShims.js\n// module id = 11\n// module chunks = 0","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fbjs/lib/emptyFunction.js\n// module id = 12\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fbjs/lib/invariant.js\n// module id = 13\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/prop-types/lib/ReactPropTypesSecret.js\n// module id = 14\n// module chunks = 0","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 15\n// module chunks = 0","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif(!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 16\n// module chunks = 0","// @flow\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { DraggableCore } from \"react-draggable\";\nimport { Resizable } from \"react-resizable\";\nimport { perc, setTopLeft, setTransform } from \"./utils\";\nimport classNames from \"classnames\";\nimport type { Element as ReactElement, Node as ReactNode } from \"react\";\n\nimport type {\n ReactDraggableCallbackData,\n GridDragEvent,\n GridResizeEvent,\n Position\n} from \"./utils\";\n\ntype PartialPosition = { top: number, left: number };\ntype GridItemCallback = (\n i: string,\n w: number,\n h: number,\n Data\n) => void;\n\ntype State = {\n resizing: ?{ width: number, height: number },\n dragging: ?{ top: number, left: number },\n className: string\n};\n\ntype Props = {\n children: ReactElement,\n cols: number,\n containerWidth: number,\n margin: [number, number],\n containerPadding: [number, number],\n rowHeight: number,\n maxRows: number,\n isDraggable: boolean,\n isResizable: boolean,\n static?: boolean,\n useCSSTransforms?: boolean,\n usePercentages?: boolean,\n\n className: string,\n style?: Object,\n // Draggability\n cancel: string,\n handle: string,\n\n x: number,\n y: number,\n w: number,\n h: number,\n\n minW: number,\n maxW: number,\n minH: number,\n maxH: number,\n i: string,\n\n onDrag?: GridItemCallback,\n onDragStart?: GridItemCallback,\n onDragStop?: GridItemCallback,\n onResize?: GridItemCallback,\n onResizeStart?: GridItemCallback,\n onResizeStop?: GridItemCallback\n};\n\n/**\n * An individual item within a ReactGridLayout.\n */\nexport default class GridItem extends React.Component {\n static propTypes = {\n // Children must be only a single element\n children: PropTypes.element,\n\n // General grid attributes\n cols: PropTypes.number.isRequired,\n containerWidth: PropTypes.number.isRequired,\n rowHeight: PropTypes.number.isRequired,\n margin: PropTypes.array.isRequired,\n maxRows: PropTypes.number.isRequired,\n containerPadding: PropTypes.array.isRequired,\n\n // These are all in grid units\n x: PropTypes.number.isRequired,\n y: PropTypes.number.isRequired,\n w: PropTypes.number.isRequired,\n h: PropTypes.number.isRequired,\n\n // All optional\n minW: function(props: Props, propName: string) {\n const value = props[propName];\n if (typeof value !== \"number\") return new Error(\"minWidth not Number\");\n if (value > props.w || value > props.maxW)\n return new Error(\"minWidth larger than item width/maxWidth\");\n },\n\n maxW: function(props: Props, propName: string) {\n const value = props[propName];\n if (typeof value !== \"number\") return new Error(\"maxWidth not Number\");\n if (value < props.w || value < props.minW)\n return new Error(\"maxWidth smaller than item width/minWidth\");\n },\n\n minH: function(props: Props, propName: string) {\n const value = props[propName];\n if (typeof value !== \"number\") return new Error(\"minHeight not Number\");\n if (value > props.h || value > props.maxH)\n return new Error(\"minHeight larger than item height/maxHeight\");\n },\n\n maxH: function(props: Props, propName: string) {\n const value = props[propName];\n if (typeof value !== \"number\") return new Error(\"maxHeight not Number\");\n if (value < props.h || value < props.minH)\n return new Error(\"maxHeight smaller than item height/minHeight\");\n },\n\n // ID is nice to have for callbacks\n i: PropTypes.string.isRequired,\n\n // Functions\n onDragStop: PropTypes.func,\n onDragStart: PropTypes.func,\n onDrag: PropTypes.func,\n onResizeStop: PropTypes.func,\n onResizeStart: PropTypes.func,\n onResize: PropTypes.func,\n\n // Flags\n isDraggable: PropTypes.bool.isRequired,\n isResizable: PropTypes.bool.isRequired,\n static: PropTypes.bool,\n\n // Use CSS transforms instead of top/left\n useCSSTransforms: PropTypes.bool.isRequired,\n\n // Others\n className: PropTypes.string,\n // Selector for draggable handle\n handle: PropTypes.string,\n // Selector for draggable cancel (see react-draggable)\n cancel: PropTypes.string\n };\n\n static defaultProps = {\n className: \"\",\n cancel: \"\",\n handle: \"\",\n minH: 1,\n minW: 1,\n maxH: Infinity,\n maxW: Infinity\n };\n\n state: State = {\n resizing: null,\n dragging: null,\n className: \"\"\n };\n\n // Helper for generating column width\n calcColWidth(): number {\n const { margin, containerPadding, containerWidth, cols } = this.props;\n return (\n (containerWidth - margin[0] * (cols - 1) - containerPadding[0] * 2) / cols\n );\n }\n\n /**\n * Return position on the page given an x, y, w, h.\n * left, top, width, height are all in pixels.\n * @param {Number} x X coordinate in grid units.\n * @param {Number} y Y coordinate in grid units.\n * @param {Number} w W coordinate in grid units.\n * @param {Number} h H coordinate in grid units.\n * @return {Object} Object containing coords.\n */\n calcPosition(\n x: number,\n y: number,\n w: number,\n h: number,\n state: ?Object\n ): Position {\n const { margin, containerPadding, rowHeight } = this.props;\n const colWidth = this.calcColWidth();\n\n const out = {\n left: Math.round((colWidth + margin[0]) * x + containerPadding[0]),\n top: Math.round((rowHeight + margin[1]) * y + containerPadding[1]),\n // 0 * Infinity === NaN, which causes problems with resize constraints;\n // Fix this if it occurs.\n // Note we do it here rather than later because Math.round(Infinity) causes deopt\n width:\n w === Infinity\n ? w\n : Math.round(colWidth * w + Math.max(0, w - 1) * margin[0]),\n height:\n h === Infinity\n ? h\n : Math.round(rowHeight * h + Math.max(0, h - 1) * margin[1])\n };\n\n if (state && state.resizing) {\n out.width = Math.round(state.resizing.width);\n out.height = Math.round(state.resizing.height);\n }\n\n if (state && state.dragging) {\n out.top = Math.round(state.dragging.top);\n out.left = Math.round(state.dragging.left);\n }\n\n return out;\n }\n\n /**\n * Translate x and y coordinates from pixels to grid units.\n * @param {Number} top Top position (relative to parent) in pixels.\n * @param {Number} left Left position (relative to parent) in pixels.\n * @return {Object} x and y in grid units.\n */\n calcXY(top: number, left: number): { x: number, y: number } {\n const { margin, cols, rowHeight, w, h, maxRows } = this.props;\n const colWidth = this.calcColWidth();\n\n // left = colWidth * x + margin * (x + 1)\n // l = cx + m(x+1)\n // l = cx + mx + m\n // l - m = cx + mx\n // l - m = x(c + m)\n // (l - m) / (c + m) = x\n // x = (left - margin) / (coldWidth + margin)\n let x = Math.round((left - margin[0]) / (colWidth + margin[0]));\n let y = Math.round((top - margin[1]) / (rowHeight + margin[1]));\n\n // Capping\n x = Math.max(Math.min(x, cols - w), 0);\n y = Math.max(Math.min(y, maxRows - h), 0);\n\n return { x, y };\n }\n\n /**\n * Given a height and width in pixel values, calculate grid units.\n * @param {Number} height Height in pixels.\n * @param {Number} width Width in pixels.\n * @return {Object} w, h as grid units.\n */\n calcWH({\n height,\n width\n }: {\n height: number,\n width: number\n }): { w: number, h: number } {\n const { margin, maxRows, cols, rowHeight, x, y } = this.props;\n const colWidth = this.calcColWidth();\n\n // width = colWidth * w - (margin * (w - 1))\n // ...\n // w = (width + margin) / (colWidth + margin)\n let w = Math.round((width + margin[0]) / (colWidth + margin[0]));\n let h = Math.round((height + margin[1]) / (rowHeight + margin[1]));\n\n // Capping\n w = Math.max(Math.min(w, cols - x), 0);\n h = Math.max(Math.min(h, maxRows - y), 0);\n return { w, h };\n }\n\n /**\n * This is where we set the grid item's absolute placement. It gets a little tricky because we want to do it\n * well when server rendering, and the only way to do that properly is to use percentage width/left because\n * we don't know exactly what the browser viewport is.\n * Unfortunately, CSS Transforms, which are great for performance, break in this instance because a percentage\n * left is relative to the item itself, not its container! So we cannot use them on the server rendering pass.\n *\n * @param {Object} pos Position object with width, height, left, top.\n * @return {Object} Style object.\n */\n createStyle(pos: Position): { [key: string]: ?string } {\n const { usePercentages, containerWidth, useCSSTransforms } = this.props;\n\n let style;\n // CSS Transforms support (default)\n if (useCSSTransforms) {\n style = setTransform(pos);\n } else {\n // top,left (slow)\n style = setTopLeft(pos);\n\n // This is used for server rendering.\n if (usePercentages) {\n style.left = perc(pos.left / containerWidth);\n style.width = perc(pos.width / containerWidth);\n }\n }\n\n return style;\n }\n\n /**\n * Mix a Draggable instance into a child.\n * @param {Element} child Child element.\n * @return {Element} Child wrapped in Draggable.\n */\n mixinDraggable(child: ReactElement): ReactElement {\n return (\n \n {child}\n
\n );\n }\n\n /**\n * Mix a Resizable instance into a child.\n * @param {Element} child Child element.\n * @param {Object} position Position object (pixel values)\n * @return {Element} Child wrapped in Resizable.\n */\n mixinResizable(\n child: ReactElement,\n position: Position\n ): ReactElement {\n const { cols, x, minW, minH, maxW, maxH } = this.props;\n\n // This is the max possible width - doesn't go to infinity because of the width of the window\n const maxWidth = this.calcPosition(0, 0, cols - x, 0).width;\n\n // Calculate min/max constraints using our min & maxes\n const mins = this.calcPosition(0, 0, minW, minH);\n const maxes = this.calcPosition(0, 0, maxW, maxH);\n const minConstraints = [mins.width, mins.height];\n const maxConstraints = [\n Math.min(maxes.width, maxWidth),\n Math.min(maxes.height, Infinity)\n ];\n return (\n \n {child}\n \n );\n }\n\n /**\n * Wrapper around drag events to provide more useful data.\n * All drag events call the function with the given handler name,\n * with the signature (index, x, y).\n *\n * @param {String} handlerName Handler name to wrap.\n * @return {Function} Handler function.\n */\n onDragHandler(handlerName: string) {\n return (e: Event, { node, deltaX, deltaY }: ReactDraggableCallbackData) => {\n const handler = this.props[handlerName];\n if (!handler) return;\n\n const newPosition: PartialPosition = { top: 0, left: 0 };\n\n // Get new XY\n switch (handlerName) {\n case \"onDragStart\": {\n // TODO: this wont work on nested parents\n const { offsetParent } = node;\n if (!offsetParent) return;\n const parentRect = offsetParent.getBoundingClientRect();\n const clientRect = node.getBoundingClientRect();\n newPosition.left =\n clientRect.left - parentRect.left + offsetParent.scrollLeft;\n newPosition.top =\n clientRect.top - parentRect.top + offsetParent.scrollTop;\n this.setState({ dragging: newPosition });\n break;\n }\n case \"onDrag\":\n if (!this.state.dragging)\n throw new Error(\"onDrag called before onDragStart.\");\n newPosition.left = this.state.dragging.left + deltaX;\n newPosition.top = this.state.dragging.top + deltaY;\n this.setState({ dragging: newPosition });\n break;\n case \"onDragStop\":\n if (!this.state.dragging)\n throw new Error(\"onDragEnd called before onDragStart.\");\n newPosition.left = this.state.dragging.left;\n newPosition.top = this.state.dragging.top;\n this.setState({ dragging: null });\n break;\n default:\n throw new Error(\n \"onDragHandler called with unrecognized handlerName: \" + handlerName\n );\n }\n\n const { x, y } = this.calcXY(newPosition.top, newPosition.left);\n\n return handler.call(this, this.props.i, x, y, { e, node, newPosition });\n };\n }\n\n /**\n * Wrapper around drag events to provide more useful data.\n * All drag events call the function with the given handler name,\n * with the signature (index, x, y).\n *\n * @param {String} handlerName Handler name to wrap.\n * @return {Function} Handler function.\n */\n onResizeHandler(handlerName: string) {\n return (\n e: Event,\n { node, size }: { node: HTMLElement, size: Position }\n ) => {\n const handler = this.props[handlerName];\n if (!handler) return;\n const { cols, x, i, maxW, minW, maxH, minH } = this.props;\n\n // Get new XY\n let { w, h } = this.calcWH(size);\n\n // Cap w at numCols\n w = Math.min(w, cols - x);\n // Ensure w is at least 1\n w = Math.max(w, 1);\n\n // Min/max capping\n w = Math.max(Math.min(w, maxW), minW);\n h = Math.max(Math.min(h, maxH), minH);\n\n this.setState({ resizing: handlerName === \"onResizeStop\" ? null : size });\n\n handler.call(this, i, w, h, { e, node, size });\n };\n }\n\n render(): ReactNode {\n const {\n x,\n y,\n w,\n h,\n isDraggable,\n isResizable,\n useCSSTransforms\n } = this.props;\n\n const pos = this.calcPosition(x, y, w, h, this.state);\n const child = React.Children.only(this.props.children);\n\n // Create the child element. We clone the existing element but modify its className and style.\n let newChild = React.cloneElement(child, {\n className: classNames(\n \"react-grid-item\",\n child.props.className,\n this.props.className,\n {\n static: this.props.static,\n resizing: Boolean(this.state.resizing),\n \"react-draggable\": isDraggable,\n \"react-draggable-dragging\": Boolean(this.state.dragging),\n cssTransforms: useCSSTransforms\n }\n ),\n // We can set the width and height on the child, but unfortunately we can't set the position.\n style: {\n ...this.props.style,\n ...child.props.style,\n ...this.createStyle(pos)\n }\n });\n\n // Resizable support. This is usually on but the user can toggle it off.\n if (isResizable) newChild = this.mixinResizable(newChild, pos);\n\n // Draggable support. This is always on, except for with placeholders.\n if (isDraggable) newChild = this.mixinDraggable(newChild);\n\n return newChild;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/GridItem.jsx","'use strict';\nmodule.exports = function() {\n throw new Error(\"Don't instantiate Resizable directly! Use require('react-resizable').Resizable\");\n};\n\nmodule.exports.Resizable = require('./build/Resizable').default;\nmodule.exports.ResizableBox = require('./build/ResizableBox').default;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/react-resizable/index.js\n// module id = 18\n// module chunks = 0","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// React.addons.cloneWithProps look-alike that merges style & className.\nmodule.exports = function cloneElement(element, props) {\n if (props.style && element.props.style) {\n props.style = _extends({}, element.props.style, props.style);\n }\n if (props.className && element.props.className) {\n props.className = element.props.className + ' ' + props.className;\n }\n return _react2.default.cloneElement(element, props);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/react-resizable/build/cloneElement.js\n// module id = 19\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _Resizable = require('./Resizable');\n\nvar _Resizable2 = _interopRequireDefault(_Resizable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// An example use of Resizable.\nvar ResizableBox = function (_React$Component) {\n _inherits(ResizableBox, _React$Component);\n\n function ResizableBox() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, ResizableBox);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n width: _this.props.width,\n height: _this.props.height\n }, _this.onResize = function (e, data) {\n var size = data.size;\n var width = size.width,\n height = size.height;\n\n\n if (_this.props.onResize) {\n e.persist && e.persist();\n _this.setState(size, function () {\n return _this.props.onResize && _this.props.onResize(e, data);\n });\n } else {\n _this.setState(size);\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n ResizableBox.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (nextProps.width !== this.props.width || nextProps.height !== this.props.height) {\n this.setState({\n width: nextProps.width,\n height: nextProps.height\n });\n }\n };\n\n ResizableBox.prototype.render = function render() {\n // Basic wrapper around a Resizable instance.\n // If you use Resizable directly, you are responsible for updating the child component\n // with a new width and height.\n var _props = this.props,\n handleSize = _props.handleSize,\n onResize = _props.onResize,\n onResizeStart = _props.onResizeStart,\n onResizeStop = _props.onResizeStop,\n draggableOpts = _props.draggableOpts,\n minConstraints = _props.minConstraints,\n maxConstraints = _props.maxConstraints,\n lockAspectRatio = _props.lockAspectRatio,\n axis = _props.axis,\n width = _props.width,\n height = _props.height,\n props = _objectWithoutProperties(_props, ['handleSize', 'onResize', 'onResizeStart', 'onResizeStop', 'draggableOpts', 'minConstraints', 'maxConstraints', 'lockAspectRatio', 'axis', 'width', 'height']);\n\n return _react2.default.createElement(\n _Resizable2.default,\n {\n handleSize: handleSize,\n width: this.state.width,\n height: this.state.height,\n onResizeStart: onResizeStart,\n onResize: this.onResize,\n onResizeStop: onResizeStop,\n draggableOpts: draggableOpts,\n minConstraints: minConstraints,\n maxConstraints: maxConstraints,\n lockAspectRatio: lockAspectRatio,\n axis: axis\n },\n _react2.default.createElement('div', _extends({ style: { width: this.state.width + 'px', height: this.state.height + 'px' } }, props))\n );\n };\n\n return ResizableBox;\n}(_react2.default.Component);\n\nResizableBox.propTypes = {\n height: _propTypes2.default.number,\n width: _propTypes2.default.number\n};\nResizableBox.defaultProps = {\n handleSize: [20, 20]\n};\nexports.default = ResizableBox;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/react-resizable/build/ResizableBox.js\n// module id = 20\n// module chunks = 0","// @flow\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport isEqual from \"lodash.isequal\";\n\nimport {\n cloneLayout,\n synchronizeLayoutWithChildren,\n validateLayout,\n noop\n} from \"./utils\";\nimport {\n getBreakpointFromWidth,\n getColsFromBreakpoint,\n findOrGenerateResponsiveLayout\n} from \"./responsiveUtils\";\nimport ReactGridLayout from \"./ReactGridLayout\";\nimport type { Props as RGLProps } from \"./ReactGridLayout\";\nimport type { Layout } from \"./utils\";\n\nconst type = obj => Object.prototype.toString.call(obj);\n\ntype State = {\n layout: Layout,\n breakpoint: string,\n cols: number\n};\n\ntype Props = {\n ...$Exact,\n\n // Responsive config\n breakpoint: Breakpoint,\n breakpoints: { [key: Breakpoint]: number },\n cols: { [key: Breakpoint]: number },\n layouts: { [key: Breakpoint]: Layout },\n width: number,\n\n // Callbacks\n onBreakpointChange: (Breakpoint, cols: number) => void,\n onLayoutChange: (Layout, { [key: Breakpoint]: Layout }) => void,\n onWidthChange: (\n containerWidth: number,\n margin: [number, number],\n cols: number,\n containerPadding: [number, number] | null\n ) => void\n};\n\nexport default class ResponsiveReactGridLayout extends React.Component<\n Props<>,\n State\n> {\n // This should only include propTypes needed in this code; RGL itself\n // will do validation of the rest props passed to it.\n static propTypes = {\n //\n // Basic props\n //\n\n // Optional, but if you are managing width yourself you may want to set the breakpoint\n // yourself as well.\n breakpoint: PropTypes.string,\n\n // {name: pxVal}, e.g. {lg: 1200, md: 996, sm: 768, xs: 480}\n breakpoints: PropTypes.object,\n\n // # of cols. This is a breakpoint -> cols map\n cols: PropTypes.object,\n\n // layouts is an object mapping breakpoints to layouts.\n // e.g. {lg: Layout, md: Layout, ...}\n layouts(props: Props<>, propName: string) {\n if (type(props[propName]) !== \"[object Object]\") {\n throw new Error(\n \"Layout property must be an object. Received: \" +\n type(props[propName])\n );\n }\n Object.keys(props[propName]).forEach(key => {\n if (!(key in props.breakpoints)) {\n throw new Error(\n \"Each key in layouts must align with a key in breakpoints.\"\n );\n }\n validateLayout(props.layouts[key], \"layouts.\" + key);\n });\n },\n\n // The width of this component.\n // Required in this propTypes stanza because generateInitialState() will fail without it.\n width: PropTypes.number.isRequired,\n\n //\n // Callbacks\n //\n\n // Calls back with breakpoint and new # cols\n onBreakpointChange: PropTypes.func,\n\n // Callback so you can save the layout.\n // Calls back with (currentLayout, allLayouts). allLayouts are keyed by breakpoint.\n onLayoutChange: PropTypes.func,\n\n // Calls back with (containerWidth, margin, cols, containerPadding)\n onWidthChange: PropTypes.func\n };\n\n static defaultProps = {\n breakpoints: { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 },\n cols: { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 },\n layouts: {},\n onBreakpointChange: noop,\n onLayoutChange: noop,\n onWidthChange: noop\n };\n\n state = this.generateInitialState();\n\n generateInitialState(): State {\n const { width, breakpoints, layouts, cols } = this.props;\n const breakpoint = getBreakpointFromWidth(breakpoints, width);\n const colNo = getColsFromBreakpoint(breakpoint, cols);\n // verticalCompact compatibility, now deprecated\n const compactType =\n this.props.verticalCompact === false ? null : this.props.compactType;\n // Get the initial layout. This can tricky; we try to generate one however possible if one doesn't exist\n // for this layout.\n const initialLayout = findOrGenerateResponsiveLayout(\n layouts,\n breakpoints,\n breakpoint,\n breakpoint,\n colNo,\n compactType\n );\n\n return {\n layout: initialLayout,\n breakpoint: breakpoint,\n cols: colNo\n };\n }\n\n componentWillReceiveProps(nextProps: Props<*>) {\n // Allow parent to set width or breakpoint directly.\n if (\n nextProps.width != this.props.width ||\n nextProps.breakpoint !== this.props.breakpoint ||\n !isEqual(nextProps.breakpoints, this.props.breakpoints) ||\n !isEqual(nextProps.cols, this.props.cols)\n ) {\n this.onWidthChange(nextProps);\n } else if (!isEqual(nextProps.layouts, this.props.layouts)) {\n // Allow parent to set layouts directly.\n const { breakpoint, cols } = this.state;\n\n // Since we're setting an entirely new layout object, we must generate a new responsive layout\n // if one does not exist.\n const newLayout = findOrGenerateResponsiveLayout(\n nextProps.layouts,\n nextProps.breakpoints,\n breakpoint,\n breakpoint,\n cols,\n nextProps.compactType\n );\n this.setState({ layout: newLayout });\n }\n }\n\n // wrap layouts so we do not need to pass layouts to child\n onLayoutChange = (layout: Layout) => {\n this.props.onLayoutChange(layout, {\n ...this.props.layouts,\n [this.state.breakpoint]: layout\n });\n };\n\n /**\n * When the width changes work through breakpoints and reset state with the new width & breakpoint.\n * Width changes are necessary to figure out the widget widths.\n */\n onWidthChange(nextProps: Props<*>) {\n const { breakpoints, cols, layouts, compactType } = nextProps;\n const newBreakpoint =\n nextProps.breakpoint ||\n getBreakpointFromWidth(nextProps.breakpoints, nextProps.width);\n\n const lastBreakpoint = this.state.breakpoint;\n\n // Breakpoint change\n if (\n lastBreakpoint !== newBreakpoint ||\n this.props.breakpoints !== breakpoints ||\n this.props.cols !== cols\n ) {\n // Preserve the current layout if the current breakpoint is not present in the next layouts.\n if (!(lastBreakpoint in layouts))\n layouts[lastBreakpoint] = cloneLayout(this.state.layout);\n\n // Find or generate a new layout.\n const newCols: number = getColsFromBreakpoint(newBreakpoint, cols);\n let layout = findOrGenerateResponsiveLayout(\n layouts,\n breakpoints,\n newBreakpoint,\n lastBreakpoint,\n newCols,\n compactType\n );\n\n // This adds missing items.\n layout = synchronizeLayoutWithChildren(\n layout,\n nextProps.children,\n newCols,\n compactType\n );\n\n // Store the new layout.\n layouts[newBreakpoint] = layout;\n\n // callbacks\n this.props.onLayoutChange(layout, layouts);\n this.props.onBreakpointChange(newBreakpoint, newCols);\n this.props.onWidthChange(\n nextProps.width,\n nextProps.margin,\n newCols,\n nextProps.containerPadding\n );\n\n this.setState({\n breakpoint: newBreakpoint,\n layout: layout,\n cols: newCols\n });\n }\n }\n\n render() {\n /* eslint-disable no-unused-vars */\n const {\n breakpoint,\n breakpoints,\n cols,\n layouts,\n onBreakpointChange,\n onLayoutChange,\n onWidthChange,\n ...other\n } = this.props;\n /* eslint-enable no-unused-vars */\n\n return (\n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/ResponsiveReactGridLayout.jsx","// @flow\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport ReactDOM from \"react-dom\";\nimport type { ComponentType as ReactComponentType } from \"react\";\n\ntype WPProps = {\n className?: string,\n measureBeforeMount: boolean,\n style?: Object\n};\n\ntype WPState = {\n width: number\n};\n\n/*\n * A simple HOC that provides facility for listening to container resizes.\n */\nexport default function WidthProvider<\n Props,\n ComposedProps: { ...Props, ...WPProps }\n>(\n ComposedComponent: ReactComponentType\n): ReactComponentType {\n return class WidthProvider extends React.Component {\n static defaultProps = {\n measureBeforeMount: false\n };\n\n static propTypes = {\n // If true, will not render children until mounted. Useful for getting the exact width before\n // rendering, to prevent any unsightly resizing.\n measureBeforeMount: PropTypes.bool\n };\n\n state = {\n width: 1280\n };\n\n mounted: boolean = false;\n\n componentDidMount() {\n this.mounted = true;\n\n window.addEventListener(\"resize\", this.onWindowResize);\n // Call to properly set the breakpoint and resize the elements.\n // Note that if you're doing a full-width element, this can get a little wonky if a scrollbar\n // appears because of the grid. In that case, fire your own resize event, or set `overflow: scroll` on your body.\n this.onWindowResize();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n window.removeEventListener(\"resize\", this.onWindowResize);\n }\n\n onWindowResize = () => {\n if (!this.mounted) return;\n // eslint-disable-next-line\n const node = ReactDOM.findDOMNode(this); // Flow casts this to Text | Element\n if (node instanceof HTMLElement)\n this.setState({ width: node.offsetWidth });\n };\n\n render() {\n const { measureBeforeMount, ...rest } = this.props;\n if (measureBeforeMount && !this.mounted) {\n return (\n
\n );\n }\n\n return ;\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/components/WidthProvider.jsx"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://ReactGridLayout/webpack/universalModuleDefinition","webpack://ReactGridLayout/webpack/bootstrap","webpack://ReactGridLayout/./node_modules/prop-types/index.js","webpack://ReactGridLayout/./lib/utils.js","webpack://ReactGridLayout/external {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"react\",\"root\":\"React\"}","webpack://ReactGridLayout/./node_modules/lodash.isequal/index.js","webpack://ReactGridLayout/./lib/responsiveUtils.js","webpack://ReactGridLayout/external {\"commonjs\":\"react-dom\",\"commonjs2\":\"react-dom\",\"amd\":\"react-dom\",\"root\":\"ReactDOM\"}","webpack://ReactGridLayout/./node_modules/classnames/index.js","webpack://ReactGridLayout/./node_modules/react-draggable/build/web/react-draggable.min.js","webpack://ReactGridLayout/./lib/calculateUtils.js","webpack://ReactGridLayout/./lib/GridItem.jsx","webpack://ReactGridLayout/./lib/ReactGridLayoutPropTypes.js","webpack://ReactGridLayout/./lib/ReactGridLayout.jsx","webpack://ReactGridLayout/./node_modules/react-resizable/build/Resizable.js","webpack://ReactGridLayout/./node_modules/react-resizable/index.js","webpack://ReactGridLayout/./index-dev.js","webpack://ReactGridLayout/(webpack)/buildin/global.js","webpack://ReactGridLayout/(webpack)/buildin/module.js","webpack://ReactGridLayout/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://ReactGridLayout/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://ReactGridLayout/./node_modules/react-resizable/build/utils.js","webpack://ReactGridLayout/./node_modules/react-resizable/build/ResizableBox.js","webpack://ReactGridLayout/./lib/ResponsiveReactGridLayout.jsx","webpack://ReactGridLayout/./lib/components/WidthProvider.jsx"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__5__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","bottom","layout","bottomY","max","len","length","y","h","cloneLayout","newLayout","Array","cloneLayoutItem","layoutItem","w","x","minW","maxW","minH","maxH","moved","Boolean","static","isDraggable","isResizable","isBounded","childrenEqual","a","b","isEqual","React","Children","map","fastRGLPropsEqual","fastPositionEqual","left","top","width","height","collides","l1","l2","compact","compactType","cols","compareWith","getStatics","sorted","sortLayoutItems","out","compactItem","push","indexOf","heightWidth","resolveCompactionCollision","item","moveToCoord","axis","sizeProp","otherItem","fullLayout","compactH","Math","min","getFirstCollision","correctBounds","bounds","collidesWith","getLayoutItem","id","getAllCollisions","filter","moveElement","isUserAction","preventCollision","log","String","oldX","oldY","reverse","collisions","collision","moveElementAwayFromCollision","itemToMove","compactV","fakeItem","undefined","perc","num","setTransform","translate","transform","WebkitTransform","MozTransform","msTransform","OTransform","position","setTopLeft","sortLayoutItemsByColRow","sortLayoutItemsByRowCol","slice","sort","synchronizeLayoutWithChildren","initialLayout","children","forEach","child","exists","g","props","_grid","validateLayout","contextName","subProps","isArray","Error","j","verticalCompact","autoBindHandlers","el","fns","noop","argsTag","mapTag","objectTag","setTag","reIsHostCtor","reIsUint","typedArrayTags","freeGlobal","global","freeSelf","self","Function","freeExports","nodeType","freeModule","moduleExports","freeProcess","process","nodeUtil","binding","e","nodeIsTypedArray","isTypedArray","arraySome","array","predicate","index","mapToArray","result","size","setToArray","set","uid","func","arrayProto","funcProto","objectProto","coreJsData","funcToString","toString","maskSrcKey","exec","keys","IE_PROTO","nativeObjectToString","reIsNative","RegExp","replace","Buffer","Uint8Array","propertyIsEnumerable","splice","symToStringTag","nativeGetSymbols","getOwnPropertySymbols","nativeIsBuffer","isBuffer","nativeKeys","arg","DataView","getNative","Map","Promise","Set","WeakMap","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","valueOf","Hash","entries","this","clear","entry","ListCache","MapCache","SetCache","values","__data__","add","Stack","data","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","isType","skipIndexes","iteratee","baseTimes","isIndex","assocIndexOf","eq","baseGetTag","isOwn","tag","unmasked","getRawTag","objectToString","baseIsArguments","isObjectLike","baseIsEqual","other","bitmask","customizer","stack","equalFunc","objIsArr","othIsArr","objTag","getTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","byteLength","byteOffset","buffer","message","convert","isPartial","stacked","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","getAllKeys","objLength","othLength","skipCtor","objValue","othValue","compared","objCtor","constructor","othCtor","equalObjects","baseIsEqualDeep","baseIsNative","isObject","isMasked","isFunction","test","baseKeys","Ctor","proto","arrLength","seen","arrValue","othIndex","has","keysFunc","symbolsFunc","offset","arrayPush","baseGetAllKeys","getSymbols","getMapData","type","getValue","pop","pairs","LARGE_ARRAY_SIZE","resIndex","arrayFilter","symbol","ArrayBuffer","resolve","ctorString","arguments","isLength","baseUnary","getBreakpointFromWidth","breakpoints","sortBreakpoints","matching","breakpointName","getColsFromBreakpoint","breakpoint","findOrGenerateResponsiveLayout","layouts","lastBreakpoint","breakpointsSorted","breakpointsAbove","hasOwn","classNames","classes","argType","inner","apply","join","default","DraggableCore","resetWarningCache","isRequired","bool","number","string","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","u","f","isNaN","parseInt","concat","toUpperCase","document","documentElement","style","v","getOwnPropertyDescriptor","configurable","writable","O","S","D","parentNode","attachEvent","addEventListener","P","detachEvent","removeEventListener","clientHeight","ownerDocument","defaultView","getComputedStyle","borderTopWidth","borderBottomWidth","E","clientWidth","borderLeftWidth","borderRightWidth","T","paddingTop","paddingBottom","N","paddingLeft","paddingRight","C","M","getElementById","createElement","innerHTML","getElementsByTagName","appendChild","body","classList","className","match","k","remove","selection","empty","getSelection","removeAllRanges","_","getOwnPropertyDescriptors","defineProperties","touchAction","X","Y","L","targetTouches","identifier","changedTouches","I","getBoundingClientRect","clientX","scrollLeft","clientY","scrollTop","offsetParent","scale","R","state","lastX","deltaX","deltaY","lastY","A","findDOMNode","U","iterator","V","next","done","return","TypeError","W","B","setPrototypeOf","getPrototypeOf","__proto__","H","ReferenceError","q","G","z","start","move","stop","F","J","dragging","NaN","touchIdentifier","onMouseDown","allowAnyClick","button","disabled","target","Node","handle","cancel","setState","onStart","enableUserSelectHack","handleDrag","handleDragStop","preventDefault","grid","round","onDrag","MouseEvent","createEvent","initMouseEvent","onStop","handleDragStart","Component","cloneElement","only","onTouchStart","onMouseUp","onTouchEnd","K","Q","assign","tt","et","st","nt","rt","ot","at","it","ut","dragged","slackX","slackY","$","right","querySelector","HTMLElement","offsetLeft","marginLeft","offsetTop","marginTop","marginRight","marginBottom","defaultPosition","prevPropsPosition","isElementSVG","console","warn","SVGElement","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","positionOffset","Z","onDragStart","onDragStop","propTypes","defaultProps","calcGridColWidth","positionParams","margin","containerPadding","containerWidth","calcGridItemWHPx","gridUnits","colOrRowSize","marginPx","Number","isFinite","calcGridItemPosition","rowHeight","colWidth","resizing","calcXY","maxRows","clamp","lowerBound","upperBound","GridItem","newPosition","parentRect","clientRect","cLeft","transformScale","pLeft","cTop","pTop","getPositionParams","callbackData","onResizeHandler","nextProps","nextState","droppingPosition","oldPosition","useCSSTransforms","moveDroppingItem","prevProps","prevDroppingPosition","currentNode","ReactDOM","shouldDrag","pos","usePercentages","maxWidth","mins","maxes","minConstraints","maxConstraints","Infinity","draggableOpts","onResizeStop","onResizeStart","onResize","handlerName","handler","calcWH","newChild","dropping","cssTransforms","createStyle","mixinResizable","mixinDraggable","propName","autoSize","draggableCancel","draggableHandle","isDroppable","onLayoutChange","onDrop","droppingItem","innerRef","isFirefox","navigator","userAgent","ReactGridLayout","context","activeDrag","mounted","oldDragItem","oldLayout","oldResizeItem","droppingDOMNode","nativeEvent","layerX","layerY","calculatedPosition","stopPropagation","dragEnterCounter","removeDroppingPlaceholder","find","prevState","newLayoutBase","propsLayout","onLayoutMaybeChanged","nbRow","containerPaddingY","placeholder","hasCollisions","leastX","leastY","isDroppingItem","draggable","resizable","bounded","mergedClassName","mergedStyle","containerHeight","ref","onDragLeave","onDragEnter","onDragOver","processGridItem","ReactGridLayoutPropTypes","_react","_interopRequireDefault","_propTypes","_reactDraggable","_utils","obj","_extends","source","ownKeys","enumerableOnly","symbols","sym","_assertThisInitialized","_defineProperty","Resizable","_React$Component","subClass","superClass","_this","_len","args","_key","slackW","slackH","_proto","lockAspectRatio","aspectRatio","runConstraints","_ref","ratio","_ratio","oldW","oldH","_this$state","resizeHandler","_this2","_ref2","canDragX","canDragY","widthChanged","heightChanged","_this2$runConstraints","newState","persist","renderResizeHandle","resizeHandle","render","_this3","_this$props","resizeHandles","handleSize","excluded","sourceKeys","_objectWithoutPropertiesLoose","_objectSpread","ResizableBox","utils","Responsive","WidthProvider","webpackPolyfill","deprecate","paths","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","shim","componentName","location","propFullName","secret","err","getShim","ReactPropTypes","_Resizable","propsWidth","propsHeight","getDerivedStateFromProps","getIndentationValue","param","ResponsiveReactGridLayout","generateInitialState","colNo","onWidthChange","newBreakpoint","newCols","newLayouts","onBreakpointChange","lg","md","sm","xs","xx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AI,CAAC,EAAG,GACRC,GAAI,CAAC,EAAG,GACRC,GAAI,CAAC,EAAG,GACRC,GAAI,CAAC,EAAG,GACRC,IAAK,CAAC,EAAG,IAEXL,mBAAoBtlB,OACpBkd,eAAgBld,OAChBklB,cAAellB,U,4lEC/HJ,SAAS0jB,EACtBkC,GAOE,QACF,wB,kOAAA,U,MAAA,mKAoBU,CACNhrB,MAAO,OArBX,kBAwBqB,GAxBrB,yBAyCmB,WACf,GAAK,EAAKgjB,QAAV,CAEA,IAAMrQ,EAAO+N,IAASvI,YAAT,MACTxF,aAAgBgK,aAClB,EAAKtC,SAAS,CAAEra,MAAO2S,EAAKsY,kBA9ClC,S,EAAA,G,EAAA,2CA2BI/gB,KAAK8Y,SAAU,EAEf1nB,OAAO+Y,iBAAiB,SAAUnK,KAAKghB,gBAIvChhB,KAAKghB,mBAjCT,6CAqCIhhB,KAAK8Y,SAAU,EACf1nB,OAAOkZ,oBAAoB,SAAUtK,KAAKghB,kBAtC9C,+BAiDW,MACiChhB,KAAK1F,MAArC2mB,EADD,EACCA,mBAAuBC,EADxB,4BAEP,OAAID,IAAuBjhB,KAAK8Y,QAE5B,uBAAK9M,UAAWhM,KAAK1F,MAAM0R,UAAWvC,MAAOzJ,KAAK1F,MAAMmP,QAIrD,gBAACqX,EAAD,KAAuBI,EAAUlhB,KAAK2N,a,2BAzDjD,GAAmCpY,aAAnC,mBAUwC,CACpC0rB,oBAAoB,IAXxB,gBAcqB,CAGjBA,mBAAoBjY,IAAUf,OAjBlC","file":"react-grid-layout.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-dom\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"react-dom\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactGridLayout\"] = factory(require(\"react\"), require(\"react-dom\"));\n\telse\n\t\troot[\"ReactGridLayout\"] = factory(root[\"React\"], root[\"ReactDOM\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__5__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 11);\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","// @flow\nimport isEqual from \"lodash.isequal\";\nimport React from \"react\";\nimport type {\n ChildrenArray as ReactChildrenArray,\n Element as ReactElement\n} from \"react\";\nexport type LayoutItem = {\n w: number,\n h: number,\n x: number,\n y: number,\n i: string,\n minW?: number,\n minH?: number,\n maxW?: number,\n maxH?: number,\n moved?: boolean,\n static?: boolean,\n isDraggable?: ?boolean,\n isResizable?: ?boolean,\n isBounded?: ?boolean\n};\nexport type Layout = $ReadOnlyArray;\nexport type Position = {\n left: number,\n top: number,\n width: number,\n height: number\n};\nexport type ReactDraggableCallbackData = {\n node: HTMLElement,\n x?: number,\n y?: number,\n deltaX: number,\n deltaY: number,\n lastX?: number,\n lastY?: number\n};\n\nexport type PartialPosition = { left: number, top: number };\nexport type DroppingPosition = { left: number, top: number, e: Event };\nexport type Size = { width: number, height: number };\nexport type GridDragEvent = {\n e: Event,\n node: HTMLElement,\n newPosition: PartialPosition\n};\nexport type GridResizeEvent = { e: Event, node: HTMLElement, size: Size };\nexport type DragOverEvent = MouseEvent & {\n nativeEvent: {\n layerX: number,\n layerY: number,\n target: {\n className: String\n }\n }\n};\n\ntype REl = ReactElement;\nexport type ReactChildren = ReactChildrenArray;\n\n// All callbacks are of the signature (layout, oldItem, newItem, placeholder, e).\nexport type EventCallback = (\n Layout,\n oldItem: ?LayoutItem,\n newItem: ?LayoutItem,\n placeholder: ?LayoutItem,\n Event,\n ?HTMLElement\n) => void;\nexport type CompactType = ?(\"horizontal\" | \"vertical\");\n\nconst isProduction = process.env.NODE_ENV === \"production\";\nconst DEBUG = false;\n\n/**\n * Return the bottom coordinate of the layout.\n *\n * @param {Array} layout Layout array.\n * @return {Number} Bottom coordinate.\n */\nexport function bottom(layout: Layout): number {\n let max = 0,\n bottomY;\n for (let i = 0, len = layout.length; i < len; i++) {\n bottomY = layout[i].y + layout[i].h;\n if (bottomY > max) max = bottomY;\n }\n return max;\n}\n\nexport function cloneLayout(layout: Layout): Layout {\n const newLayout = Array(layout.length);\n for (let i = 0, len = layout.length; i < len; i++) {\n newLayout[i] = cloneLayoutItem(layout[i]);\n }\n return newLayout;\n}\n\n// Fast path to cloning, since this is monomorphic\nexport function cloneLayoutItem(layoutItem: LayoutItem): LayoutItem {\n return {\n w: layoutItem.w,\n h: layoutItem.h,\n x: layoutItem.x,\n y: layoutItem.y,\n i: layoutItem.i,\n minW: layoutItem.minW,\n maxW: layoutItem.maxW,\n minH: layoutItem.minH,\n maxH: layoutItem.maxH,\n moved: Boolean(layoutItem.moved),\n static: Boolean(layoutItem.static),\n // These can be null/undefined\n isDraggable: layoutItem.isDraggable,\n isResizable: layoutItem.isResizable,\n isBounded: layoutItem.isBounded\n };\n}\n\n/**\n * Comparing React `children` is a bit difficult. This is a good way to compare them.\n * This will catch differences in keys, order, and length.\n */\nexport function childrenEqual(a: ReactChildren, b: ReactChildren): boolean {\n return isEqual(\n React.Children.map(a, c => c.key),\n React.Children.map(b, c => c.key)\n );\n}\n\n/**\n * See `fastRGLPropsEqual.js`.\n * We want this to run as fast as possible - it is called often - and to be\n * resilient to new props that we add. So rather than call lodash.isEqual,\n * which isn't suited to comparing props very well, we use this specialized\n * function in conjunction with preval to generate the fastest possible comparison\n * function, tuned for exactly our props.\n */\ntype FastRGLPropsEqual = (Object, Object, Function) => boolean;\nexport const fastRGLPropsEqual: FastRGLPropsEqual = require(\"./fastRGLPropsEqual\");\n\n// Like the above, but a lot simpler.\nexport function fastPositionEqual(a: Position, b: Position) {\n return (\n a.left === b.left &&\n a.top === b.top &&\n a.width === b.width &&\n a.height === b.height\n );\n}\n\n/**\n * Given two layoutitems, check if they collide.\n */\nexport function collides(l1: LayoutItem, l2: LayoutItem): boolean {\n if (l1.i === l2.i) return false; // same element\n if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2\n if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2\n if (l1.y + l1.h <= l2.y) return false; // l1 is above l2\n if (l1.y >= l2.y + l2.h) return false; // l1 is below l2\n return true; // boxes overlap\n}\n\n/**\n * Given a layout, compact it. This involves going down each y coordinate and removing gaps\n * between items.\n *\n * Does not modify layout items (clones). Creates a new layout array.\n *\n * @param {Array} layout Layout.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} Compacted Layout.\n */\nexport function compact(\n layout: Layout,\n compactType: CompactType,\n cols: number\n): Layout {\n // Statics go in the compareWith array right away so items flow around them.\n const compareWith = getStatics(layout);\n // We go through the items by row and column.\n const sorted = sortLayoutItems(layout, compactType);\n // Holding for new items.\n const out = Array(layout.length);\n\n for (let i = 0, len = sorted.length; i < len; i++) {\n let l = cloneLayoutItem(sorted[i]);\n\n // Don't move static elements\n if (!l.static) {\n l = compactItem(compareWith, l, compactType, cols, sorted);\n\n // Add to comparison array. We only collide with items before this one.\n // Statics are already in this array.\n compareWith.push(l);\n }\n\n // Add to output array to make sure they still come out in the right order.\n out[layout.indexOf(sorted[i])] = l;\n\n // Clear moved flag, if it exists.\n l.moved = false;\n }\n\n return out;\n}\n\nconst heightWidth = { x: \"w\", y: \"h\" };\n/**\n * Before moving item down, it will check if the movement will cause collisions and move those items down before.\n */\nfunction resolveCompactionCollision(\n layout: Layout,\n item: LayoutItem,\n moveToCoord: number,\n axis: \"x\" | \"y\"\n) {\n const sizeProp = heightWidth[axis];\n item[axis] += 1;\n const itemIndex = layout\n .map(layoutItem => {\n return layoutItem.i;\n })\n .indexOf(item.i);\n\n // Go through each item we collide with.\n for (let i = itemIndex + 1; i < layout.length; i++) {\n const otherItem = layout[i];\n // Ignore static items\n if (otherItem.static) continue;\n\n // Optimization: we can break early if we know we're past this el\n // We can do this b/c it's a sorted layout\n if (otherItem.y > item.y + item.h) break;\n\n if (collides(item, otherItem)) {\n resolveCompactionCollision(\n layout,\n otherItem,\n moveToCoord + item[sizeProp],\n axis\n );\n }\n }\n\n item[axis] = moveToCoord;\n}\n\n/**\n * Compact an item in the layout.\n *\n * Modifies item.\n *\n */\nexport function compactItem(\n compareWith: Layout,\n l: LayoutItem,\n compactType: CompactType,\n cols: number,\n fullLayout: Layout\n): LayoutItem {\n const compactV = compactType === \"vertical\";\n const compactH = compactType === \"horizontal\";\n if (compactV) {\n // Bottom 'y' possible is the bottom of the layout.\n // This allows you to do nice stuff like specify {y: Infinity}\n // This is here because the layout must be sorted in order to get the correct bottom `y`.\n l.y = Math.min(bottom(compareWith), l.y);\n // Move the element up as far as it can go without colliding.\n while (l.y > 0 && !getFirstCollision(compareWith, l)) {\n l.y--;\n }\n } else if (compactH) {\n l.y = Math.min(bottom(compareWith), l.y);\n // Move the element left as far as it can go without colliding.\n while (l.x > 0 && !getFirstCollision(compareWith, l)) {\n l.x--;\n }\n }\n\n // Move it down, and keep moving it down if it's colliding.\n let collides;\n while ((collides = getFirstCollision(compareWith, l))) {\n if (compactH) {\n resolveCompactionCollision(fullLayout, l, collides.x + collides.w, \"x\");\n } else {\n resolveCompactionCollision(fullLayout, l, collides.y + collides.h, \"y\");\n }\n // Since we can't grow without bounds horizontally, if we've overflown, let's move it down and try again.\n if (compactH && l.x + l.w > cols) {\n l.x = cols - l.w;\n l.y++;\n }\n }\n return l;\n}\n\n/**\n * Given a layout, make sure all elements fit within its bounds.\n *\n * Modifies layout items.\n *\n * @param {Array} layout Layout array.\n * @param {Number} bounds Number of columns.\n */\nexport function correctBounds(\n layout: Layout,\n bounds: { cols: number }\n): Layout {\n const collidesWith = getStatics(layout);\n for (let i = 0, len = layout.length; i < len; i++) {\n const l = layout[i];\n // Overflows right\n if (l.x + l.w > bounds.cols) l.x = bounds.cols - l.w;\n // Overflows left\n if (l.x < 0) {\n l.x = 0;\n l.w = bounds.cols;\n }\n if (!l.static) collidesWith.push(l);\n else {\n // If this is static and collides with other statics, we must move it down.\n // We have to do something nicer than just letting them overlap.\n while (getFirstCollision(collidesWith, l)) {\n l.y++;\n }\n }\n }\n return layout;\n}\n\n/**\n * Get a layout item by ID. Used so we can override later on if necessary.\n *\n * @param {Array} layout Layout array.\n * @param {String} id ID\n * @return {LayoutItem} Item at ID.\n */\nexport function getLayoutItem(layout: Layout, id: string): ?LayoutItem {\n for (let i = 0, len = layout.length; i < len; i++) {\n if (layout[i].i === id) return layout[i];\n }\n}\n\n/**\n * Returns the first item this layout collides with.\n * It doesn't appear to matter which order we approach this from, although\n * perhaps that is the wrong thing to do.\n *\n * @param {Object} layoutItem Layout item.\n * @return {Object|undefined} A colliding layout item, or undefined.\n */\nexport function getFirstCollision(\n layout: Layout,\n layoutItem: LayoutItem\n): ?LayoutItem {\n for (let i = 0, len = layout.length; i < len; i++) {\n if (collides(layout[i], layoutItem)) return layout[i];\n }\n}\n\nexport function getAllCollisions(\n layout: Layout,\n layoutItem: LayoutItem\n): Array {\n return layout.filter(l => collides(l, layoutItem));\n}\n\n/**\n * Get all static elements.\n * @param {Array} layout Array of layout objects.\n * @return {Array} Array of static layout items..\n */\nexport function getStatics(layout: Layout): Array {\n return layout.filter(l => l.static);\n}\n\n/**\n * Move an element. Responsible for doing cascading movements of other elements.\n *\n * Modifies layout items.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} l element to move.\n * @param {Number} [x] X position in grid units.\n * @param {Number} [y] Y position in grid units.\n */\nexport function moveElement(\n layout: Layout,\n l: LayoutItem,\n x: ?number,\n y: ?number,\n isUserAction: ?boolean,\n preventCollision: ?boolean,\n compactType: CompactType,\n cols: number\n): Layout {\n // If this is static and not explicitly enabled as draggable,\n // no move is possible, so we can short-circuit this immediately.\n if (l.static && l.isDraggable !== true) return layout;\n\n // Short-circuit if nothing to do.\n if (l.y === y && l.x === x) return layout;\n\n log(\n `Moving element ${l.i} to [${String(x)},${String(y)}] from [${l.x},${l.y}]`\n );\n const oldX = l.x;\n const oldY = l.y;\n\n // This is quite a bit faster than extending the object\n if (typeof x === \"number\") l.x = x;\n if (typeof y === \"number\") l.y = y;\n l.moved = true;\n\n // If this collides with anything, move it.\n // When doing this comparison, we have to sort the items we compare with\n // to ensure, in the case of multiple collisions, that we're getting the\n // nearest collision.\n let sorted = sortLayoutItems(layout, compactType);\n const movingUp =\n compactType === \"vertical\" && typeof y === \"number\"\n ? oldY >= y\n : compactType === \"horizontal\" && typeof x === \"number\"\n ? oldX >= x\n : false;\n // $FlowIgnore acceptable modification of read-only array as it was recently cloned\n if (movingUp) sorted = sorted.reverse();\n const collisions = getAllCollisions(sorted, l);\n\n // There was a collision; abort\n if (preventCollision && collisions.length) {\n log(`Collision prevented on ${l.i}, reverting.`);\n l.x = oldX;\n l.y = oldY;\n l.moved = false;\n return layout;\n }\n\n // Move each item that collides away from this element.\n for (let i = 0, len = collisions.length; i < len; i++) {\n const collision = collisions[i];\n log(\n `Resolving collision between ${l.i} at [${l.x},${l.y}] and ${collision.i} at [${collision.x},${collision.y}]`\n );\n\n // Short circuit so we can't infinite loop\n if (collision.moved) continue;\n\n // Don't move static items - we have to move *this* element away\n if (collision.static) {\n layout = moveElementAwayFromCollision(\n layout,\n collision,\n l,\n isUserAction,\n compactType,\n cols\n );\n } else {\n layout = moveElementAwayFromCollision(\n layout,\n l,\n collision,\n isUserAction,\n compactType,\n cols\n );\n }\n }\n\n return layout;\n}\n\n/**\n * This is where the magic needs to happen - given a collision, move an element away from the collision.\n * We attempt to move it up if there's room, otherwise it goes below.\n *\n * @param {Array} layout Full layout to modify.\n * @param {LayoutItem} collidesWith Layout item we're colliding with.\n * @param {LayoutItem} itemToMove Layout item we're moving.\n */\nexport function moveElementAwayFromCollision(\n layout: Layout,\n collidesWith: LayoutItem,\n itemToMove: LayoutItem,\n isUserAction: ?boolean,\n compactType: CompactType,\n cols: number\n): Layout {\n const compactH = compactType === \"horizontal\";\n // Compact vertically if not set to horizontal\n const compactV = compactType !== \"horizontal\";\n const preventCollision = collidesWith.static; // we're already colliding (not for static items)\n\n // If there is enough space above the collision to put this element, move it there.\n // We only do this on the main collision as this can get funky in cascades and cause\n // unwanted swapping behavior.\n if (isUserAction) {\n // Reset isUserAction flag because we're not in the main collision anymore.\n isUserAction = false;\n\n // Make a mock item so we don't modify the item here, only modify in moveElement.\n const fakeItem: LayoutItem = {\n x: compactH ? Math.max(collidesWith.x - itemToMove.w, 0) : itemToMove.x,\n y: compactV ? Math.max(collidesWith.y - itemToMove.h, 0) : itemToMove.y,\n w: itemToMove.w,\n h: itemToMove.h,\n i: \"-1\"\n };\n\n // No collision? If so, we can go up there; otherwise, we'll end up moving down as normal\n if (!getFirstCollision(layout, fakeItem)) {\n log(\n `Doing reverse collision on ${itemToMove.i} up to [${fakeItem.x},${fakeItem.y}].`\n );\n return moveElement(\n layout,\n itemToMove,\n compactH ? fakeItem.x : undefined,\n compactV ? fakeItem.y : undefined,\n isUserAction,\n preventCollision,\n compactType,\n cols\n );\n }\n }\n\n return moveElement(\n layout,\n itemToMove,\n compactH ? itemToMove.x + 1 : undefined,\n compactV ? itemToMove.y + 1 : undefined,\n isUserAction,\n preventCollision,\n compactType,\n cols\n );\n}\n\n/**\n * Helper to convert a number to a percentage string.\n *\n * @param {Number} num Any number\n * @return {String} That number as a percentage.\n */\nexport function perc(num: number): string {\n return num * 100 + \"%\";\n}\n\nexport function setTransform({ top, left, width, height }: Position): Object {\n // Replace unitless items with px\n const translate = `translate(${left}px,${top}px)`;\n return {\n transform: translate,\n WebkitTransform: translate,\n MozTransform: translate,\n msTransform: translate,\n OTransform: translate,\n width: `${width}px`,\n height: `${height}px`,\n position: \"absolute\"\n };\n}\n\nexport function setTopLeft({ top, left, width, height }: Position): Object {\n return {\n top: `${top}px`,\n left: `${left}px`,\n width: `${width}px`,\n height: `${height}px`,\n position: \"absolute\"\n };\n}\n\n/**\n * Get layout items sorted from top left to right and down.\n *\n * @return {Array} Array of layout objects.\n * @return {Array} Layout, sorted static items first.\n */\nexport function sortLayoutItems(\n layout: Layout,\n compactType: CompactType\n): Layout {\n if (compactType === \"horizontal\") return sortLayoutItemsByColRow(layout);\n else return sortLayoutItemsByRowCol(layout);\n}\n\n/**\n * Sort layout items by row ascending and column ascending.\n *\n * Does not modify Layout.\n */\nexport function sortLayoutItemsByRowCol(layout: Layout): Layout {\n // Slice to clone array as sort modifies\n return layout.slice(0).sort(function (a, b) {\n if (a.y > b.y || (a.y === b.y && a.x > b.x)) {\n return 1;\n } else if (a.y === b.y && a.x === b.x) {\n // Without this, we can get different sort results in IE vs. Chrome/FF\n return 0;\n }\n return -1;\n });\n}\n\n/**\n * Sort layout items by column ascending then row ascending.\n *\n * Does not modify Layout.\n */\nexport function sortLayoutItemsByColRow(layout: Layout): Layout {\n return layout.slice(0).sort(function (a, b) {\n if (a.x > b.x || (a.x === b.x && a.y > b.y)) {\n return 1;\n }\n return -1;\n });\n}\n\n/**\n * Generate a layout using the initialLayout and children as a template.\n * Missing entries will be added, extraneous ones will be truncated.\n *\n * Does not modify initialLayout.\n *\n * @param {Array} initialLayout Layout passed in through props.\n * @param {String} breakpoint Current responsive breakpoint.\n * @param {?String} compact Compaction option.\n * @return {Array} Working layout.\n */\nexport function synchronizeLayoutWithChildren(\n initialLayout: Layout,\n children: ReactChildren,\n cols: number,\n compactType: CompactType\n): Layout {\n initialLayout = initialLayout || [];\n\n // Generate one layout item per child.\n const layout: LayoutItem[] = [];\n React.Children.forEach(children, (child: ReactElement, i: number) => {\n // Don't overwrite if it already exists.\n const exists = getLayoutItem(initialLayout, String(child.key));\n if (exists) {\n layout[i] = cloneLayoutItem(exists);\n } else {\n if (!isProduction && child.props._grid) {\n console.warn(\n \"`_grid` properties on children have been deprecated as of React 15.2. \" + // eslint-disable-line\n \"Please use `data-grid` or add your properties directly to the `layout`.\"\n );\n }\n const g = child.props[\"data-grid\"] || child.props._grid;\n\n // Hey, this item has a data-grid property, use it.\n if (g) {\n if (!isProduction) {\n validateLayout([g], \"ReactGridLayout.children\");\n }\n layout[i] = cloneLayoutItem({ ...g, i: child.key });\n } else {\n // Nothing provided: ensure this is added to the bottom\n layout[i] = cloneLayoutItem({\n w: 1,\n h: 1,\n x: 0,\n y: bottom(layout),\n i: String(child.key)\n });\n }\n }\n });\n\n // Correct the layout.\n const correctedLayout = correctBounds(layout, { cols: cols });\n return compact(correctedLayout, compactType, cols);\n}\n\n/**\n * Validate a layout. Throws errors.\n *\n * @param {Array} layout Array of layout items.\n * @param {String} [contextName] Context name for errors.\n * @throw {Error} Validation error.\n */\nexport function validateLayout(\n layout: Layout,\n contextName: string = \"Layout\"\n): void {\n const subProps = [\"x\", \"y\", \"w\", \"h\"];\n if (!Array.isArray(layout))\n throw new Error(contextName + \" must be an array!\");\n for (let i = 0, len = layout.length; i < len; i++) {\n const item = layout[i];\n for (let j = 0; j < subProps.length; j++) {\n if (typeof item[subProps[j]] !== \"number\") {\n throw new Error(\n \"ReactGridLayout: \" +\n contextName +\n \"[\" +\n i +\n \"].\" +\n subProps[j] +\n \" must be a number!\"\n );\n }\n }\n if (item.i && typeof item.i !== \"string\") {\n throw new Error(\n \"ReactGridLayout: \" + contextName + \"[\" + i + \"].i must be a string!\"\n );\n }\n if (item.static !== undefined && typeof item.static !== \"boolean\") {\n throw new Error(\n \"ReactGridLayout: \" +\n contextName +\n \"[\" +\n i +\n \"].static must be a boolean!\"\n );\n }\n }\n}\n\n// Legacy support for verticalCompact: false\nexport function compactType(\n props: ?{ verticalCompact: boolean, compactType: CompactType }\n): CompactType {\n const { verticalCompact, compactType } = props || {};\n return verticalCompact === false ? null : compactType;\n}\n\n// Flow can't really figure this out, so we just use Object\nexport function autoBindHandlers(el: Object, fns: Array): void {\n fns.forEach(key => (el[key] = el[key].bind(el)));\n}\n\nfunction log(...args) {\n if (!DEBUG) return;\n // eslint-disable-next-line no-console\n console.log(...args);\n}\n\nexport const noop = () => {};\n","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","// @flow\n\nimport { cloneLayout, compact, correctBounds } from \"./utils\";\n\nimport type { CompactType, Layout } from \"./utils\";\n\nexport type Breakpoint = string;\nexport type DefaultBreakpoints = \"lg\" | \"md\" | \"sm\" | \"xs\" | \"xxs\";\n\n// + indicates read-only\nexport type ResponsiveLayout = {\n +[breakpoint: T]: Layout\n};\nexport type Breakpoints = {\n +[breakpoint: T]: number\n};\n\n/**\n * Given a width, find the highest breakpoint that matches is valid for it (width > breakpoint).\n *\n * @param {Object} breakpoints Breakpoints object (e.g. {lg: 1200, md: 960, ...})\n * @param {Number} width Screen width.\n * @return {String} Highest breakpoint that is less than width.\n */\nexport function getBreakpointFromWidth(\n breakpoints: Breakpoints,\n width: number\n): Breakpoint {\n const sorted = sortBreakpoints(breakpoints);\n let matching = sorted[0];\n for (let i = 1, len = sorted.length; i < len; i++) {\n const breakpointName = sorted[i];\n if (width > breakpoints[breakpointName]) matching = breakpointName;\n }\n return matching;\n}\n\n/**\n * Given a breakpoint, get the # of cols set for it.\n * @param {String} breakpoint Breakpoint name.\n * @param {Object} cols Map of breakpoints to cols.\n * @return {Number} Number of cols.\n */\nexport function getColsFromBreakpoint(\n breakpoint: Breakpoint,\n cols: Breakpoints\n): number {\n if (!cols[breakpoint]) {\n throw new Error(\n \"ResponsiveReactGridLayout: `cols` entry for breakpoint \" +\n breakpoint +\n \" is missing!\"\n );\n }\n return cols[breakpoint];\n}\n\n/**\n * Given existing layouts and a new breakpoint, find or generate a new layout.\n *\n * This finds the layout above the new one and generates from it, if it exists.\n *\n * @param {Object} layouts Existing layouts.\n * @param {Array} breakpoints All breakpoints.\n * @param {String} breakpoint New breakpoint.\n * @param {String} breakpoint Last breakpoint (for fallback).\n * @param {Number} cols Column count at new breakpoint.\n * @param {Boolean} verticalCompact Whether or not to compact the layout\n * vertically.\n * @return {Array} New layout.\n */\nexport function findOrGenerateResponsiveLayout(\n layouts: ResponsiveLayout,\n breakpoints: Breakpoints,\n breakpoint: Breakpoint,\n lastBreakpoint: Breakpoint,\n cols: number,\n compactType: CompactType\n): Layout {\n // If it already exists, just return it.\n if (layouts[breakpoint]) return cloneLayout(layouts[breakpoint]);\n // Find or generate the next layout\n let layout = layouts[lastBreakpoint];\n const breakpointsSorted = sortBreakpoints(breakpoints);\n const breakpointsAbove = breakpointsSorted.slice(\n breakpointsSorted.indexOf(breakpoint)\n );\n for (let i = 0, len = breakpointsAbove.length; i < len; i++) {\n const b = breakpointsAbove[i];\n if (layouts[b]) {\n layout = layouts[b];\n break;\n }\n }\n layout = cloneLayout(layout || []); // clone layout so we don't modify existing items\n return compact(correctBounds(layout, { cols: cols }), compactType, cols);\n}\n\n/**\n * Given breakpoints, return an array of breakpoints sorted by width. This is usually\n * e.g. ['xxs', 'xs', 'sm', ...]\n *\n * @param {Object} breakpoints Key/value pair of breakpoint names to widths.\n * @return {Array} Sorted breakpoints.\n */\nexport function sortBreakpoints(\n breakpoints: Breakpoints\n): Array {\n const keys: Array = Object.keys(breakpoints);\n return keys.sort(function (a, b) {\n return breakpoints[a] - breakpoints[b];\n });\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e(require(\"react\"),require(\"react-dom\")):\"function\"==typeof define&&define.amd?define([\"react\",\"react-dom\"],e):\"object\"==typeof exports?exports.ReactDraggable=e(require(\"react\"),require(\"react-dom\")):t.ReactDraggable=e(t.React,t.ReactDOM)}(window,function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,\"a\",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=\"\",n(n.s=4)}([function(t,e,n){t.exports=n(5)()},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){var r;\n/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/!function(){\"use strict\";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e0&&void 0!==arguments[0]?arguments[0]:\"transform\";if(\"undefined\"==typeof window||void 0===window.document)return\"\";var e=window.document.documentElement.style;if(t in e)return\"\";for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{})}function X(t){return\"both\"===t.props.axis||\"x\"===t.props.axis}function Y(t){return\"both\"===t.props.axis||\"y\"===t.props.axis}function L(t,e,n){var r=\"number\"==typeof e?function(t,e){return t.targetTouches&&f(t.targetTouches,function(t){return e===t.identifier})||t.changedTouches&&f(t.changedTouches,function(t){return e===t.identifier})}(t,e):null;if(\"number\"==typeof e&&!r)return null;var o=I(n);return function(t,e,n){var r=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect();return{x:(t.clientX+e.scrollLeft-r.left)/n,y:(t.clientY+e.scrollTop-r.top)/n}}(r||t,n.props.offsetParent||o.offsetParent||o.ownerDocument.body,n.props.scale)}function R(t,e,n){var r=t.state,o=!d(r.lastX),a=I(t);return o?{node:a,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:a,deltaX:e-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:e,y:n}}function A(t,e){var n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function I(t){var e=u.a.findDOMNode(t);if(!e)throw new Error(\": Unmounted during event!\");return e}function U(t){return(U=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function V(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function W(t,e){for(var n=0;n not mounted on DragStart!\");var r=e.ownerDocument;if(!(n.props.disabled||!(t.target instanceof r.defaultView.Node)||n.props.handle&&!D(t.target,n.props.handle,e)||n.props.cancel&&D(t.target,n.props.cancel,e))){var o=function(t){return t.targetTouches&&t.targetTouches[0]?t.targetTouches[0].identifier:t.changedTouches&&t.changedTouches[0]?t.changedTouches[0].identifier:void 0}(t);n.setState({touchIdentifier:o});var a=L(t,o,H(n));if(null!=a){var i=a.x,s=a.y,c=R(H(n),i,s);n.props.onStart,!1!==n.props.onStart(t,c)&&(n.props.enableUserSelectHack&&M(r),n.setState({dragging:!0,lastX:i,lastY:s}),x(r,F.move,n.handleDrag),x(r,F.stop,n.handleDragStop))}}}),G(H(n),\"handleDrag\",function(t){\"touchmove\"===t.type&&t.preventDefault();var e=L(t,n.state.touchIdentifier,H(n));if(null!=e){var r,o,a,i=e.x,s=e.y;if(Array.isArray(n.props.grid)){var u=i-n.state.lastX,c=s-n.state.lastY,l=V((r=n.props.grid,o=u,a=c,[Math.round(o/r[0])*r[0],Math.round(a/r[1])*r[1]]),2);if(u=l[0],c=l[1],!u&&!c)return;i=n.state.lastX+u,s=n.state.lastY+c}var f=R(H(n),i,s);if(!1!==n.props.onDrag(t,f))n.setState({lastX:i,lastY:s});else try{n.handleDragStop(new MouseEvent(\"mouseup\"))}catch(t){var p=document.createEvent(\"MouseEvents\");p.initMouseEvent(\"mouseup\",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.handleDragStop(p)}}}),G(H(n),\"handleDragStop\",function(t){if(n.state.dragging){var e=L(t,n.state.touchIdentifier,H(n));if(null!=e){var r=e.x,o=e.y,a=R(H(n),r,o),i=u.a.findDOMNode(H(n));i&&n.props.enableUserSelectHack&&k(i.ownerDocument),n.setState({dragging:!1,lastX:NaN,lastY:NaN}),n.props.onStop(t,a),i&&(P(i.ownerDocument,F.move,n.handleDrag),P(i.ownerDocument,F.stop,n.handleDragStop))}}}),G(H(n),\"onMouseDown\",function(t){return F=z.mouse,n.handleDragStart(t)}),G(H(n),\"onMouseUp\",function(t){return F=z.mouse,n.handleDragStop(t)}),G(H(n),\"onTouchStart\",function(t){return F=z.touch,n.handleDragStart(t)}),G(H(n),\"onTouchEnd\",function(t){return F=z.touch,n.handleDragStop(t)}),n}var n,r,a;return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&q(t,e)}(e,o.a.Component),n=e,(r=[{key:\"componentWillUnmount\",value:function(){var t=u.a.findDOMNode(this);if(t){var e=t.ownerDocument;P(e,z.mouse.move,this.handleDrag),P(e,z.touch.move,this.handleDrag),P(e,z.mouse.stop,this.handleDragStop),P(e,z.touch.stop,this.handleDragStop),this.props.enableUserSelectHack&&k(e)}}},{key:\"render\",value:function(){return o.a.cloneElement(o.a.Children.only(this.props.children),{style:_(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}])&&W(n.prototype,r),a&&W(n,a),e}();function K(t){return(K=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function Q(){return(Q=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return n}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}function tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function et(t){for(var e=1;e, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.\"),n}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&it(t,e)}(e,o.a.Component),at(e,null,[{key:\"getDerivedStateFromProps\",value:function(t,e){var n=t.position,r=e.prevPropsPosition;return!n||r&&n.x===r.x&&n.y===r.y?null:{x:n.x,y:n.y,prevPropsPosition:et({},n)}}}]),at(e,[{key:\"componentDidMount\",value:function(){void 0!==window.SVGElement&&u.a.findDOMNode(this)instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:\"componentWillUnmount\",value:function(){this.setState({dragging:!1})}},{key:\"render\",value:function(){var t,e=this.props,n=(e.axis,e.bounds,e.children),r=e.defaultPosition,a=e.defaultClassName,i=e.defaultClassNameDragging,s=e.defaultClassNameDragged,u=e.position,c=e.positionOffset,f=(e.scale,Z(e,[\"axis\",\"bounds\",\"children\",\"defaultPosition\",\"defaultClassName\",\"defaultClassNameDragging\",\"defaultClassNameDragged\",\"position\",\"positionOffset\",\"scale\"])),p={},d=null,g=!Boolean(u)||this.state.dragging,y=u||r,h={x:X(this)&&g?this.state.x:y.x,y:Y(this)&&g?this.state.y:y.y};this.state.isElementSVG?d=function(t,e){return C(t,e,\"\")}(h,c):p=function(t,e){var n=C(t,e,\"px\");return w({},b(\"transform\",m),n)}(h,c);var v=l()(n.props.className||\"\",a,(st(t={},i,this.state.dragging),st(t,s,this.state.dragged),t));return o.a.createElement(J,Q({},f,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),o.a.cloneElement(o.a.Children.only(n),{className:v,style:et({},n.props.style,{},p),transform:d}))}}]),e}();st(ut,\"displayName\",\"Draggable\"),st(ut,\"propTypes\",et({},J.propTypes,{axis:i.a.oneOf([\"both\",\"x\",\"y\",\"none\"]),bounds:i.a.oneOfType([i.a.shape({left:i.a.number,right:i.a.number,top:i.a.number,bottom:i.a.number}),i.a.string,i.a.oneOf([!1])]),defaultClassName:i.a.string,defaultClassNameDragging:i.a.string,defaultClassNameDragged:i.a.string,defaultPosition:i.a.shape({x:i.a.number,y:i.a.number}),positionOffset:i.a.shape({x:i.a.oneOfType([i.a.number,i.a.string]),y:i.a.oneOfType([i.a.number,i.a.string])}),position:i.a.shape({x:i.a.number,y:i.a.number}),className:y,style:y,transform:y})),st(ut,\"defaultProps\",et({},J.defaultProps,{axis:\"both\",bounds:!1,defaultClassName:\"react-draggable\",defaultClassNameDragging:\"react-draggable-dragging\",defaultClassNameDragged:\"react-draggable-dragged\",defaultPosition:{x:0,y:0},position:null,scale:1}))}])});\n//# sourceMappingURL=react-draggable.min.js.map","// @flow\nimport type { Position } from \"./utils\";\n\nexport type PositionParams = {\n margin: [number, number],\n containerPadding: [number, number],\n containerWidth: number,\n cols: number,\n rowHeight: number,\n maxRows: number\n};\n\n// Helper for generating column width\nexport function calcGridColWidth(positionParams: PositionParams): number {\n const { margin, containerPadding, containerWidth, cols } = positionParams;\n return (\n (containerWidth - margin[0] * (cols - 1) - containerPadding[0] * 2) / cols\n );\n}\n\n// This can either be called:\n// calcGridItemWHPx(w, colWidth, margin[0])\n// or\n// calcGridItemWHPx(h, rowHeight, margin[1])\nexport function calcGridItemWHPx(\n gridUnits: number,\n colOrRowSize: number,\n marginPx: number\n) {\n // 0 * Infinity === NaN, which causes problems with resize contraints\n if (!Number.isFinite(gridUnits)) return gridUnits;\n return Math.round(\n colOrRowSize * gridUnits + Math.max(0, gridUnits - 1) * marginPx\n );\n}\n\n/**\n * Return position on the page given an x, y, w, h.\n * left, top, width, height are all in pixels.\n * @param {PositionParams} positionParams Parameters of grid needed for coordinates calculations.\n * @param {Number} x X coordinate in grid units.\n * @param {Number} y Y coordinate in grid units.\n * @param {Number} w W coordinate in grid units.\n * @param {Number} h H coordinate in grid units.\n * @return {Position} Object containing coords.\n */\nexport function calcGridItemPosition(\n positionParams: PositionParams,\n x: number,\n y: number,\n w: number,\n h: number,\n state: ?Object\n): Position {\n const { margin, containerPadding, rowHeight } = positionParams;\n const colWidth = calcGridColWidth(positionParams);\n const out = {};\n\n // If resizing, use the exact width and height as returned from resizing callbacks.\n if (state && state.resizing) {\n out.width = Math.round(state.resizing.width);\n out.height = Math.round(state.resizing.height);\n }\n // Otherwise, calculate from grid units.\n else {\n out.width = calcGridItemWHPx(w, colWidth, margin[0]);\n out.height = calcGridItemWHPx(h, rowHeight, margin[1]);\n }\n\n // If dragging, use the exact width and height as returned from dragging callbacks.\n if (state && state.dragging) {\n out.top = Math.round(state.dragging.top);\n out.left = Math.round(state.dragging.left);\n }\n // Otherwise, calculate from grid units.\n else {\n out.top = Math.round((rowHeight + margin[1]) * y + containerPadding[1]);\n out.left = Math.round((colWidth + margin[0]) * x + containerPadding[0]);\n }\n\n return out;\n}\n\n/**\n * Translate x and y coordinates from pixels to grid units.\n * @param {PositionParams} positionParams Parameters of grid needed for coordinates calculations.\n * @param {Number} top Top position (relative to parent) in pixels.\n * @param {Number} left Left position (relative to parent) in pixels.\n * @param {Number} w W coordinate in grid units.\n * @param {Number} h H coordinate in grid units.\n * @return {Object} x and y in grid units.\n */\nexport function calcXY(\n positionParams: PositionParams,\n top: number,\n left: number,\n w: number,\n h: number\n): { x: number, y: number } {\n const { margin, cols, rowHeight, maxRows } = positionParams;\n const colWidth = calcGridColWidth(positionParams);\n\n // left = colWidth * x + margin * (x + 1)\n // l = cx + m(x+1)\n // l = cx + mx + m\n // l - m = cx + mx\n // l - m = x(c + m)\n // (l - m) / (c + m) = x\n // x = (left - margin) / (coldWidth + margin)\n let x = Math.round((left - margin[0]) / (colWidth + margin[0]));\n let y = Math.round((top - margin[1]) / (rowHeight + margin[1]));\n\n // Capping\n x = clamp(x, 0, cols - w);\n y = clamp(y, 0, maxRows - h);\n return { x, y };\n}\n\n/**\n * Given a height and width in pixel values, calculate grid units.\n * @param {PositionParams} positionParams Parameters of grid needed for coordinates calcluations.\n * @param {Number} height Height in pixels.\n * @param {Number} width Width in pixels.\n * @param {Number} x X coordinate in grid units.\n * @param {Number} y Y coordinate in grid units.\n * @return {Object} w, h as grid units.\n */\nexport function calcWH(\n positionParams: PositionParams,\n width: number,\n height: number,\n x: number,\n y: number\n): { w: number, h: number } {\n const { margin, maxRows, cols, rowHeight } = positionParams;\n const colWidth = calcGridColWidth(positionParams);\n\n // width = colWidth * w - (margin * (w - 1))\n // ...\n // w = (width + margin) / (colWidth + margin)\n let w = Math.round((width + margin[0]) / (colWidth + margin[0]));\n let h = Math.round((height + margin[1]) / (rowHeight + margin[1]));\n\n // Capping\n w = clamp(w, 0, cols - x);\n h = clamp(h, 0, maxRows - y);\n return { w, h };\n}\n\n// Similar to _.clamp\nexport function clamp(num: number, lowerBound: number, upperBound: number) {\n return Math.max(Math.min(num, upperBound), lowerBound);\n}\n","// @flow\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport PropTypes from \"prop-types\";\nimport { DraggableCore } from \"react-draggable\";\nimport { Resizable } from \"react-resizable\";\nimport { fastPositionEqual, perc, setTopLeft, setTransform } from \"./utils\";\nimport {\n calcGridItemPosition,\n calcGridItemWHPx,\n calcGridColWidth,\n calcXY,\n calcWH,\n clamp\n} from \"./calculateUtils\";\nimport classNames from \"classnames\";\nimport type { Element as ReactElement, Node as ReactNode } from \"react\";\n\nimport type {\n ReactDraggableCallbackData,\n GridDragEvent,\n GridResizeEvent,\n DroppingPosition,\n Position\n} from \"./utils\";\n\nimport type { PositionParams } from \"./calculateUtils\";\n\ntype PartialPosition = { top: number, left: number };\ntype GridItemCallback = (\n i: string,\n w: number,\n h: number,\n Data\n) => void;\n\ntype State = {\n resizing: ?{ width: number, height: number },\n dragging: ?{ top: number, left: number },\n className: string\n};\n\ntype Props = {\n children: ReactElement,\n cols: number,\n containerWidth: number,\n margin: [number, number],\n containerPadding: [number, number],\n rowHeight: number,\n maxRows: number,\n isDraggable: boolean,\n isResizable: boolean,\n isBounded: boolean,\n static?: boolean,\n useCSSTransforms?: boolean,\n usePercentages?: boolean,\n transformScale: number,\n droppingPosition?: DroppingPosition,\n\n className: string,\n style?: Object,\n // Draggability\n cancel: string,\n handle: string,\n\n x: number,\n y: number,\n w: number,\n h: number,\n\n minW: number,\n maxW: number,\n minH: number,\n maxH: number,\n i: string,\n\n onDrag?: GridItemCallback,\n onDragStart?: GridItemCallback,\n onDragStop?: GridItemCallback,\n onResize?: GridItemCallback,\n onResizeStart?: GridItemCallback,\n onResizeStop?: GridItemCallback\n};\n\n/**\n * An individual item within a ReactGridLayout.\n */\nexport default class GridItem extends React.Component {\n static propTypes = {\n // Children must be only a single element\n children: PropTypes.element,\n\n // General grid attributes\n cols: PropTypes.number.isRequired,\n containerWidth: PropTypes.number.isRequired,\n rowHeight: PropTypes.number.isRequired,\n margin: PropTypes.array.isRequired,\n maxRows: PropTypes.number.isRequired,\n containerPadding: PropTypes.array.isRequired,\n\n // These are all in grid units\n x: PropTypes.number.isRequired,\n y: PropTypes.number.isRequired,\n w: PropTypes.number.isRequired,\n h: PropTypes.number.isRequired,\n\n // All optional\n minW: function (props: Props, propName: string) {\n const value = props[propName];\n if (typeof value !== \"number\") return new Error(\"minWidth not Number\");\n if (value > props.w || value > props.maxW)\n return new Error(\"minWidth larger than item width/maxWidth\");\n },\n\n maxW: function (props: Props, propName: string) {\n const value = props[propName];\n if (typeof value !== \"number\") return new Error(\"maxWidth not Number\");\n if (value < props.w || value < props.minW)\n return new Error(\"maxWidth smaller than item width/minWidth\");\n },\n\n minH: function (props: Props, propName: string) {\n const value = props[propName];\n if (typeof value !== \"number\") return new Error(\"minHeight not Number\");\n if (value > props.h || value > props.maxH)\n return new Error(\"minHeight larger than item height/maxHeight\");\n },\n\n maxH: function (props: Props, propName: string) {\n const value = props[propName];\n if (typeof value !== \"number\") return new Error(\"maxHeight not Number\");\n if (value < props.h || value < props.minH)\n return new Error(\"maxHeight smaller than item height/minHeight\");\n },\n\n // ID is nice to have for callbacks\n i: PropTypes.string.isRequired,\n\n // Functions\n onDragStop: PropTypes.func,\n onDragStart: PropTypes.func,\n onDrag: PropTypes.func,\n onResizeStop: PropTypes.func,\n onResizeStart: PropTypes.func,\n onResize: PropTypes.func,\n\n // Flags\n isDraggable: PropTypes.bool.isRequired,\n isResizable: PropTypes.bool.isRequired,\n isBounded: PropTypes.bool.isRequired,\n static: PropTypes.bool,\n\n // Use CSS transforms instead of top/left\n useCSSTransforms: PropTypes.bool.isRequired,\n transformScale: PropTypes.number,\n\n // Others\n className: PropTypes.string,\n // Selector for draggable handle\n handle: PropTypes.string,\n // Selector for draggable cancel (see react-draggable)\n cancel: PropTypes.string,\n // Current position of a dropping element\n droppingPosition: PropTypes.shape({\n e: PropTypes.object.isRequired,\n left: PropTypes.number.isRequired,\n top: PropTypes.number.isRequired\n })\n };\n\n static defaultProps = {\n className: \"\",\n cancel: \"\",\n handle: \"\",\n minH: 1,\n minW: 1,\n maxH: Infinity,\n maxW: Infinity,\n transformScale: 1\n };\n\n state: State = {\n resizing: null,\n dragging: null,\n className: \"\"\n };\n\n currentNode: HTMLElement;\n\n shouldComponentUpdate(nextProps: Props, nextState: State) {\n // We can't deeply compare children. If the developer memoizes them, we can\n // use this optimization.\n if (this.props.children !== nextProps.children) return true;\n if (this.props.droppingPosition !== nextProps.droppingPosition) return true;\n // TODO memoize these calculations so they don't take so long?\n const oldPosition = calcGridItemPosition(\n this.getPositionParams(this.props),\n this.props.x,\n this.props.y,\n this.props.w,\n this.props.h,\n this.state\n );\n const newPosition = calcGridItemPosition(\n this.getPositionParams(nextProps),\n nextProps.x,\n nextProps.y,\n nextProps.w,\n nextProps.h,\n nextState\n );\n return (\n !fastPositionEqual(oldPosition, newPosition) ||\n this.props.useCSSTransforms !== nextProps.useCSSTransforms\n );\n }\n\n componentDidMount() {\n this.moveDroppingItem({});\n }\n\n componentDidUpdate(prevProps: Props) {\n this.moveDroppingItem(prevProps);\n }\n\n // When a droppingPosition is present, this means we should fire a move event, as if we had moved\n // this element by `x, y` pixels.\n moveDroppingItem(prevProps: Props) {\n const { droppingPosition } = this.props;\n if (!droppingPosition) return;\n\n const prevDroppingPosition = prevProps.droppingPosition || {\n left: 0,\n top: 0\n };\n const { dragging } = this.state;\n\n if (!this.currentNode) {\n // eslint-disable-next-line react/no-find-dom-node\n this.currentNode = ((ReactDOM.findDOMNode(this): any): HTMLElement);\n }\n\n const shouldDrag =\n (dragging && droppingPosition.left !== prevDroppingPosition.left) ||\n droppingPosition.top !== prevDroppingPosition.top;\n\n if (!dragging) {\n this.onDragStart(droppingPosition.e, {\n node: this.currentNode,\n deltaX: droppingPosition.left,\n deltaY: droppingPosition.top\n });\n } else if (shouldDrag) {\n const deltaX = droppingPosition.left - dragging.left;\n const deltaY = droppingPosition.top - dragging.top;\n\n this.onDrag(droppingPosition.e, {\n node: this.currentNode,\n deltaX,\n deltaY\n });\n }\n }\n\n getPositionParams(props: Props = this.props): PositionParams {\n return {\n cols: props.cols,\n containerPadding: props.containerPadding,\n containerWidth: props.containerWidth,\n margin: props.margin,\n maxRows: props.maxRows,\n rowHeight: props.rowHeight\n };\n }\n\n /**\n * This is where we set the grid item's absolute placement. It gets a little tricky because we want to do it\n * well when server rendering, and the only way to do that properly is to use percentage width/left because\n * we don't know exactly what the browser viewport is.\n * Unfortunately, CSS Transforms, which are great for performance, break in this instance because a percentage\n * left is relative to the item itself, not its container! So we cannot use them on the server rendering pass.\n *\n * @param {Object} pos Position object with width, height, left, top.\n * @return {Object} Style object.\n */\n createStyle(pos: Position): { [key: string]: ?string } {\n const { usePercentages, containerWidth, useCSSTransforms } = this.props;\n\n let style;\n // CSS Transforms support (default)\n if (useCSSTransforms) {\n style = setTransform(pos);\n } else {\n // top,left (slow)\n style = setTopLeft(pos);\n\n // This is used for server rendering.\n if (usePercentages) {\n style.left = perc(pos.left / containerWidth);\n style.width = perc(pos.width / containerWidth);\n }\n }\n\n return style;\n }\n\n /**\n * Mix a Draggable instance into a child.\n * @param {Element} child Child element.\n * @return {Element} Child wrapped in Draggable.\n */\n mixinDraggable(\n child: ReactElement,\n isDraggable: boolean\n ): ReactElement {\n return (\n \n {child}\n \n );\n }\n\n /**\n * Mix a Resizable instance into a child.\n * @param {Element} child Child element.\n * @param {Object} position Position object (pixel values)\n * @return {Element} Child wrapped in Resizable.\n */\n mixinResizable(\n child: ReactElement,\n position: Position,\n isResizable: boolean\n ): ReactElement {\n const { cols, x, minW, minH, maxW, maxH, transformScale } = this.props;\n const positionParams = this.getPositionParams();\n\n // This is the max possible width - doesn't go to infinity because of the width of the window\n const maxWidth = calcGridItemPosition(positionParams, 0, 0, cols - x, 0)\n .width;\n\n // Calculate min/max constraints using our min & maxes\n const mins = calcGridItemPosition(positionParams, 0, 0, minW, minH);\n const maxes = calcGridItemPosition(positionParams, 0, 0, maxW, maxH);\n const minConstraints = [mins.width, mins.height];\n const maxConstraints = [\n Math.min(maxes.width, maxWidth),\n Math.min(maxes.height, Infinity)\n ];\n return (\n \n {child}\n \n );\n }\n\n /**\n * onDragStart event handler\n * @param {Event} e event data\n * @param {Object} callbackData an object with node, delta and position information\n */\n onDragStart = (e: Event, { node }: ReactDraggableCallbackData) => {\n const { onDragStart } = this.props;\n if (!onDragStart) return;\n\n const newPosition: PartialPosition = { top: 0, left: 0 };\n\n // TODO: this wont work on nested parents\n const { offsetParent } = node;\n if (!offsetParent) return;\n const parentRect = offsetParent.getBoundingClientRect();\n const clientRect = node.getBoundingClientRect();\n const cLeft = clientRect.left / this.props.transformScale;\n const pLeft = parentRect.left / this.props.transformScale;\n const cTop = clientRect.top / this.props.transformScale;\n const pTop = parentRect.top / this.props.transformScale;\n newPosition.left = cLeft - pLeft + offsetParent.scrollLeft;\n newPosition.top = cTop - pTop + offsetParent.scrollTop;\n this.setState({ dragging: newPosition });\n\n // Call callback with this data\n const { x, y } = calcXY(\n this.getPositionParams(),\n newPosition.top,\n newPosition.left,\n this.props.w,\n this.props.h\n );\n\n return onDragStart.call(this, this.props.i, x, y, {\n e,\n node,\n newPosition\n });\n };\n\n /**\n * onDrag event handler\n * @param {Event} e event data\n * @param {Object} callbackData an object with node, delta and position information\n */\n onDrag = (e: Event, { node, deltaX, deltaY }: ReactDraggableCallbackData) => {\n const { onDrag, transformScale } = this.props;\n if (!onDrag) return;\n deltaX /= transformScale;\n deltaY /= transformScale;\n\n if (!this.state.dragging) {\n throw new Error(\"onDrag called before onDragStart.\");\n }\n let top = this.state.dragging.top + deltaY;\n let left = this.state.dragging.left + deltaX;\n\n const { isBounded, i, w, h, containerWidth } = this.props;\n const positionParams = this.getPositionParams();\n\n // Boundary calculations; keeps items within the grid\n if (isBounded) {\n const { offsetParent } = node;\n\n if (offsetParent) {\n const { margin, rowHeight } = this.props;\n const bottomBoundary =\n offsetParent.clientHeight - calcGridItemWHPx(h, rowHeight, margin[1]);\n top = clamp(top, 0, bottomBoundary);\n\n const colWidth = calcGridColWidth(positionParams);\n const rightBoundary =\n containerWidth - calcGridItemWHPx(w, colWidth, margin[0]);\n left = clamp(left, 0, rightBoundary);\n }\n }\n\n const newPosition: PartialPosition = { top, left };\n this.setState({ dragging: newPosition });\n\n // Call callback with this data\n const { x, y } = calcXY(positionParams, top, left, w, h);\n return onDrag.call(this, i, x, y, {\n e,\n node,\n newPosition\n });\n };\n\n /**\n * onDragStop event handler\n * @param {Event} e event data\n * @param {Object} callbackData an object with node, delta and position information\n */\n onDragStop = (e: Event, { node }: ReactDraggableCallbackData) => {\n const { onDragStop } = this.props;\n if (!onDragStop) return;\n\n if (!this.state.dragging) {\n throw new Error(\"onDragEnd called before onDragStart.\");\n }\n const { w, h, i } = this.props;\n const { left, top } = this.state.dragging;\n const newPosition: PartialPosition = { top, left };\n this.setState({ dragging: null });\n\n const { x, y } = calcXY(this.getPositionParams(), top, left, w, h);\n\n return onDragStop.call(this, i, x, y, {\n e,\n node,\n newPosition\n });\n };\n\n /**\n * onResizeStop event handler\n * @param {Event} e event data\n * @param {Object} callbackData an object with node and size information\n */\n onResizeStop = (\n e: Event,\n callbackData: { node: HTMLElement, size: Position }\n ) => {\n this.onResizeHandler(e, callbackData, \"onResizeStop\");\n };\n\n /**\n * onResizeStart event handler\n * @param {Event} e event data\n * @param {Object} callbackData an object with node and size information\n */\n onResizeStart = (\n e: Event,\n callbackData: { node: HTMLElement, size: Position }\n ) => {\n this.onResizeHandler(e, callbackData, \"onResizeStart\");\n };\n\n /**\n * onResize event handler\n * @param {Event} e event data\n * @param {Object} callbackData an object with node and size information\n */\n onResize = (\n e: Event,\n callbackData: { node: HTMLElement, size: Position }\n ) => {\n this.onResizeHandler(e, callbackData, \"onResize\");\n };\n\n /**\n * Wrapper around drag events to provide more useful data.\n * All drag events call the function with the given handler name,\n * with the signature (index, x, y).\n *\n * @param {String} handlerName Handler name to wrap.\n * @return {Function} Handler function.\n */\n onResizeHandler(\n e: Event,\n { node, size }: { node: HTMLElement, size: Position },\n handlerName: string\n ) {\n const handler = this.props[handlerName];\n if (!handler) return;\n const { cols, x, y, i, maxH, minH } = this.props;\n let { minW, maxW } = this.props;\n\n // Get new XY\n let { w, h } = calcWH(\n this.getPositionParams(),\n size.width,\n size.height,\n x,\n y\n );\n\n // minW should be at least 1 (TODO propTypes validation?)\n minW = Math.max(minW, 1);\n\n // maxW should be at most (cols - x)\n maxW = Math.min(maxW, cols - x);\n\n // Min/max capping\n w = clamp(w, minW, maxW);\n h = clamp(h, minH, maxH);\n\n this.setState({ resizing: handlerName === \"onResizeStop\" ? null : size });\n\n handler.call(this, i, w, h, { e, node, size });\n }\n\n render(): ReactNode {\n const {\n x,\n y,\n w,\n h,\n isDraggable,\n isResizable,\n droppingPosition,\n useCSSTransforms\n } = this.props;\n\n const pos = calcGridItemPosition(\n this.getPositionParams(),\n x,\n y,\n w,\n h,\n this.state\n );\n const child = React.Children.only(this.props.children);\n\n // Create the child element. We clone the existing element but modify its className and style.\n let newChild = React.cloneElement(child, {\n className: classNames(\n \"react-grid-item\",\n child.props.className,\n this.props.className,\n {\n static: this.props.static,\n resizing: Boolean(this.state.resizing),\n \"react-draggable\": isDraggable,\n \"react-draggable-dragging\": Boolean(this.state.dragging),\n dropping: Boolean(droppingPosition),\n cssTransforms: useCSSTransforms\n }\n ),\n // We can set the width and height on the child, but unfortunately we can't set the position.\n style: {\n ...this.props.style,\n ...child.props.style,\n ...this.createStyle(pos)\n }\n });\n\n // Resizable support. This is usually on but the user can toggle it off.\n newChild = this.mixinResizable(newChild, pos, isResizable);\n\n // Draggable support. This is always on, except for with placeholders.\n newChild = this.mixinDraggable(newChild, isDraggable);\n\n return newChild;\n }\n}\n","// @flow\nimport PropTypes from \"prop-types\";\nimport React from \"react\";\nimport type {\n Ref,\n ChildrenArray as ReactChildrenArray,\n Element as ReactElement\n} from \"react\";\nimport type { EventCallback, CompactType, Layout, LayoutItem } from \"./utils\";\n\nexport type Props = {|\n className: string,\n style: Object,\n width: number,\n autoSize: boolean,\n cols: number,\n draggableCancel: string,\n draggableHandle: string,\n verticalCompact: boolean,\n compactType: CompactType,\n layout: Layout,\n margin: [number, number],\n containerPadding: [number, number] | null,\n rowHeight: number,\n maxRows: number,\n isBounded: boolean,\n isDraggable: boolean,\n isResizable: boolean,\n isDroppable: boolean,\n preventCollision: boolean,\n useCSSTransforms: boolean,\n transformScale: number,\n droppingItem: $Shape,\n\n // Callbacks\n onLayoutChange: Layout => void,\n onDrag: EventCallback,\n onDragStart: EventCallback,\n onDragStop: EventCallback,\n onResize: EventCallback,\n onResizeStart: EventCallback,\n onResizeStop: EventCallback,\n onDrop: (layout: Layout, item: ?LayoutItem, e: Event) => void,\n children: ReactChildrenArray>,\n innerRef?: Ref<\"div\">\n|};\n\nexport default {\n //\n // Basic props\n //\n className: PropTypes.string,\n style: PropTypes.object,\n\n // This can be set explicitly. If it is not set, it will automatically\n // be set to the container width. Note that resizes will *not* cause this to adjust.\n // If you need that behavior, use WidthProvider.\n width: PropTypes.number,\n\n // If true, the container height swells and contracts to fit contents\n autoSize: PropTypes.bool,\n // # of cols.\n cols: PropTypes.number,\n\n // A selector that will not be draggable.\n draggableCancel: PropTypes.string,\n // A selector for the draggable handler\n draggableHandle: PropTypes.string,\n\n // Deprecated\n verticalCompact: function (props: Props) {\n if (\n props.verticalCompact === false &&\n process.env.NODE_ENV !== \"production\"\n ) {\n console.warn(\n // eslint-disable-line no-console\n \"`verticalCompact` on is deprecated and will be removed soon. \" +\n 'Use `compactType`: \"horizontal\" | \"vertical\" | null.'\n );\n }\n },\n // Choose vertical or hotizontal compaction\n compactType: PropTypes.oneOf([\"vertical\", \"horizontal\"]),\n\n // layout is an array of object with the format:\n // {x: Number, y: Number, w: Number, h: Number, i: String}\n layout: function (props: Props) {\n var layout = props.layout;\n // I hope you're setting the data-grid property on the grid items\n if (layout === undefined) return;\n require(\"./utils\").validateLayout(layout, \"layout\");\n },\n\n //\n // Grid Dimensions\n //\n\n // Margin between items [x, y] in px\n margin: PropTypes.arrayOf(PropTypes.number),\n // Padding inside the container [x, y] in px\n containerPadding: PropTypes.arrayOf(PropTypes.number),\n // Rows have a static height, but you can change this based on breakpoints if you like\n rowHeight: PropTypes.number,\n // Default Infinity, but you can specify a max here if you like.\n // Note that this isn't fully fleshed out and won't error if you specify a layout that\n // extends beyond the row capacity. It will, however, not allow users to drag/resize\n // an item past the barrier. They can push items beyond the barrier, though.\n // Intentionally not documented for this reason.\n maxRows: PropTypes.number,\n\n //\n // Flags\n //\n isBounded: PropTypes.bool,\n isDraggable: PropTypes.bool,\n isResizable: PropTypes.bool,\n // If true, grid items won't change position when being dragged over.\n preventCollision: PropTypes.bool,\n // Use CSS transforms instead of top/left\n useCSSTransforms: PropTypes.bool,\n // parent layout transform scale\n transformScale: PropTypes.number,\n // If true, an external element can trigger onDrop callback with a specific grid position as a parameter\n isDroppable: PropTypes.bool,\n\n //\n // Callbacks\n //\n\n // Callback so you can save the layout. Calls after each drag & resize stops.\n onLayoutChange: PropTypes.func,\n\n // Calls when drag starts. Callback is of the signature (layout, oldItem, newItem, placeholder, e, ?node).\n // All callbacks below have the same signature. 'start' and 'stop' callbacks omit the 'placeholder'.\n onDragStart: PropTypes.func,\n // Calls on each drag movement.\n onDrag: PropTypes.func,\n // Calls when drag is complete.\n onDragStop: PropTypes.func,\n //Calls when resize starts.\n onResizeStart: PropTypes.func,\n // Calls when resize movement happens.\n onResize: PropTypes.func,\n // Calls when resize is complete.\n onResizeStop: PropTypes.func,\n // Calls when some element is dropped.\n onDrop: PropTypes.func,\n\n //\n // Other validations\n //\n\n droppingItem: PropTypes.shape({\n i: PropTypes.string.isRequired,\n w: PropTypes.number.isRequired,\n h: PropTypes.number.isRequired\n }),\n\n // Children must not have duplicate keys.\n children: function (props: Props, propName: string) {\n var children = props[propName];\n\n // Check children keys for duplicates. Throw if found.\n var keys = {};\n React.Children.forEach(children, function (child) {\n if (keys[child.key]) {\n throw new Error(\n 'Duplicate child key \"' +\n child.key +\n '\" found! This will cause problems in ReactGridLayout.'\n );\n }\n keys[child.key] = true;\n });\n },\n\n // Optional ref for getting a reference for the wrapping div.\n innerRef: PropTypes.any\n};\n","// @flow\nimport React from \"react\";\n\nimport isEqual from \"lodash.isequal\";\nimport classNames from \"classnames\";\nimport {\n autoBindHandlers,\n bottom,\n childrenEqual,\n cloneLayoutItem,\n compact,\n getLayoutItem,\n moveElement,\n synchronizeLayoutWithChildren,\n getAllCollisions,\n compactType,\n noop,\n fastRGLPropsEqual\n} from \"./utils\";\n\nimport { calcXY } from \"./calculateUtils\";\n\nimport GridItem from \"./GridItem\";\nimport ReactGridLayoutPropTypes from \"./ReactGridLayoutPropTypes\";\nimport type {\n ChildrenArray as ReactChildrenArray,\n Element as ReactElement\n} from \"react\";\n\n// Types\nimport type {\n CompactType,\n GridResizeEvent,\n GridDragEvent,\n DragOverEvent,\n Layout,\n DroppingPosition,\n LayoutItem\n} from \"./utils\";\n\nimport type { PositionParams } from \"./calculateUtils\";\n\ntype State = {\n activeDrag: ?LayoutItem,\n layout: Layout,\n mounted: boolean,\n oldDragItem: ?LayoutItem,\n oldLayout: ?Layout,\n oldResizeItem: ?LayoutItem,\n droppingDOMNode: ?ReactElement,\n droppingPosition?: DroppingPosition,\n // Mirrored props\n children: ReactChildrenArray>,\n compactType?: CompactType,\n propsLayout?: Layout\n};\n\nimport type { Props } from \"./ReactGridLayoutPropTypes\";\n\n// End Types\n\nconst layoutClassName = \"react-grid-layout\";\nlet isFirefox = false;\n// Try...catch will protect from navigator not existing (e.g. node) or a bad implementation of navigator\ntry {\n isFirefox = /firefox/i.test(navigator.userAgent);\n} catch (e) {\n /* Ignore */\n}\n\n/**\n * A reactive, fluid grid layout with draggable, resizable components.\n */\n\nexport default class ReactGridLayout extends React.Component {\n // TODO publish internal ReactClass displayName transform\n static displayName = \"ReactGridLayout\";\n\n // Refactored to another module to make way for preval\n static propTypes = ReactGridLayoutPropTypes;\n\n static defaultProps = {\n autoSize: true,\n cols: 12,\n className: \"\",\n style: {},\n draggableHandle: \"\",\n draggableCancel: \"\",\n containerPadding: null,\n rowHeight: 150,\n maxRows: Infinity, // infinite vertical growth\n layout: [],\n margin: [10, 10],\n isBounded: false,\n isDraggable: true,\n isResizable: true,\n isDroppable: false,\n useCSSTransforms: true,\n transformScale: 1,\n verticalCompact: true,\n compactType: \"vertical\",\n preventCollision: false,\n droppingItem: {\n i: \"__dropping-elem__\",\n h: 1,\n w: 1\n },\n onLayoutChange: noop,\n onDragStart: noop,\n onDrag: noop,\n onDragStop: noop,\n onResizeStart: noop,\n onResize: noop,\n onResizeStop: noop,\n onDrop: noop\n };\n\n state: State = {\n activeDrag: null,\n layout: synchronizeLayoutWithChildren(\n this.props.layout,\n this.props.children,\n this.props.cols,\n // Legacy support for verticalCompact: false\n compactType(this.props)\n ),\n mounted: false,\n oldDragItem: null,\n oldLayout: null,\n oldResizeItem: null,\n droppingDOMNode: null,\n children: []\n };\n\n dragEnterCounter = 0;\n\n constructor(props: Props, context: any): void {\n super(props, context);\n autoBindHandlers(this, [\n \"onDragStart\",\n \"onDrag\",\n \"onDragStop\",\n \"onResizeStart\",\n \"onResize\",\n \"onResizeStop\"\n ]);\n }\n\n componentDidMount() {\n this.setState({ mounted: true });\n // Possibly call back with layout on mount. This should be done after correcting the layout width\n // to ensure we don't rerender with the wrong width.\n this.onLayoutMaybeChanged(this.state.layout, this.props.layout);\n }\n\n static getDerivedStateFromProps(nextProps: Props, prevState: State) {\n let newLayoutBase;\n\n if (prevState.activeDrag) {\n return null;\n }\n\n // Legacy support for compactType\n // Allow parent to set layout directly.\n if (\n !isEqual(nextProps.layout, prevState.propsLayout) ||\n nextProps.compactType !== prevState.compactType\n ) {\n newLayoutBase = nextProps.layout;\n } else if (!childrenEqual(nextProps.children, prevState.children)) {\n // If children change, also regenerate the layout. Use our state\n // as the base in case because it may be more up to date than\n // what is in props.\n newLayoutBase = prevState.layout;\n }\n\n // We need to regenerate the layout.\n if (newLayoutBase) {\n const newLayout = synchronizeLayoutWithChildren(\n newLayoutBase,\n nextProps.children,\n nextProps.cols,\n compactType(nextProps)\n );\n\n return {\n layout: newLayout,\n // We need to save these props to state for using\n // getDerivedStateFromProps instead of componentDidMount (in which we would get extra rerender)\n compactType: nextProps.compactType,\n children: nextProps.children,\n propsLayout: nextProps.layout\n };\n }\n\n return null;\n }\n\n shouldComponentUpdate(nextProps: Props, nextState: State) {\n return (\n // NOTE: this is almost always unequal. Therefore the only way to get better performance\n // from SCU is if the user intentionally memoizes children. If they do, and they can\n // handle changes properly, performance will increase.\n this.props.children !== nextProps.children ||\n !fastRGLPropsEqual(this.props, nextProps, isEqual) ||\n this.state.activeDrag !== nextState.activeDrag ||\n this.state.mounted !== nextState.mounted ||\n this.state.droppingPosition !== nextState.droppingPosition\n );\n }\n\n componentDidUpdate(prevProps: Props, prevState: State) {\n if (!this.state.activeDrag) {\n const newLayout = this.state.layout;\n const oldLayout = prevState.layout;\n\n this.onLayoutMaybeChanged(newLayout, oldLayout);\n }\n }\n\n /**\n * Calculates a pixel value for the container.\n * @return {String} Container height in pixels.\n */\n containerHeight() {\n if (!this.props.autoSize) return;\n const nbRow = bottom(this.state.layout);\n const containerPaddingY = this.props.containerPadding\n ? this.props.containerPadding[1]\n : this.props.margin[1];\n return (\n nbRow * this.props.rowHeight +\n (nbRow - 1) * this.props.margin[1] +\n containerPaddingY * 2 +\n \"px\"\n );\n }\n\n /**\n * When dragging starts\n * @param {String} i Id of the child\n * @param {Number} x X position of the move\n * @param {Number} y Y position of the move\n * @param {Event} e The mousedown event\n * @param {Element} node The current dragging DOM element\n */\n onDragStart(i: string, x: number, y: number, { e, node }: GridDragEvent) {\n const { layout } = this.state;\n var l = getLayoutItem(layout, i);\n if (!l) return;\n\n this.setState({\n oldDragItem: cloneLayoutItem(l),\n oldLayout: this.state.layout\n });\n\n return this.props.onDragStart(layout, l, l, null, e, node);\n }\n\n /**\n * Each drag movement create a new dragelement and move the element to the dragged location\n * @param {String} i Id of the child\n * @param {Number} x X position of the move\n * @param {Number} y Y position of the move\n * @param {Event} e The mousedown event\n * @param {Element} node The current dragging DOM element\n */\n onDrag(i: string, x: number, y: number, { e, node }: GridDragEvent) {\n const { oldDragItem } = this.state;\n let { layout } = this.state;\n const { cols } = this.props;\n var l = getLayoutItem(layout, i);\n if (!l) return;\n\n // Create placeholder (display only)\n var placeholder = {\n w: l.w,\n h: l.h,\n x: l.x,\n y: l.y,\n placeholder: true,\n i: i\n };\n\n // Move the element to the dragged location.\n const isUserAction = true;\n layout = moveElement(\n layout,\n l,\n x,\n y,\n isUserAction,\n this.props.preventCollision,\n compactType(this.props),\n cols\n );\n\n this.props.onDrag(layout, oldDragItem, l, placeholder, e, node);\n\n this.setState({\n layout: compact(layout, compactType(this.props), cols),\n activeDrag: placeholder\n });\n }\n\n /**\n * When dragging stops, figure out which position the element is closest to and update its x and y.\n * @param {String} i Index of the child.\n * @param {Number} x X position of the move\n * @param {Number} y Y position of the move\n * @param {Event} e The mousedown event\n * @param {Element} node The current dragging DOM element\n */\n onDragStop(i: string, x: number, y: number, { e, node }: GridDragEvent) {\n if (!this.state.activeDrag) return;\n\n const { oldDragItem } = this.state;\n let { layout } = this.state;\n const { cols, preventCollision } = this.props;\n const l = getLayoutItem(layout, i);\n if (!l) return;\n\n // Move the element here\n const isUserAction = true;\n layout = moveElement(\n layout,\n l,\n x,\n y,\n isUserAction,\n preventCollision,\n compactType(this.props),\n cols\n );\n\n this.props.onDragStop(layout, oldDragItem, l, null, e, node);\n\n // Set state\n const newLayout = compact(layout, compactType(this.props), cols);\n const { oldLayout } = this.state;\n this.setState({\n activeDrag: null,\n layout: newLayout,\n oldDragItem: null,\n oldLayout: null\n });\n\n this.onLayoutMaybeChanged(newLayout, oldLayout);\n }\n\n onLayoutMaybeChanged(newLayout: Layout, oldLayout: ?Layout) {\n if (!oldLayout) oldLayout = this.state.layout;\n\n if (!isEqual(oldLayout, newLayout)) {\n this.props.onLayoutChange(newLayout);\n }\n }\n\n onResizeStart(i: string, w: number, h: number, { e, node }: GridResizeEvent) {\n const { layout } = this.state;\n var l = getLayoutItem(layout, i);\n if (!l) return;\n\n this.setState({\n oldResizeItem: cloneLayoutItem(l),\n oldLayout: this.state.layout\n });\n\n this.props.onResizeStart(layout, l, l, null, e, node);\n }\n\n onResize(i: string, w: number, h: number, { e, node }: GridResizeEvent) {\n const { layout, oldResizeItem } = this.state;\n const { cols, preventCollision } = this.props;\n const l: ?LayoutItem = getLayoutItem(layout, i);\n if (!l) return;\n\n // Something like quad tree should be used\n // to find collisions faster\n let hasCollisions;\n if (preventCollision) {\n const collisions = getAllCollisions(layout, { ...l, w, h }).filter(\n layoutItem => layoutItem.i !== l.i\n );\n hasCollisions = collisions.length > 0;\n\n // If we're colliding, we need adjust the placeholder.\n if (hasCollisions) {\n // adjust w && h to maximum allowed space\n let leastX = Infinity,\n leastY = Infinity;\n collisions.forEach(layoutItem => {\n if (layoutItem.x > l.x) leastX = Math.min(leastX, layoutItem.x);\n if (layoutItem.y > l.y) leastY = Math.min(leastY, layoutItem.y);\n });\n\n if (Number.isFinite(leastX)) l.w = leastX - l.x;\n if (Number.isFinite(leastY)) l.h = leastY - l.y;\n }\n }\n\n if (!hasCollisions) {\n // Set new width and height.\n l.w = w;\n l.h = h;\n }\n\n // Create placeholder element (display only)\n var placeholder = {\n w: l.w,\n h: l.h,\n x: l.x,\n y: l.y,\n static: true,\n i: i\n };\n\n this.props.onResize(layout, oldResizeItem, l, placeholder, e, node);\n\n // Re-compact the layout and set the drag placeholder.\n this.setState({\n layout: compact(layout, compactType(this.props), cols),\n activeDrag: placeholder\n });\n }\n\n onResizeStop(i: string, w: number, h: number, { e, node }: GridResizeEvent) {\n const { layout, oldResizeItem } = this.state;\n const { cols } = this.props;\n var l = getLayoutItem(layout, i);\n\n this.props.onResizeStop(layout, oldResizeItem, l, null, e, node);\n\n // Set state\n const newLayout = compact(layout, compactType(this.props), cols);\n const { oldLayout } = this.state;\n this.setState({\n activeDrag: null,\n layout: newLayout,\n oldResizeItem: null,\n oldLayout: null\n });\n\n this.onLayoutMaybeChanged(newLayout, oldLayout);\n }\n\n /**\n * Create a placeholder object.\n * @return {Element} Placeholder div.\n */\n placeholder(): ?ReactElement {\n const { activeDrag } = this.state;\n if (!activeDrag) return null;\n const {\n width,\n cols,\n margin,\n containerPadding,\n rowHeight,\n maxRows,\n useCSSTransforms,\n transformScale\n } = this.props;\n\n // {...this.state.activeDrag} is pretty slow, actually\n return (\n \n
\n \n );\n }\n\n /**\n * Given a grid item, set its style attributes & surround in a .\n * @param {Element} child React element.\n * @return {Element} Element wrapped in draggable and properly placed.\n */\n processGridItem(\n child: ReactElement,\n isDroppingItem?: boolean\n ): ?ReactElement {\n if (!child || !child.key) return;\n const l = getLayoutItem(this.state.layout, String(child.key));\n if (!l) return null;\n const {\n width,\n cols,\n margin,\n containerPadding,\n rowHeight,\n maxRows,\n isDraggable,\n isResizable,\n isBounded,\n useCSSTransforms,\n transformScale,\n draggableCancel,\n draggableHandle\n } = this.props;\n const { mounted, droppingPosition } = this.state;\n\n // Determine user manipulations possible.\n // If an item is static, it can't be manipulated by default.\n // Any properties defined directly on the grid item will take precedence.\n const draggable =\n typeof l.isDraggable === \"boolean\"\n ? l.isDraggable\n : !l.static && isDraggable;\n const resizable =\n typeof l.isResizable === \"boolean\"\n ? l.isResizable\n : !l.static && isResizable;\n\n // isBounded set on child if set on parent, and child is not explicitly false\n const bounded = draggable && isBounded && l.isBounded !== false;\n\n return (\n \n {child}\n \n );\n }\n\n // Called while dragging an element. Part of browser native drag/drop API.\n // Native event target might be the layout itself, or an element within the layout.\n onDragOver = (e: DragOverEvent) => {\n // we should ignore events from layout's children in Firefox\n // to avoid unpredictable jumping of a dropping placeholder\n // FIXME remove this hack\n if (\n isFirefox &&\n e.nativeEvent.target.className.indexOf(layoutClassName) === -1\n ) {\n return false;\n }\n\n const {\n droppingItem,\n margin,\n cols,\n rowHeight,\n maxRows,\n width,\n containerPadding\n } = this.props;\n const { layout } = this.state;\n // This is relative to the DOM element that this event fired for.\n const { layerX, layerY } = e.nativeEvent;\n const droppingPosition = { left: layerX, top: layerY, e };\n\n if (!this.state.droppingDOMNode) {\n const positionParams: PositionParams = {\n cols,\n margin,\n maxRows,\n rowHeight,\n containerWidth: width,\n containerPadding: containerPadding || margin\n };\n\n const calculatedPosition = calcXY(\n positionParams,\n layerY,\n layerX,\n droppingItem.w,\n droppingItem.h\n );\n\n this.setState({\n droppingDOMNode:
,\n droppingPosition,\n layout: [\n ...layout,\n {\n ...droppingItem,\n x: calculatedPosition.x,\n y: calculatedPosition.y,\n static: false,\n isDraggable: true\n }\n ]\n });\n } else if (this.state.droppingPosition) {\n const { left, top } = this.state.droppingPosition;\n const shouldUpdatePosition = left != layerX || top != layerY;\n if (shouldUpdatePosition) {\n this.setState({ droppingPosition });\n }\n }\n\n e.stopPropagation();\n e.preventDefault();\n };\n\n removeDroppingPlaceholder = () => {\n const { droppingItem, cols } = this.props;\n const { layout } = this.state;\n\n const newLayout = compact(\n layout.filter(l => l.i !== droppingItem.i),\n compactType(this.props),\n cols\n );\n\n this.setState({\n layout: newLayout,\n droppingDOMNode: null,\n activeDrag: null,\n droppingPosition: undefined\n });\n };\n\n onDragLeave = () => {\n this.dragEnterCounter--;\n\n // onDragLeave can be triggered on each layout's child.\n // But we know that count of dragEnter and dragLeave events\n // will be balanced after leaving the layout's container\n // so we can increase and decrease count of dragEnter and\n // when it'll be equal to 0 we'll remove the placeholder\n if (this.dragEnterCounter === 0) {\n this.removeDroppingPlaceholder();\n }\n };\n\n onDragEnter = () => {\n this.dragEnterCounter++;\n };\n\n onDrop = (e: Event) => {\n const { droppingItem } = this.props;\n const { layout } = this.state;\n const item = layout.find(l => l.i === droppingItem.i);\n\n // reset gragEnter counter on drop\n this.dragEnterCounter = 0;\n\n this.removeDroppingPlaceholder();\n\n this.props.onDrop(layout, item, e);\n };\n\n render() {\n const { className, style, isDroppable, innerRef } = this.props;\n\n const mergedClassName = classNames(layoutClassName, className);\n const mergedStyle = {\n height: this.containerHeight(),\n ...style\n };\n\n return (\n \n {React.Children.map(this.props.children, child =>\n this.processGridItem(child)\n )}\n {isDroppable &&\n this.state.droppingDOMNode &&\n this.processGridItem(this.state.droppingDOMNode, true)}\n {this.placeholder()}\n
\n );\n }\n}\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _reactDraggable = require(\"react-draggable\");\n\nvar _utils = require(\"./utils\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar Resizable =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Resizable, _React$Component);\n\n function Resizable() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n slackW: 0,\n slackH: 0\n });\n\n return _this;\n }\n\n var _proto = Resizable.prototype;\n\n _proto.lockAspectRatio = function lockAspectRatio(width, height, aspectRatio) {\n height = width / aspectRatio;\n width = height * aspectRatio;\n return [width, height];\n } // If you do this, be careful of constraints\n ;\n\n _proto.runConstraints = function runConstraints(width, height) {\n var _ref = [this.props.minConstraints, this.props.maxConstraints],\n min = _ref[0],\n max = _ref[1];\n if (!min && !max) return [width, height]; // Fit width & height to aspect ratio\n\n if (this.props.lockAspectRatio) {\n if (height === this.props.height) {\n var ratio = this.props.width / this.props.height;\n height = width / ratio;\n width = height * ratio;\n } else {\n // Take into account vertical resize with N/S handles on locked aspect\n // ratio. Calculate the change height-first, instead of width-first\n var _ratio = this.props.height / this.props.width;\n\n width = height / _ratio;\n height = width * _ratio;\n }\n }\n\n var oldW = width,\n oldH = height; // Add slack to the values used to calculate bound position. This will ensure that if\n // we start removing slack, the element won't react to it right away until it's been\n // completely removed.\n\n var _this$state = this.state,\n slackW = _this$state.slackW,\n slackH = _this$state.slackH;\n width += slackW;\n height += slackH;\n\n if (min) {\n width = Math.max(min[0], width);\n height = Math.max(min[1], height);\n }\n\n if (max) {\n width = Math.min(max[0], width);\n height = Math.min(max[1], height);\n } // If the numbers changed, we must have introduced some slack. Record it for the next iteration.\n\n\n slackW += oldW - width;\n slackH += oldH - height;\n\n if (slackW !== this.state.slackW || slackH !== this.state.slackH) {\n this.setState({\n slackW: slackW,\n slackH: slackH\n });\n }\n\n return [width, height];\n }\n /**\n * Wrapper around drag events to provide more useful data.\n *\n * @param {String} handlerName Handler name to wrap.\n * @return {Function} Handler function.\n */\n ;\n\n _proto.resizeHandler = function resizeHandler(handlerName, axis) {\n var _this2 = this;\n\n return function (e, _ref2) {\n var node = _ref2.node,\n deltaX = _ref2.deltaX,\n deltaY = _ref2.deltaY;\n deltaX /= _this2.props.transformScale;\n deltaY /= _this2.props.transformScale; // Axis restrictions\n\n var canDragX = (_this2.props.axis === 'both' || _this2.props.axis === 'x') && ['n', 's'].indexOf(axis) === -1;\n var canDragY = (_this2.props.axis === 'both' || _this2.props.axis === 'y') && ['e', 'w'].indexOf(axis) === -1; // reverse delta if using top or left drag handles\n\n if (canDragX && axis[axis.length - 1] === 'w') {\n deltaX = -deltaX;\n }\n\n if (canDragY && axis[0] === 'n') {\n deltaY = -deltaY;\n } // Update w/h\n\n\n var width = _this2.props.width + (canDragX ? deltaX : 0);\n var height = _this2.props.height + (canDragY ? deltaY : 0); // Early return if no change\n\n var widthChanged = width !== _this2.props.width,\n heightChanged = height !== _this2.props.height;\n if (handlerName === 'onResize' && !widthChanged && !heightChanged) return;\n\n var _this2$runConstraints = _this2.runConstraints(width, height);\n\n width = _this2$runConstraints[0];\n height = _this2$runConstraints[1];\n // Set the appropriate state for this handler.\n var newState = {};\n\n if (handlerName === 'onResizeStart') {// nothing\n } else if (handlerName === 'onResizeStop') {\n newState.slackW = newState.slackH = 0;\n } else {\n // Early return if no change after constraints\n if (width === _this2.props.width && height === _this2.props.height) return;\n }\n\n var hasCb = typeof _this2.props[handlerName] === 'function';\n\n if (hasCb) {\n // $FlowIgnore isn't refining this correctly to SyntheticEvent\n if (typeof e.persist === 'function') e.persist();\n\n _this2.setState(newState, function () {\n return _this2.props[handlerName](e, {\n node: node,\n size: {\n width: width,\n height: height\n },\n handle: axis\n });\n });\n } else {\n _this2.setState(newState);\n }\n };\n };\n\n _proto.renderResizeHandle = function renderResizeHandle(resizeHandle) {\n var handle = this.props.handle;\n\n if (handle) {\n if (typeof handle === 'function') {\n return handle(resizeHandle);\n }\n\n return handle;\n }\n\n return _react.default.createElement(\"span\", {\n className: \"react-resizable-handle react-resizable-handle-\" + resizeHandle\n });\n };\n\n _proto.render = function render() {\n var _this3 = this;\n\n // eslint-disable-next-line no-unused-vars\n var _this$props = this.props,\n children = _this$props.children,\n draggableOpts = _this$props.draggableOpts,\n width = _this$props.width,\n height = _this$props.height,\n handleSize = _this$props.handleSize,\n lockAspectRatio = _this$props.lockAspectRatio,\n axis = _this$props.axis,\n minConstraints = _this$props.minConstraints,\n maxConstraints = _this$props.maxConstraints,\n onResize = _this$props.onResize,\n onResizeStop = _this$props.onResizeStop,\n onResizeStart = _this$props.onResizeStart,\n resizeHandles = _this$props.resizeHandles,\n transformScale = _this$props.transformScale,\n p = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"draggableOpts\", \"width\", \"height\", \"handleSize\", \"lockAspectRatio\", \"axis\", \"minConstraints\", \"maxConstraints\", \"onResize\", \"onResizeStop\", \"onResizeStart\", \"resizeHandles\", \"transformScale\"]);\n\n var className = p.className ? p.className + \" react-resizable\" : 'react-resizable'; // What we're doing here is getting the child of this element, and cloning it with this element's props.\n // We are then defining its children as:\n // Its original children (resizable's child's children), and\n // One or more draggable handles.\n\n return (0, _utils.cloneElement)(children, _objectSpread({}, p, {\n className: className,\n children: [children.props.children, resizeHandles.map(function (h) {\n return _react.default.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {\n key: \"resizableHandle-\" + h,\n onStop: _this3.resizeHandler('onResizeStop', h),\n onStart: _this3.resizeHandler('onResizeStart', h),\n onDrag: _this3.resizeHandler('onResize', h)\n }), _this3.renderResizeHandle(h));\n })]\n }));\n };\n\n return Resizable;\n}(_react.default.Component);\n\nexports.default = Resizable;\n\n_defineProperty(Resizable, \"propTypes\", {\n //\n // Required Props\n //\n // Require that one and only one child be present.\n children: _propTypes.default.element.isRequired,\n // Initial w/h\n width: _propTypes.default.number.isRequired,\n height: _propTypes.default.number.isRequired,\n //\n // Optional props\n //\n // Custom resize handle\n handle: _propTypes.default.element,\n // If you change this, be sure to update your css\n handleSize: _propTypes.default.array,\n // Defines which resize handles should be rendered (default: 'se')\n // Allows for any combination of:\n // 's' - South handle (bottom-center)\n // 'w' - West handle (left-center)\n // 'e' - East handle (right-center)\n // 'n' - North handle (top-center)\n // 'sw' - Southwest handle (bottom-left)\n // 'nw' - Northwest handle (top-left)\n // 'se' - Southeast handle (bottom-right)\n // 'ne' - Northeast handle (top-center)\n resizeHandles: _propTypes.default.arrayOf(_propTypes.default.oneOf(['s', 'w', 'e', 'n', 'sw', 'nw', 'se', 'ne'])),\n transformScale: _propTypes.default.number,\n // If true, will only allow width/height to move in lockstep\n lockAspectRatio: _propTypes.default.bool,\n // Restricts resizing to a particular axis (default: 'both')\n // 'both' - allows resizing by width or height\n // 'x' - only allows the width to be changed\n // 'y' - only allows the height to be changed\n // 'none' - disables resizing altogether\n axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),\n // Min/max size\n minConstraints: _propTypes.default.arrayOf(_propTypes.default.number),\n maxConstraints: _propTypes.default.arrayOf(_propTypes.default.number),\n // Callbacks\n onResizeStop: _propTypes.default.func,\n onResizeStart: _propTypes.default.func,\n onResize: _propTypes.default.func,\n // These will be passed wholesale to react-draggable's DraggableCore\n draggableOpts: _propTypes.default.object\n});\n\n_defineProperty(Resizable, \"defaultProps\", {\n handleSize: [20, 20],\n lockAspectRatio: false,\n axis: 'both',\n minConstraints: [20, 20],\n maxConstraints: [Infinity, Infinity],\n resizeHandles: ['se'],\n transformScale: 1\n});","'use strict';\nmodule.exports = function() {\n throw new Error(\"Don't instantiate Resizable directly! Use require('react-resizable').Resizable\");\n};\n\nmodule.exports.Resizable = require('./build/Resizable').default;\nmodule.exports.ResizableBox = require('./build/ResizableBox').default;\n","module.exports = require(\"./lib/ReactGridLayout\").default;\nmodule.exports.utils = require(\"./lib/utils\");\nmodule.exports.Responsive = require(\"./lib/ResponsiveReactGridLayout\").default;\nmodule.exports.Responsive.utils = require(\"./lib/responsiveUtils\");\nmodule.exports.WidthProvider = require(\"./lib/components/WidthProvider\").default;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.cloneElement = cloneElement;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// React.addons.cloneWithProps look-alike that merges style & className.\nfunction cloneElement(element, props) {\n if (props.style && element.props.style) {\n props.style = _objectSpread({}, element.props.style, {}, props.style);\n }\n\n if (props.className && element.props.className) {\n props.className = element.props.className + \" \" + props.className;\n }\n\n return _react.default.cloneElement(element, props);\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _Resizable = _interopRequireDefault(require(\"./Resizable\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// An example use of Resizable.\nvar ResizableBox =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(ResizableBox, _React$Component);\n\n function ResizableBox() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n width: _this.props.width,\n height: _this.props.height,\n propsWidth: _this.props.width,\n propsHeight: _this.props.height\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onResize\", function (e, data) {\n var size = data.size;\n var width = size.width,\n height = size.height;\n\n if (_this.props.onResize) {\n e.persist && e.persist();\n\n _this.setState(size, function () {\n return _this.props.onResize && _this.props.onResize(e, data);\n });\n } else {\n _this.setState(size);\n }\n });\n\n return _this;\n }\n\n ResizableBox.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {\n // If parent changes height/width, set that in our state.\n if (state.propsWidth !== props.width || state.propsHeight !== props.height) {\n return {\n width: props.width,\n height: props.height,\n propsWidth: props.width,\n propsHeight: props.height\n };\n }\n\n return null;\n };\n\n var _proto = ResizableBox.prototype;\n\n _proto.render = function render() {\n // Basic wrapper around a Resizable instance.\n // If you use Resizable directly, you are responsible for updating the child component\n // with a new width and height.\n var _this$props = this.props,\n handle = _this$props.handle,\n handleSize = _this$props.handleSize,\n onResize = _this$props.onResize,\n onResizeStart = _this$props.onResizeStart,\n onResizeStop = _this$props.onResizeStop,\n draggableOpts = _this$props.draggableOpts,\n minConstraints = _this$props.minConstraints,\n maxConstraints = _this$props.maxConstraints,\n lockAspectRatio = _this$props.lockAspectRatio,\n axis = _this$props.axis,\n width = _this$props.width,\n height = _this$props.height,\n resizeHandles = _this$props.resizeHandles,\n props = _objectWithoutPropertiesLoose(_this$props, [\"handle\", \"handleSize\", \"onResize\", \"onResizeStart\", \"onResizeStop\", \"draggableOpts\", \"minConstraints\", \"maxConstraints\", \"lockAspectRatio\", \"axis\", \"width\", \"height\", \"resizeHandles\"]);\n\n return _react.default.createElement(_Resizable.default, {\n handle: handle,\n handleSize: handleSize,\n width: this.state.width,\n height: this.state.height,\n onResizeStart: onResizeStart,\n onResize: this.onResize,\n onResizeStop: onResizeStop,\n draggableOpts: draggableOpts,\n minConstraints: minConstraints,\n maxConstraints: maxConstraints,\n lockAspectRatio: lockAspectRatio,\n axis: axis,\n resizeHandles: resizeHandles\n }, _react.default.createElement(\"div\", _extends({\n style: {\n width: this.state.width + 'px',\n height: this.state.height + 'px'\n }\n }, props)));\n };\n\n return ResizableBox;\n}(_react.default.Component);\n\nexports.default = ResizableBox;\n\n_defineProperty(ResizableBox, \"propTypes\", {\n height: _propTypes.default.number,\n width: _propTypes.default.number\n});\n\n_defineProperty(ResizableBox, \"defaultProps\", {\n handleSize: [20, 20]\n});","// @flow\nimport * as React from \"react\";\nimport PropTypes from \"prop-types\";\nimport isEqual from \"lodash.isequal\";\n\nimport {\n cloneLayout,\n synchronizeLayoutWithChildren,\n validateLayout,\n noop,\n type Layout\n} from \"./utils\";\nimport {\n getBreakpointFromWidth,\n getColsFromBreakpoint,\n findOrGenerateResponsiveLayout,\n type ResponsiveLayout,\n type Breakpoints\n} from \"./responsiveUtils\";\nimport ReactGridLayout from \"./ReactGridLayout\";\n\nconst type = obj => Object.prototype.toString.call(obj);\n\n/**\n * Get a value of margin or containerPadding.\n *\n * @param {Array | Object} param Margin | containerPadding, e.g. [10, 10] | {lg: [10, 10], ...}.\n * @param {String} breakpoint Breakpoint: lg, md, sm, xs and etc.\n * @return {Array}\n */\n\nfunction getIndentationValue(\n param: { [key: string]: [number, number] } | [number, number],\n breakpoint: string\n) {\n return Array.isArray(param) ? param : param[breakpoint];\n}\n\ntype State = {\n layout: Layout,\n breakpoint: string,\n cols: number,\n layouts?: { [key: string]: Layout }\n};\n\ntype Props = {|\n ...React.ElementConfig,\n\n // Responsive config\n breakpoint?: ?Breakpoint,\n breakpoints: Breakpoints,\n cols: { [key: Breakpoint]: number },\n layouts: ResponsiveLayout,\n width: number,\n margin: { [key: Breakpoint]: [number, number] } | [number, number],\n containerPadding: { [key: Breakpoint]: [number, number] } | [number, number],\n\n // Callbacks\n onBreakpointChange: (Breakpoint, cols: number) => void,\n onLayoutChange: (Layout, { [key: Breakpoint]: Layout }) => void,\n onWidthChange: (\n containerWidth: number,\n margin: [number, number],\n cols: number,\n containerPadding: [number, number] | null\n ) => void\n|};\n\nexport default class ResponsiveReactGridLayout extends React.Component<\n Props<>,\n State\n> {\n // This should only include propTypes needed in this code; RGL itself\n // will do validation of the rest props passed to it.\n static propTypes = {\n //\n // Basic props\n //\n\n // Optional, but if you are managing width yourself you may want to set the breakpoint\n // yourself as well.\n breakpoint: PropTypes.string,\n\n // {name: pxVal}, e.g. {lg: 1200, md: 996, sm: 768, xs: 480}\n breakpoints: PropTypes.object,\n\n // # of cols. This is a breakpoint -> cols map\n cols: PropTypes.object,\n\n // # of margin. This is a breakpoint -> margin map\n // e.g. { lg: [5, 5], md: [10, 10], sm: [15, 15] }\n // Margin between items [x, y] in px\n // e.g. [10, 10]\n margin: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n\n // # of containerPadding. This is a breakpoint -> containerPadding map\n // e.g. { lg: [5, 5], md: [10, 10], sm: [15, 15] }\n // Padding inside the container [x, y] in px\n // e.g. [10, 10]\n containerPadding: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\n\n // layouts is an object mapping breakpoints to layouts.\n // e.g. {lg: Layout, md: Layout, ...}\n layouts(props: Props<>, propName: string) {\n if (type(props[propName]) !== \"[object Object]\") {\n throw new Error(\n \"Layout property must be an object. Received: \" +\n type(props[propName])\n );\n }\n Object.keys(props[propName]).forEach(key => {\n if (!(key in props.breakpoints)) {\n throw new Error(\n \"Each key in layouts must align with a key in breakpoints.\"\n );\n }\n validateLayout(props.layouts[key], \"layouts.\" + key);\n });\n },\n\n // The width of this component.\n // Required in this propTypes stanza because generateInitialState() will fail without it.\n width: PropTypes.number.isRequired,\n\n //\n // Callbacks\n //\n\n // Calls back with breakpoint and new # cols\n onBreakpointChange: PropTypes.func,\n\n // Callback so you can save the layout.\n // Calls back with (currentLayout, allLayouts). allLayouts are keyed by breakpoint.\n onLayoutChange: PropTypes.func,\n\n // Calls back with (containerWidth, margin, cols, containerPadding)\n onWidthChange: PropTypes.func\n };\n\n static defaultProps = {\n breakpoints: { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 },\n cols: { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 },\n layouts: {},\n margin: [10, 10],\n containerPadding: {\n lg: [0, 0],\n md: [0, 0],\n sm: [0, 0],\n xs: [0, 0],\n xxs: [0, 0]\n },\n onBreakpointChange: noop,\n onLayoutChange: noop,\n onWidthChange: noop\n };\n\n state = this.generateInitialState();\n\n generateInitialState(): State {\n const { width, breakpoints, layouts, cols } = this.props;\n const breakpoint = getBreakpointFromWidth(breakpoints, width);\n const colNo = getColsFromBreakpoint(breakpoint, cols);\n // verticalCompact compatibility, now deprecated\n const compactType =\n this.props.verticalCompact === false ? null : this.props.compactType;\n // Get the initial layout. This can tricky; we try to generate one however possible if one doesn't exist\n // for this layout.\n const initialLayout = findOrGenerateResponsiveLayout(\n layouts,\n breakpoints,\n breakpoint,\n breakpoint,\n colNo,\n compactType\n );\n\n return {\n layout: initialLayout,\n breakpoint: breakpoint,\n cols: colNo\n };\n }\n\n static getDerivedStateFromProps(nextProps: Props<*>, prevState: State) {\n if (!isEqual(nextProps.layouts, prevState.layouts)) {\n // Allow parent to set layouts directly.\n const { breakpoint, cols } = prevState;\n\n // Since we're setting an entirely new layout object, we must generate a new responsive layout\n // if one does not exist.\n const newLayout = findOrGenerateResponsiveLayout(\n nextProps.layouts,\n nextProps.breakpoints,\n breakpoint,\n breakpoint,\n cols,\n nextProps.compactType\n );\n return { layout: newLayout, layouts: nextProps.layouts };\n }\n\n return null;\n }\n\n componentDidUpdate(prevProps: Props<*>) {\n // Allow parent to set width or breakpoint directly.\n if (\n this.props.width != prevProps.width ||\n this.props.breakpoint !== prevProps.breakpoint ||\n !isEqual(this.props.breakpoints, prevProps.breakpoints) ||\n !isEqual(this.props.cols, prevProps.cols)\n ) {\n this.onWidthChange(prevProps);\n }\n }\n\n // wrap layouts so we do not need to pass layouts to child\n onLayoutChange = (layout: Layout) => {\n this.props.onLayoutChange(layout, {\n ...this.props.layouts,\n [this.state.breakpoint]: layout\n });\n };\n\n /**\n * When the width changes work through breakpoints and reset state with the new width & breakpoint.\n * Width changes are necessary to figure out the widget widths.\n */\n onWidthChange(prevProps: Props<*>) {\n const { breakpoints, cols, layouts, compactType } = this.props;\n const newBreakpoint =\n this.props.breakpoint ||\n getBreakpointFromWidth(this.props.breakpoints, this.props.width);\n\n const lastBreakpoint = this.state.breakpoint;\n const newCols: number = getColsFromBreakpoint(newBreakpoint, cols);\n const newLayouts = { ...layouts };\n\n // Breakpoint change\n if (\n lastBreakpoint !== newBreakpoint ||\n prevProps.breakpoints !== breakpoints ||\n prevProps.cols !== cols\n ) {\n // Preserve the current layout if the current breakpoint is not present in the next layouts.\n if (!(lastBreakpoint in newLayouts))\n newLayouts[lastBreakpoint] = cloneLayout(this.state.layout);\n\n // Find or generate a new layout.\n let layout = findOrGenerateResponsiveLayout(\n newLayouts,\n breakpoints,\n newBreakpoint,\n lastBreakpoint,\n newCols,\n compactType\n );\n\n // This adds missing items.\n layout = synchronizeLayoutWithChildren(\n layout,\n this.props.children,\n newCols,\n compactType\n );\n\n // Store the new layout.\n newLayouts[newBreakpoint] = layout;\n\n // callbacks\n this.props.onLayoutChange(layout, newLayouts);\n this.props.onBreakpointChange(newBreakpoint, newCols);\n\n this.setState({\n breakpoint: newBreakpoint,\n layout: layout,\n cols: newCols\n });\n }\n\n const margin = getIndentationValue(this.props.margin, newBreakpoint);\n const containerPadding = getIndentationValue(\n this.props.containerPadding,\n newBreakpoint\n );\n\n //call onWidthChange on every change of width, not only on breakpoint changes\n this.props.onWidthChange(\n this.props.width,\n margin,\n newCols,\n containerPadding\n );\n }\n\n render() {\n /* eslint-disable no-unused-vars */\n const {\n breakpoint,\n breakpoints,\n cols,\n layouts,\n margin,\n containerPadding,\n onBreakpointChange,\n onLayoutChange,\n onWidthChange,\n ...other\n } = this.props;\n /* eslint-enable no-unused-vars */\n\n return (\n \n );\n }\n}\n","// @flow\nimport * as React from \"react\";\nimport PropTypes from \"prop-types\";\nimport ReactDOM from \"react-dom\";\n\ntype WPDefaultProps = {|\n measureBeforeMount: boolean\n|};\n\n// eslint-disable-next-line no-unused-vars\ntype WPProps = {|\n className?: string,\n style?: Object,\n ...WPDefaultProps\n|};\n\ntype WPState = {|\n width: number\n|};\n\n/*\n * A simple HOC that provides facility for listening to container resizes.\n *\n * The Flow type is pretty janky here. I can't just spread `WPProps` into this returned object - I wish I could - but it triggers\n * a flow bug of some sort that causes it to stop typechecking.\n */\nexport default function WidthProvider(\n ComposedComponent: React.AbstractComponent\n): React.AbstractComponent<{|\n ...Config,\n measureBeforeMount?: boolean,\n className?: string,\n style?: Object,\n width?: number\n|}> {\n return class WidthProvider extends React.Component<\n {|\n ...Config,\n measureBeforeMount?: boolean,\n className?: string,\n style?: Object,\n width?: number\n |},\n WPState\n > {\n static defaultProps: WPDefaultProps = {\n measureBeforeMount: false\n };\n\n static propTypes = {\n // If true, will not render children until mounted. Useful for getting the exact width before\n // rendering, to prevent any unsightly resizing.\n measureBeforeMount: PropTypes.bool\n };\n\n state = {\n width: 1280\n };\n\n mounted: boolean = false;\n\n componentDidMount() {\n this.mounted = true;\n\n window.addEventListener(\"resize\", this.onWindowResize);\n // Call to properly set the breakpoint and resize the elements.\n // Note that if you're doing a full-width element, this can get a little wonky if a scrollbar\n // appears because of the grid. In that case, fire your own resize event, or set `overflow: scroll` on your body.\n this.onWindowResize();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n window.removeEventListener(\"resize\", this.onWindowResize);\n }\n\n onWindowResize = () => {\n if (!this.mounted) return;\n // eslint-disable-next-line react/no-find-dom-node\n const node = ReactDOM.findDOMNode(this); // Flow casts this to Text | Element\n if (node instanceof HTMLElement)\n this.setState({ width: node.offsetWidth });\n };\n\n render() {\n const { measureBeforeMount, ...rest } = this.props;\n if (measureBeforeMount && !this.mounted) {\n return (\n
\n );\n }\n\n return ;\n }\n };\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/examples/0-showcase.html b/examples/0-showcase.html deleted file mode 100644 index a220221c2..000000000 --- a/examples/0-showcase.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - RGL Example 0 - Showcase - - -

React-Grid-Layout Demo 0 - Showcase

- -

React-Grid-Layout is a grid layout system for React. It features auto-packing, draggable and resizable widgets, static widgets, a fluid layout, and separate layouts per responsive breakpoint.

-

Try it out! Drag some boxes around, resize them, and resize the window to see the responsive breakpoints.

-
- - diff --git a/examples/1-basic.html b/examples/1-basic.html deleted file mode 100644 index d046486f3..000000000 --- a/examples/1-basic.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - RGL Example 1 - Basic - - -

React-Grid-Layout Demo 1 - Basic

- -

Try dragging the elements around.

-

This is a basic, non-responsive layout with dragging and resizing. Usage is very simple.

-
- - diff --git a/examples/10-dynamic-min-max-wh.html b/examples/10-dynamic-min-max-wh.html deleted file mode 100644 index f22863461..000000000 --- a/examples/10-dynamic-min-max-wh.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - RGL Example 10 - Dynamic Minimum and Maximum Width/Height - - -

React-Grid-Layout Demo 10 - Dynamic Minimum and Maximum Width/Height

- -

Your application may have more complex rules for determining an element's mins and maxes. This demo demonstrates how to use the `onResize` handler to accomplish this.

-

In this grid, all elements are allowed a max width of 2 if the height < 3, and a min width of 2 if the height >= 3.

-
- - diff --git a/examples/11-no-vertical-compact.html b/examples/11-no-vertical-compact.html deleted file mode 100644 index 2498ade5b..000000000 --- a/examples/11-no-vertical-compact.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - RGL Example 11 - No Vertical Compacting (Free Movement) - - -

React-Grid-Layout Demo 11 - No Vertical Compacting (Free Movement)

- -

You may want to turn off vertical compacting so items can be placed anywhere in the grid. Set the property `verticalCompact` to `false` to achieve this effect.

-
- - diff --git a/examples/12-prevent-collision.html b/examples/12-prevent-collision.html deleted file mode 100644 index 29b43b35a..000000000 --- a/examples/12-prevent-collision.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - RGL Example 12 - Prevent Collision - - -

React-Grid-Layout Demo 12 - Prevent Collision

- -

You may want to turn off rearrangement so items don't move arround when dragging. Set the property `preventCollision` to `true` to achieve this effect. It's particularly useful with `verticalCompact` set to `false`.

-
- - diff --git a/examples/13-error-case.html b/examples/13-error-case.html deleted file mode 100644 index 8d34395c2..000000000 --- a/examples/13-error-case.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - RGL Example 13 - Error Case - - -

React-Grid-Layout Demo 13 - Error Case

- -

This is an extra test case for a collision bug fixed in November 2017. When you drag 1 over 2, it should not move over 3.

-
- - diff --git a/examples/14-toolbox.html b/examples/14-toolbox.html deleted file mode 100644 index fefcde163..000000000 --- a/examples/14-toolbox.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - RGL Example 14 - Toolbox - - -

React-Grid-Layout Demo 14 - Toolbox

- -

This includes an interactive toolbox. Try dragging widgets into it!

-
- - diff --git a/examples/2-no-dragging.html b/examples/2-no-dragging.html deleted file mode 100644 index 5366bad13..000000000 --- a/examples/2-no-dragging.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - RGL Example 2 - No Dragging - - -

React-Grid-Layout Demo 2 - No Dragging

- -

This particular example has dragging and resizing turned off.

-
- - diff --git a/examples/3-messy.html b/examples/3-messy.html deleted file mode 100644 index 9e5f509e7..000000000 --- a/examples/3-messy.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - RGL Example 3 - Messy - - -

React-Grid-Layout Demo 3 - Messy

- -

This demo shows what happens when elements are placed randomly all over the layout.

-

RGL does not auto-pack in the same fashion as other projects, such as jQuery Masonry. Packing is only done in the vertical dimension. If objects all have the same width, they will be packed efficiently.

-

If a layout is fed to RGL that has items with incorrect dimensions (width too big, overlapping other elements, out of bounds, etc), they will be automatically corrected on startup. See the source of this demo, where elements are placed randomly in the layout.

-
- - diff --git a/examples/4-grid-property.html b/examples/4-grid-property.html deleted file mode 100644 index db0a2cf21..000000000 --- a/examples/4-grid-property.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - RGL Example 4 - Grid Item Properties - - -

React-Grid-Layout Demo 4 - Grid Item Properties

- -

This demo uses a layout assigned on the grid items themselves as the data-grid property.

-
- - diff --git a/examples/5-static-elements.html b/examples/5-static-elements.html deleted file mode 100644 index dc65d63c3..000000000 --- a/examples/5-static-elements.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - RGL Example 5 - Static Elements - - -

React-Grid-Layout Demo 5 - Static Elements

- -

This demo sets an item to static. Static elements cannot be moved or resized. Other elements move themselves around a static element.

-
- - diff --git a/examples/6-dynamic-add-remove.html b/examples/6-dynamic-add-remove.html deleted file mode 100644 index 126f8d3ac..000000000 --- a/examples/6-dynamic-add-remove.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - RGL Example 6 - Dynamic Add/Remove - - -

React-Grid-Layout Demo 6 - Dynamic Add/Remove

- -

This demo shows what happens when items are dynamically added and removed.

-

You can remove an item by clicking its "x", and add a new one with the button.

-

To further illustration RGL's capacities, this particular example is responsive. Trying resizing the window.

-
- - diff --git a/examples/7-localstorage.html b/examples/7-localstorage.html deleted file mode 100644 index 3a8aae748..000000000 --- a/examples/7-localstorage.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - RGL Example 7 - LocalStorage - - -

React-Grid-Layout Demo 7 - LocalStorage

- -

This simple demo synchronizes to localStorage.

-

Try moving and resizing elements, then reloading.

-
- - diff --git a/examples/8-localstorage-responsive.html b/examples/8-localstorage-responsive.html deleted file mode 100644 index 67ed90aee..000000000 --- a/examples/8-localstorage-responsive.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - RGL Example 8 - Responsive with LocalStorage - - -

React-Grid-Layout Demo 8 - Responsive with LocalStorage

- -

This simple demo synchronizes to localStorage for each responsive breakpoint.

-

Try moving and resizing elements, changing window width, moving some more, and refreshing.

-

Each breakpoint has a separate layout. The onLayoutChange callback calls back with a hash of breakpoints to layouts, which is then synchronized to localStorage.

-
- - diff --git a/examples/9-min-max-wh.html b/examples/9-min-max-wh.html deleted file mode 100644 index 193ca12af..000000000 --- a/examples/9-min-max-wh.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - RGL Example 9 - Minimum and Maximum Width/Height - - -

React-Grid-Layout Demo 9 - Minimum and Maximum Width/Height

- -

You can set min and max dimensions on a grid item by using the `minW`, `maxW`, `minH`, and `maxH` properties.

-

In this demo, the min and max dimensions are generated automatically. Try resizing the items below.

-

If your mins and maxes collide: for example min > max, or the initial dimensions are out of range, an error will be thrown.

-
- - diff --git a/examples/example-styles.css b/examples/example-styles.css index cd3f2d7a5..af1b78054 100644 --- a/examples/example-styles.css +++ b/examples/example-styles.css @@ -1,7 +1,5 @@ body { - background: white; padding: 20px; - overflow: scroll; } #content { width: 100%; @@ -56,10 +54,6 @@ body { cursor: -moz-grab; cursor: -webkit-grab; } -li b { - font-size: 19px; - line-height: 14px; -} .toolbox { background-color: #dfd; @@ -95,3 +89,11 @@ li b { border: 1px solid black; background-color: #ddd; } +.droppable-element { + width: 150px; + text-align: center; + background: #fdd; + border: 1px solid black; + margin: 10px 0; + padding: 10px; +} diff --git a/examples/generate.js b/examples/generate.js index 5f9295b0c..96fe55cb6 100644 --- a/examples/generate.js +++ b/examples/generate.js @@ -1,19 +1,23 @@ -'use strict'; -var fs = require('fs'); -var ejs = require('ejs'); -var data = require('./vars'); -var tpl = fs.readFileSync(__dirname + '/template.ejs').toString(); +"use strict"; +const fs = require("fs"); +const ejs = require("ejs"); +const data = require("./vars"); +const tpl = fs.readFileSync(__dirname + "/template.ejs").toString(); -var base = 'http://localhost:4002'; -var banner = 'Do not edit this file! It is generated by `generate.js` in this folder, from `template.ejs` and ' + - 'vars.js.'; +const base = process.env.CONTENT_BASE; +if (typeof base !== "string") { + throw new Error("env CONTENT_BASE is required to be set."); +} +const banner = + "Do not edit this file! It is generated by `generate.js` in this folder, from `template.ejs` and " + + "vars.js."; data.forEach(function(datum, i) { - datum.base = base; + datum.base = base.replace(/\/$/, ""); // trim trailing slash datum.index = i; datum.banner = banner; datum.previous = data[i - 1]; datum.next = data[i + 1]; - var html = ejs.render(tpl, datum); - fs.writeFileSync(__dirname + '/' + i + '-' + datum.source + '.html', html); + const html = ejs.render(tpl, datum); + fs.writeFileSync(__dirname + "/" + i + "-" + datum.source + ".html", html); }); diff --git a/examples/resizable-styles.css b/examples/resizable-styles.css new file mode 100644 index 000000000..75fa76378 --- /dev/null +++ b/examples/resizable-styles.css @@ -0,0 +1,51 @@ +.react-grid-item > .react-resizable-handle.react-resizable-handle-sw { + bottom: 0; + left: 0; + cursor: sw-resize; + transform: rotate(90deg); +} +.react-grid-item > .react-resizable-handle.react-resizable-handle-se { + bottom: 0; + right: 0; + cursor: se-resize; +} +.react-grid-item > .react-resizable-handle.react-resizable-handle-nw { + top: 0; + left: 0; + cursor: nw-resize; + transform: rotate(180deg); +} +.react-grid-item > .react-resizable-handle.react-resizable-handle-ne { + top: 0; + right: 0; + cursor: ne-resize; + transform: rotate(270deg); +} +.react-grid-item > .react-resizable-handle.react-resizable-handle-w, +.react-grid-item > .react-resizable-handle.react-resizable-handle-e { + top: 50%; + margin-top: -10px; + cursor: ew-resize; +} +.react-grid-item > .react-resizable-handle.react-resizable-handle-w { + left: 0; + transform: rotate(135deg); +} +.react-grid-item > .react-resizable-handle.react-resizable-handle-e { + right: 0; + transform: rotate(315deg); +} +.react-grid-item > .react-resizable-handle.react-resizable-handle-n, +.react-grid-item > .react-resizable-handle.react-resizable-handle-s { + left: 50%; + margin-left: -10px; + cursor: ns-resize; +} +.react-grid-item > .react-resizable-handle.react-resizable-handle-n { + top: 0; + transform: rotate(225deg); +} +.react-grid-item > .react-resizable-handle.react-resizable-handle-s { + bottom: 0; + transform: rotate(45deg); +} \ No newline at end of file diff --git a/examples/template.ejs b/examples/template.ejs index 89d220deb..5b6953139 100644 --- a/examples/template.ejs +++ b/examples/template.ejs @@ -5,8 +5,9 @@ - - + + + RGL Example <%= index %> - <%= title %> @@ -14,16 +15,18 @@ - <% for(var i = 0; i < paragraphs.length; i++) { -%> + <%_ for(var i = 0; i < paragraphs.length; i++) { -%>

<%- paragraphs[i] %>

- <% } -%> + <%_ } -%>
diff --git a/examples/vars.js b/examples/vars.js index cb8cfe310..46375c9ed 100644 --- a/examples/vars.js +++ b/examples/vars.js @@ -128,7 +128,30 @@ module.exports = [ title: "Toolbox", source: "toolbox", paragraphs: [ - "This demonstrates how to implement a toolbox to add and remove widgets." + "This demonstrates how to implement a toolbox to add and remove widgets. Click the 'X' on a widget to move it into the toolbox." + ] + }, + { + title: "Drag From Outside", + source: "drag-from-outside", + paragraphs: [ + "This demo shows what happens when an item is added from outside of the grid.", + "Once you drop the item within the grid you'll get its coordinates/properties and can perform actions with " + + "it accordingly." + ] + }, + { + title: "Bounded", + source: "bounded", + paragraphs: [ + "Try dragging the elements around. They can only be moved within the grid, the draggable placeholder will not show outside it." + ] + }, + { + title: "Resizable Handles", + source: "resizable-handles", + paragraphs: [ + "This demonstrates how to implement resizable handles for any corner" ] } ]; diff --git a/flow-typed/npm/classnames_v2.x.x.js b/flow-typed/npm/classnames_v2.x.x.js new file mode 100644 index 000000000..27057f033 --- /dev/null +++ b/flow-typed/npm/classnames_v2.x.x.js @@ -0,0 +1,23 @@ +// flow-typed signature: a00cf41b09af4862583460529d5cfcb9 +// flow-typed version: c6154227d1/classnames_v2.x.x/flow_>=v0.104.x + +type $npm$classnames$Classes = + | string + | { [className: string]: *, ... } + | false + | void + | null; + +declare module "classnames" { + declare module.exports: ( + ...classes: Array<$npm$classnames$Classes | $npm$classnames$Classes[]> + ) => string; +} + +declare module "classnames/bind" { + declare module.exports: $Exports<"classnames">; +} + +declare module "classnames/dedupe" { + declare module.exports: $Exports<"classnames">; +} diff --git a/flow-typed/npm/enzyme_v3.x.x.js b/flow-typed/npm/enzyme_v3.x.x.js new file mode 100644 index 000000000..fe4586e5f --- /dev/null +++ b/flow-typed/npm/enzyme_v3.x.x.js @@ -0,0 +1,143 @@ +// flow-typed signature: 931d5482afcb022bcbddb841fd08d683 +// flow-typed version: 5175c53189/enzyme_v3.x.x/flow_>=v0.104.x + +declare module "enzyme" { + declare type PredicateFunction> = ( + wrapper: T, + index: number + ) => boolean; + declare type UntypedSelector = string | { [key: string]: number|string|boolean, ... }; + declare type EnzymeSelector = UntypedSelector | React$ElementType; + + // CheerioWrapper is a type alias for an actual cheerio instance + // TODO: Reference correct type from cheerio's type declarations + declare type CheerioWrapper = any; + + declare class Wrapper { + equals(node: React$Element): boolean, + find(selector: UntypedSelector): this, + find(selector: T): ReactWrapper, + findWhere(predicate: PredicateFunction): this, + filter(selector: UntypedSelector): this, + filter(selector: T): ReactWrapper, + filterWhere(predicate: PredicateFunction): this, + hostNodes(): this, + contains(nodes: React$Node): boolean, + containsMatchingElement(node: React$Node): boolean, + containsAllMatchingElements(nodes: React$Node): boolean, + containsAnyMatchingElements(nodes: React$Node): boolean, + dive(option?: { context?: Object, ... }): this, + exists(selector?: EnzymeSelector): boolean, + isEmptyRender(): boolean, + matchesElement(node: React$Node): boolean, + hasClass(className: string): boolean, + is(selector: EnzymeSelector): boolean, + isEmpty(): boolean, + not(selector: EnzymeSelector): this, + children(selector?: UntypedSelector): this, + children(selector: T): ReactWrapper, + childAt(index: number): this, + parents(selector?: UntypedSelector): this, + parents(selector: T): ReactWrapper, + parent(): this, + closest(selector: UntypedSelector): this, + closest(selector: T): ReactWrapper, + render(): CheerioWrapper, + renderProp(propName: string): (...args: Array) => this, + unmount(): this, + text(): string, + html(): string, + invoke(propName: string): (...args: $ReadOnlyArray) => mixed, + get(index: number): React$Node, + getDOMNode(): HTMLElement | HTMLInputElement, + at(index: number): this, + first(): this, + last(): this, + state(key?: string): any, + context(key?: string): any, + props(): Object, + prop(key: string): any, + key(): string, + simulate(event: string, ...args: Array): this, + simulateError(error: Error): this, + slice(begin?: number, end?: number): this, + setState(state: {...}, callback?: () => void): this, + setProps(props: {...}, callback?: () => void): this, + setContext(context: Object): this, + instance(): React$ElementRef, + update(): this, + debug(options?: Object): string, + type(): string | Function | null, + name(): string, + forEach(fn: (node: this, index: number) => mixed): this, + map(fn: (node: this, index: number) => T): Array, + reduce( + fn: (value: T, node: this, index: number) => T, + initialValue?: T + ): Array, + reduceRight( + fn: (value: T, node: this, index: number) => T, + initialValue?: T + ): Array, + some(selector: EnzymeSelector): boolean, + someWhere(predicate: PredicateFunction): boolean, + every(selector: EnzymeSelector): boolean, + everyWhere(predicate: PredicateFunction): boolean, + length: number + } + + declare class ReactWrapper extends Wrapper { + constructor(nodes: React$Element, root: any, options?: ?Object): ReactWrapper, + mount(): this, + ref(refName: string): this, + detach(): void + } + + declare class ShallowWrapper extends Wrapper { + constructor( + nodes: React$Element, + root: any, + options?: ?Object + ): ShallowWrapper, + equals(node: React$Node): boolean, + shallow(options?: { context?: Object, ... }): ShallowWrapper, + getElement(): React$Node, + getElements(): Array + } + + declare function shallow( + node: React$Element, + options?: { + context?: Object, + disableLifecycleMethods?: boolean, + ... + } + ): ShallowWrapper; + declare function mount( + node: React$Element, + options?: { + context?: Object, + attachTo?: HTMLElement, + childContextTypes?: Object, + ... + } + ): ReactWrapper; + declare function render( + node: React$Node, + options?: { context?: Object, ... } + ): CheerioWrapper; + + declare module.exports: { + configure(options: { + Adapter?: any, + disableLifecycleMethods?: boolean, + ... + }): void, + render: typeof render, + mount: typeof mount, + shallow: typeof shallow, + ShallowWrapper: typeof ShallowWrapper, + ReactWrapper: typeof ReactWrapper, + ... + }; +} diff --git a/flow-typed/npm/jest_v24.x.x.js b/flow-typed/npm/jest_v24.x.x.js new file mode 100644 index 000000000..f9790b5e3 --- /dev/null +++ b/flow-typed/npm/jest_v24.x.x.js @@ -0,0 +1,1182 @@ +// flow-typed signature: 27f8467378a99b6130bd20f54f31a644 +// flow-typed version: 6cb9e99836/jest_v24.x.x/flow_>=v0.104.x + +type JestMockFn, TReturn> = { + (...args: TArguments): TReturn, + /** + * An object for introspecting mock calls + */ + mock: { + /** + * An array that represents all calls that have been made into this mock + * function. Each call is represented by an array of arguments that were + * passed during the call. + */ + calls: Array, + /** + * An array that contains all the object instances that have been + * instantiated from this mock function. + */ + instances: Array, + /** + * An array that contains all the object results that have been + * returned by this mock function call + */ + results: Array<{ + isThrow: boolean, + value: TReturn, + ... + }>, + ... + }, + /** + * Resets all information stored in the mockFn.mock.calls and + * mockFn.mock.instances arrays. Often this is useful when you want to clean + * up a mock's usage data between two assertions. + */ + mockClear(): void, + /** + * Resets all information stored in the mock. This is useful when you want to + * completely restore a mock back to its initial state. + */ + mockReset(): void, + /** + * Removes the mock and restores the initial implementation. This is useful + * when you want to mock functions in certain test cases and restore the + * original implementation in others. Beware that mockFn.mockRestore only + * works when mock was created with jest.spyOn. Thus you have to take care of + * restoration yourself when manually assigning jest.fn(). + */ + mockRestore(): void, + /** + * Accepts a function that should be used as the implementation of the mock. + * The mock itself will still record all calls that go into and instances + * that come from itself -- the only difference is that the implementation + * will also be executed when the mock is called. + */ + mockImplementation( + fn: (...args: TArguments) => TReturn + ): JestMockFn, + /** + * Accepts a function that will be used as an implementation of the mock for + * one call to the mocked function. Can be chained so that multiple function + * calls produce different results. + */ + mockImplementationOnce( + fn: (...args: TArguments) => TReturn + ): JestMockFn, + /** + * Accepts a string to use in test result output in place of "jest.fn()" to + * indicate which mock function is being referenced. + */ + mockName(name: string): JestMockFn, + /** + * Just a simple sugar function for returning `this` + */ + mockReturnThis(): void, + /** + * Accepts a value that will be returned whenever the mock function is called. + */ + mockReturnValue(value: TReturn): JestMockFn, + /** + * Sugar for only returning a value once inside your mock + */ + mockReturnValueOnce(value: TReturn): JestMockFn, + /** + * Sugar for jest.fn().mockImplementation(() => Promise.resolve(value)) + */ + mockResolvedValue(value: TReturn): JestMockFn>, + /** + * Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value)) + */ + mockResolvedValueOnce( + value: TReturn + ): JestMockFn>, + /** + * Sugar for jest.fn().mockImplementation(() => Promise.reject(value)) + */ + mockRejectedValue(value: TReturn): JestMockFn>, + /** + * Sugar for jest.fn().mockImplementationOnce(() => Promise.reject(value)) + */ + mockRejectedValueOnce(value: TReturn): JestMockFn>, + ... +}; + +type JestAsymmetricEqualityType = { /** + * A custom Jasmine equality tester + */ +asymmetricMatch(value: mixed): boolean, ... }; + +type JestCallsType = { + allArgs(): mixed, + all(): mixed, + any(): boolean, + count(): number, + first(): mixed, + mostRecent(): mixed, + reset(): void, + ... +}; + +type JestClockType = { + install(): void, + mockDate(date: Date): void, + tick(milliseconds?: number): void, + uninstall(): void, + ... +}; + +type JestMatcherResult = { + message?: string | (() => string), + pass: boolean, + ... +}; + +type JestMatcher = ( + received: any, + ...actual: Array +) => JestMatcherResult | Promise; + +type JestPromiseType = { + /** + * Use rejects to unwrap the reason of a rejected promise so any other + * matcher can be chained. If the promise is fulfilled the assertion fails. + */ + rejects: JestExpectType, + /** + * Use resolves to unwrap the value of a fulfilled promise so any other + * matcher can be chained. If the promise is rejected the assertion fails. + */ + resolves: JestExpectType, + ... +}; + +/** + * Jest allows functions and classes to be used as test names in test() and + * describe() + */ +type JestTestName = string | Function; + +/** + * Plugin: jest-styled-components + */ + +type JestStyledComponentsMatcherValue = + | string + | JestAsymmetricEqualityType + | RegExp + | typeof undefined; + +type JestStyledComponentsMatcherOptions = { + media?: string, + modifier?: string, + supports?: string, + ... +}; + +type JestStyledComponentsMatchersType = { toHaveStyleRule( + property: string, + value: JestStyledComponentsMatcherValue, + options?: JestStyledComponentsMatcherOptions +): void, ... }; + +/** + * Plugin: jest-enzyme + */ +type EnzymeMatchersType = { + // 5.x + toBeEmpty(): void, + toBePresent(): void, + // 6.x + toBeChecked(): void, + toBeDisabled(): void, + toBeEmptyRender(): void, + toContainMatchingElement(selector: string): void, + toContainMatchingElements(n: number, selector: string): void, + toContainExactlyOneMatchingElement(selector: string): void, + toContainReact(element: React$Element): void, + toExist(): void, + toHaveClassName(className: string): void, + toHaveHTML(html: string): void, + toHaveProp: ((propKey: string, propValue?: any) => void) & + ((props: {...}) => void), + toHaveRef(refName: string): void, + toHaveState: ((stateKey: string, stateValue?: any) => void) & + ((state: {...}) => void), + toHaveStyle: ((styleKey: string, styleValue?: any) => void) & + ((style: {...}) => void), + toHaveTagName(tagName: string): void, + toHaveText(text: string): void, + toHaveValue(value: any): void, + toIncludeText(text: string): void, + toMatchElement( + element: React$Element, + options?: {| ignoreProps?: boolean, verbose?: boolean |} + ): void, + toMatchSelector(selector: string): void, + // 7.x + toHaveDisplayName(name: string): void, + ... +}; + +// DOM testing library extensions (jest-dom) +// https://github.com/testing-library/jest-dom +type DomTestingLibraryType = { + /** + * @deprecated + */ + toBeInTheDOM(container?: HTMLElement): void, + toBeInTheDocument(): void, + toBeVisible(): void, + toBeEmpty(): void, + toBeDisabled(): void, + toBeEnabled(): void, + toBeInvalid(): void, + toBeRequired(): void, + toBeValid(): void, + toContainElement(element: HTMLElement | null): void, + toContainHTML(htmlText: string): void, + toHaveAttribute(attr: string, value?: any): void, + toHaveClass(...classNames: string[]): void, + toHaveFocus(): void, + toHaveFormValues(expectedValues: { [name: string]: any, ... }): void, + toHaveStyle(css: string): void, + toHaveTextContent( + text: string | RegExp, + options?: { normalizeWhitespace: boolean, ... } + ): void, + toHaveValue(value?: string | string[] | number): void, + ... +}; + +// Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers +type JestJQueryMatchersType = { + toExist(): void, + toHaveLength(len: number): void, + toHaveId(id: string): void, + toHaveClass(className: string): void, + toHaveTag(tag: string): void, + toHaveAttr(key: string, val?: any): void, + toHaveProp(key: string, val?: any): void, + toHaveText(text: string | RegExp): void, + toHaveData(key: string, val?: any): void, + toHaveValue(val: any): void, + toHaveCss(css: { [key: string]: any, ... }): void, + toBeChecked(): void, + toBeDisabled(): void, + toBeEmpty(): void, + toBeHidden(): void, + toBeSelected(): void, + toBeVisible(): void, + toBeFocused(): void, + toBeInDom(): void, + toBeMatchedBy(sel: string): void, + toHaveDescendant(sel: string): void, + toHaveDescendantWithText(sel: string, text: string | RegExp): void, + ... +}; + +// Jest Extended Matchers: https://github.com/jest-community/jest-extended +type JestExtendedMatchersType = { + /** + * Note: Currently unimplemented + * Passing assertion + * + * @param {String} message + */ + // pass(message: string): void; + + /** + * Note: Currently unimplemented + * Failing assertion + * + * @param {String} message + */ + // fail(message: string): void; + + /** + * Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty. + */ + toBeEmpty(): void, + /** + * Use .toBeOneOf when checking if a value is a member of a given Array. + * @param {Array.<*>} members + */ + toBeOneOf(members: any[]): void, + /** + * Use `.toBeNil` when checking a value is `null` or `undefined`. + */ + toBeNil(): void, + /** + * Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`. + * @param {Function} predicate + */ + toSatisfy(predicate: (n: any) => boolean): void, + /** + * Use `.toBeArray` when checking if a value is an `Array`. + */ + toBeArray(): void, + /** + * Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x. + * @param {Number} x + */ + toBeArrayOfSize(x: number): void, + /** + * Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set. + * @param {Array.<*>} members + */ + toIncludeAllMembers(members: any[]): void, + /** + * Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set. + * @param {Array.<*>} members + */ + toIncludeAnyMembers(members: any[]): void, + /** + * Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array. + * @param {Function} predicate + */ + toSatisfyAll(predicate: (n: any) => boolean): void, + /** + * Use `.toBeBoolean` when checking if a value is a `Boolean`. + */ + toBeBoolean(): void, + /** + * Use `.toBeTrue` when checking a value is equal (===) to `true`. + */ + toBeTrue(): void, + /** + * Use `.toBeFalse` when checking a value is equal (===) to `false`. + */ + toBeFalse(): void, + /** + * Use .toBeDate when checking if a value is a Date. + */ + toBeDate(): void, + /** + * Use `.toBeFunction` when checking if a value is a `Function`. + */ + toBeFunction(): void, + /** + * Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`. + * + * Note: Required Jest version >22 + * Note: Your mock functions will have to be asynchronous to cause the timestamps inside of Jest to occur in a differentJS event loop, otherwise the mock timestamps will all be the same + * + * @param {Mock} mock + */ + toHaveBeenCalledBefore(mock: JestMockFn): void, + /** + * Use `.toBeNumber` when checking if a value is a `Number`. + */ + toBeNumber(): void, + /** + * Use `.toBeNaN` when checking a value is `NaN`. + */ + toBeNaN(): void, + /** + * Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`. + */ + toBeFinite(): void, + /** + * Use `.toBePositive` when checking if a value is a positive `Number`. + */ + toBePositive(): void, + /** + * Use `.toBeNegative` when checking if a value is a negative `Number`. + */ + toBeNegative(): void, + /** + * Use `.toBeEven` when checking if a value is an even `Number`. + */ + toBeEven(): void, + /** + * Use `.toBeOdd` when checking if a value is an odd `Number`. + */ + toBeOdd(): void, + /** + * Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive). + * + * @param {Number} start + * @param {Number} end + */ + toBeWithin(start: number, end: number): void, + /** + * Use `.toBeObject` when checking if a value is an `Object`. + */ + toBeObject(): void, + /** + * Use `.toContainKey` when checking if an object contains the provided key. + * + * @param {String} key + */ + toContainKey(key: string): void, + /** + * Use `.toContainKeys` when checking if an object has all of the provided keys. + * + * @param {Array.} keys + */ + toContainKeys(keys: string[]): void, + /** + * Use `.toContainAllKeys` when checking if an object only contains all of the provided keys. + * + * @param {Array.} keys + */ + toContainAllKeys(keys: string[]): void, + /** + * Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys. + * + * @param {Array.} keys + */ + toContainAnyKeys(keys: string[]): void, + /** + * Use `.toContainValue` when checking if an object contains the provided value. + * + * @param {*} value + */ + toContainValue(value: any): void, + /** + * Use `.toContainValues` when checking if an object contains all of the provided values. + * + * @param {Array.<*>} values + */ + toContainValues(values: any[]): void, + /** + * Use `.toContainAllValues` when checking if an object only contains all of the provided values. + * + * @param {Array.<*>} values + */ + toContainAllValues(values: any[]): void, + /** + * Use `.toContainAnyValues` when checking if an object contains at least one of the provided values. + * + * @param {Array.<*>} values + */ + toContainAnyValues(values: any[]): void, + /** + * Use `.toContainEntry` when checking if an object contains the provided entry. + * + * @param {Array.} entry + */ + toContainEntry(entry: [string, string]): void, + /** + * Use `.toContainEntries` when checking if an object contains all of the provided entries. + * + * @param {Array.>} entries + */ + toContainEntries(entries: [string, string][]): void, + /** + * Use `.toContainAllEntries` when checking if an object only contains all of the provided entries. + * + * @param {Array.>} entries + */ + toContainAllEntries(entries: [string, string][]): void, + /** + * Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries. + * + * @param {Array.>} entries + */ + toContainAnyEntries(entries: [string, string][]): void, + /** + * Use `.toBeExtensible` when checking if an object is extensible. + */ + toBeExtensible(): void, + /** + * Use `.toBeFrozen` when checking if an object is frozen. + */ + toBeFrozen(): void, + /** + * Use `.toBeSealed` when checking if an object is sealed. + */ + toBeSealed(): void, + /** + * Use `.toBeString` when checking if a value is a `String`. + */ + toBeString(): void, + /** + * Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings. + * + * @param {String} string + */ + toEqualCaseInsensitive(string: string): void, + /** + * Use `.toStartWith` when checking if a `String` starts with a given `String` prefix. + * + * @param {String} prefix + */ + toStartWith(prefix: string): void, + /** + * Use `.toEndWith` when checking if a `String` ends with a given `String` suffix. + * + * @param {String} suffix + */ + toEndWith(suffix: string): void, + /** + * Use `.toInclude` when checking if a `String` includes the given `String` substring. + * + * @param {String} substring + */ + toInclude(substring: string): void, + /** + * Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times. + * + * @param {String} substring + * @param {Number} times + */ + toIncludeRepeated(substring: string, times: number): void, + /** + * Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings. + * + * @param {Array.} substring + */ + toIncludeMultiple(substring: string[]): void, + ... +}; + +interface JestExpectType { + not: JestExpectType & + EnzymeMatchersType & + DomTestingLibraryType & + JestJQueryMatchersType & + JestStyledComponentsMatchersType & + JestExtendedMatchersType; + /** + * If you have a mock function, you can use .lastCalledWith to test what + * arguments it was last called with. + */ + lastCalledWith(...args: Array): void; + /** + * toBe just checks that a value is what you expect. It uses === to check + * strict equality. + */ + toBe(value: any): void; + /** + * Use .toBeCalledWith to ensure that a mock function was called with + * specific arguments. + */ + toBeCalledWith(...args: Array): void; + /** + * Using exact equality with floating point numbers is a bad idea. Rounding + * means that intuitive things fail. + */ + toBeCloseTo(num: number, delta: any): void; + /** + * Use .toBeDefined to check that a variable is not undefined. + */ + toBeDefined(): void; + /** + * Use .toBeFalsy when you don't care what a value is, you just want to + * ensure a value is false in a boolean context. + */ + toBeFalsy(): void; + /** + * To compare floating point numbers, you can use toBeGreaterThan. + */ + toBeGreaterThan(number: number): void; + /** + * To compare floating point numbers, you can use toBeGreaterThanOrEqual. + */ + toBeGreaterThanOrEqual(number: number): void; + /** + * To compare floating point numbers, you can use toBeLessThan. + */ + toBeLessThan(number: number): void; + /** + * To compare floating point numbers, you can use toBeLessThanOrEqual. + */ + toBeLessThanOrEqual(number: number): void; + /** + * Use .toBeInstanceOf(Class) to check that an object is an instance of a + * class. + */ + toBeInstanceOf(cls: Class<*>): void; + /** + * .toBeNull() is the same as .toBe(null) but the error messages are a bit + * nicer. + */ + toBeNull(): void; + /** + * Use .toBeTruthy when you don't care what a value is, you just want to + * ensure a value is true in a boolean context. + */ + toBeTruthy(): void; + /** + * Use .toBeUndefined to check that a variable is undefined. + */ + toBeUndefined(): void; + /** + * Use .toContain when you want to check that an item is in a list. For + * testing the items in the list, this uses ===, a strict equality check. + */ + toContain(item: any): void; + /** + * Use .toContainEqual when you want to check that an item is in a list. For + * testing the items in the list, this matcher recursively checks the + * equality of all fields, rather than checking for object identity. + */ + toContainEqual(item: any): void; + /** + * Use .toEqual when you want to check that two objects have the same value. + * This matcher recursively checks the equality of all fields, rather than + * checking for object identity. + */ + toEqual(value: any): void; + /** + * Use .toHaveBeenCalled to ensure that a mock function got called. + */ + toHaveBeenCalled(): void; + toBeCalled(): void; + /** + * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact + * number of times. + */ + toHaveBeenCalledTimes(number: number): void; + toBeCalledTimes(number: number): void; + /** + * + */ + toHaveBeenNthCalledWith(nthCall: number, ...args: Array): void; + nthCalledWith(nthCall: number, ...args: Array): void; + /** + * + */ + toHaveReturned(): void; + toReturn(): void; + /** + * + */ + toHaveReturnedTimes(number: number): void; + toReturnTimes(number: number): void; + /** + * + */ + toHaveReturnedWith(value: any): void; + toReturnWith(value: any): void; + /** + * + */ + toHaveLastReturnedWith(value: any): void; + lastReturnedWith(value: any): void; + /** + * + */ + toHaveNthReturnedWith(nthCall: number, value: any): void; + nthReturnedWith(nthCall: number, value: any): void; + /** + * Use .toHaveBeenCalledWith to ensure that a mock function was called with + * specific arguments. + */ + toHaveBeenCalledWith(...args: Array): void; + toBeCalledWith(...args: Array): void; + /** + * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called + * with specific arguments. + */ + toHaveBeenLastCalledWith(...args: Array): void; + lastCalledWith(...args: Array): void; + /** + * Check that an object has a .length property and it is set to a certain + * numeric value. + */ + toHaveLength(number: number): void; + /** + * + */ + toHaveProperty(propPath: string | $ReadOnlyArray, value?: any): void; + /** + * Use .toMatch to check that a string matches a regular expression or string. + */ + toMatch(regexpOrString: RegExp | string): void; + /** + * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object. + */ + toMatchObject(object: Object | Array): void; + /** + * Use .toStrictEqual to check that a javascript object matches a subset of the properties of an object. + */ + toStrictEqual(value: any): void; + /** + * This ensures that an Object matches the most recent snapshot. + */ + toMatchSnapshot(propertyMatchers?: any, name?: string): void; + /** + * This ensures that an Object matches the most recent snapshot. + */ + toMatchSnapshot(name: string): void; + + toMatchInlineSnapshot(snapshot?: string): void; + toMatchInlineSnapshot(propertyMatchers?: any, snapshot?: string): void; + /** + * Use .toThrow to test that a function throws when it is called. + * If you want to test that a specific error gets thrown, you can provide an + * argument to toThrow. The argument can be a string for the error message, + * a class for the error, or a regex that should match the error. + * + * Alias: .toThrowError + */ + toThrow(message?: string | Error | Class | RegExp): void; + toThrowError(message?: string | Error | Class | RegExp): void; + /** + * Use .toThrowErrorMatchingSnapshot to test that a function throws a error + * matching the most recent snapshot when it is called. + */ + toThrowErrorMatchingSnapshot(): void; + toThrowErrorMatchingInlineSnapshot(snapshot?: string): void; +} + +type JestObjectType = { + /** + * Disables automatic mocking in the module loader. + * + * After this method is called, all `require()`s will return the real + * versions of each module (rather than a mocked version). + */ + disableAutomock(): JestObjectType, + /** + * An un-hoisted version of disableAutomock + */ + autoMockOff(): JestObjectType, + /** + * Enables automatic mocking in the module loader. + */ + enableAutomock(): JestObjectType, + /** + * An un-hoisted version of enableAutomock + */ + autoMockOn(): JestObjectType, + /** + * Clears the mock.calls and mock.instances properties of all mocks. + * Equivalent to calling .mockClear() on every mocked function. + */ + clearAllMocks(): JestObjectType, + /** + * Resets the state of all mocks. Equivalent to calling .mockReset() on every + * mocked function. + */ + resetAllMocks(): JestObjectType, + /** + * Restores all mocks back to their original value. + */ + restoreAllMocks(): JestObjectType, + /** + * Removes any pending timers from the timer system. + */ + clearAllTimers(): void, + /** + * Returns the number of fake timers still left to run. + */ + getTimerCount(): number, + /** + * The same as `mock` but not moved to the top of the expectation by + * babel-jest. + */ + doMock(moduleName: string, moduleFactory?: any): JestObjectType, + /** + * The same as `unmock` but not moved to the top of the expectation by + * babel-jest. + */ + dontMock(moduleName: string): JestObjectType, + /** + * Returns a new, unused mock function. Optionally takes a mock + * implementation. + */ + fn, TReturn>( + implementation?: (...args: TArguments) => TReturn + ): JestMockFn, + /** + * Determines if the given function is a mocked function. + */ + isMockFunction(fn: Function): boolean, + /** + * Given the name of a module, use the automatic mocking system to generate a + * mocked version of the module for you. + */ + genMockFromModule(moduleName: string): any, + /** + * Mocks a module with an auto-mocked version when it is being required. + * + * The second argument can be used to specify an explicit module factory that + * is being run instead of using Jest's automocking feature. + * + * The third argument can be used to create virtual mocks -- mocks of modules + * that don't exist anywhere in the system. + */ + mock( + moduleName: string, + moduleFactory?: any, + options?: Object + ): JestObjectType, + /** + * Returns the actual module instead of a mock, bypassing all checks on + * whether the module should receive a mock implementation or not. + */ + requireActual(moduleName: string): any, + /** + * Returns a mock module instead of the actual module, bypassing all checks + * on whether the module should be required normally or not. + */ + requireMock(moduleName: string): any, + /** + * Resets the module registry - the cache of all required modules. This is + * useful to isolate modules where local state might conflict between tests. + */ + resetModules(): JestObjectType, + /** + * Creates a sandbox registry for the modules that are loaded inside the + * callback function. This is useful to isolate specific modules for every + * test so that local module state doesn't conflict between tests. + */ + isolateModules(fn: () => void): JestObjectType, + /** + * Exhausts the micro-task queue (usually interfaced in node via + * process.nextTick). + */ + runAllTicks(): void, + /** + * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(), + * setInterval(), and setImmediate()). + */ + runAllTimers(): void, + /** + * Exhausts all tasks queued by setImmediate(). + */ + runAllImmediates(): void, + /** + * Executes only the macro task queue (i.e. all tasks queued by setTimeout() + * or setInterval() and setImmediate()). + */ + advanceTimersByTime(msToRun: number): void, + /** + * Executes only the macro task queue (i.e. all tasks queued by setTimeout() + * or setInterval() and setImmediate()). + * + * Renamed to `advanceTimersByTime`. + */ + runTimersToTime(msToRun: number): void, + /** + * Executes only the macro-tasks that are currently pending (i.e., only the + * tasks that have been queued by setTimeout() or setInterval() up to this + * point) + */ + runOnlyPendingTimers(): void, + /** + * Explicitly supplies the mock object that the module system should return + * for the specified module. Note: It is recommended to use jest.mock() + * instead. + */ + setMock(moduleName: string, moduleExports: any): JestObjectType, + /** + * Indicates that the module system should never return a mocked version of + * the specified module from require() (e.g. that it should always return the + * real module). + */ + unmock(moduleName: string): JestObjectType, + /** + * Instructs Jest to use fake versions of the standard timer functions + * (setTimeout, setInterval, clearTimeout, clearInterval, nextTick, + * setImmediate and clearImmediate). + */ + useFakeTimers(): JestObjectType, + /** + * Instructs Jest to use the real versions of the standard timer functions. + */ + useRealTimers(): JestObjectType, + /** + * Creates a mock function similar to jest.fn but also tracks calls to + * object[methodName]. + */ + spyOn( + object: Object, + methodName: string, + accessType?: 'get' | 'set' + ): JestMockFn, + /** + * Set the default timeout interval for tests and before/after hooks in milliseconds. + * Note: The default timeout interval is 5 seconds if this method is not called. + */ + setTimeout(timeout: number): JestObjectType, + ... +}; + +type JestSpyType = { calls: JestCallsType, ... }; + +type JestDoneFn = {| + (): void, + fail: (error: Error) => void, +|}; + +/** Runs this function after every test inside this context */ +declare function afterEach( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** Runs this function before every test inside this context */ +declare function beforeEach( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** Runs this function after all tests have finished inside this context */ +declare function afterAll( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** Runs this function before any tests have started inside this context */ +declare function beforeAll( + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; + +/** A context for grouping tests together */ +declare var describe: { + /** + * Creates a block that groups together several related tests in one "test suite" + */ + (name: JestTestName, fn: () => void): void, + /** + * Only run this describe block + */ + only(name: JestTestName, fn: () => void): void, + /** + * Skip running this describe block + */ + skip(name: JestTestName, fn: () => void): void, + /** + * each runs this test against array of argument arrays per each run + * + * @param {table} table of Test + */ + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + ... +}; + +/** An individual test unit */ +declare var it: { + /** + * An individual test unit + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + ( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + /** + * Only run this test + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + only: {| + ( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void + |}, + /** + * Skip running this test + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + skip( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + /** + * Highlight planned tests in the summary output + * + * @param {String} Name of Test to do + */ + todo(name: string): void, + /** + * Run the test concurrently + * + * @param {JestTestName} Name of Test + * @param {Function} Test + * @param {number} Timeout for the test, in milliseconds. + */ + concurrent( + name: JestTestName, + fn?: (done: JestDoneFn) => ?Promise, + timeout?: number + ): void, + /** + * each runs this test against array of argument arrays per each run + * + * @param {table} table of Test + */ + each( + ...table: Array | mixed> | [Array, string] + ): ( + name: JestTestName, + fn?: (...args: Array) => ?Promise, + timeout?: number + ) => void, + ... +}; + +declare function fit( + name: JestTestName, + fn: (done: JestDoneFn) => ?Promise, + timeout?: number +): void; +/** An individual test unit */ +declare var test: typeof it; +/** A disabled group of tests */ +declare var xdescribe: typeof describe; +/** A focused group of tests */ +declare var fdescribe: typeof describe; +/** A disabled individual test */ +declare var xit: typeof it; +/** A disabled individual test */ +declare var xtest: typeof it; + +type JestPrettyFormatColors = { + comment: { + close: string, + open: string, + ... + }, + content: { + close: string, + open: string, + ... + }, + prop: { + close: string, + open: string, + ... + }, + tag: { + close: string, + open: string, + ... + }, + value: { + close: string, + open: string, + ... + }, + ... +}; + +type JestPrettyFormatIndent = string => string; +type JestPrettyFormatRefs = Array; +type JestPrettyFormatPrint = any => string; +type JestPrettyFormatStringOrNull = string | null; + +type JestPrettyFormatOptions = {| + callToJSON: boolean, + edgeSpacing: string, + escapeRegex: boolean, + highlight: boolean, + indent: number, + maxDepth: number, + min: boolean, + plugins: JestPrettyFormatPlugins, + printFunctionName: boolean, + spacing: string, + theme: {| + comment: string, + content: string, + prop: string, + tag: string, + value: string, + |}, +|}; + +type JestPrettyFormatPlugin = { + print: ( + val: any, + serialize: JestPrettyFormatPrint, + indent: JestPrettyFormatIndent, + opts: JestPrettyFormatOptions, + colors: JestPrettyFormatColors + ) => string, + test: any => boolean, + ... +}; + +type JestPrettyFormatPlugins = Array; + +/** The expect function is used every time you want to test a value */ +declare var expect: { + /** The object that you want to make assertions against */ + ( + value: any + ): JestExpectType & + JestPromiseType & + EnzymeMatchersType & + DomTestingLibraryType & + JestJQueryMatchersType & + JestStyledComponentsMatchersType & + JestExtendedMatchersType, + /** Add additional Jasmine matchers to Jest's roster */ + extend(matchers: { [name: string]: JestMatcher, ... }): void, + /** Add a module that formats application-specific data structures. */ + addSnapshotSerializer(pluginModule: JestPrettyFormatPlugin): void, + assertions(expectedAssertions: number): void, + hasAssertions(): void, + any(value: mixed): JestAsymmetricEqualityType, + anything(): any, + arrayContaining(value: Array): Array, + objectContaining(value: Object): Object, + /** Matches any received string that contains the exact expected string. */ + stringContaining(value: string): string, + stringMatching(value: string | RegExp): string, + not: { + arrayContaining: (value: $ReadOnlyArray) => Array, + objectContaining: (value: {...}) => Object, + stringContaining: (value: string) => string, + stringMatching: (value: string | RegExp) => string, + ... + }, + ... +}; + +// TODO handle return type +// http://jasmine.github.io/2.4/introduction.html#section-Spies +declare function spyOn(value: mixed, method: string): Object; + +/** Holds all functions related to manipulating test runner */ +declare var jest: JestObjectType; + +/** + * The global Jasmine object, this is generally not exposed as the public API, + * using features inside here could break in later versions of Jest. + */ +declare var jasmine: { + DEFAULT_TIMEOUT_INTERVAL: number, + any(value: mixed): JestAsymmetricEqualityType, + anything(): any, + arrayContaining(value: Array): Array, + clock(): JestClockType, + createSpy(name: string): JestSpyType, + createSpyObj( + baseName: string, + methodNames: Array + ): { [methodName: string]: JestSpyType, ... }, + objectContaining(value: Object): Object, + stringMatching(value: string): string, + ... +}; diff --git a/index-dev.js b/index-dev.js index 55749147e..fd469050d 100644 --- a/index-dev.js +++ b/index-dev.js @@ -1,5 +1,5 @@ -module.exports = require('./lib/ReactGridLayout').default; -module.exports.utils = require('./lib/utils'); -module.exports.Responsive = require('./lib/ResponsiveReactGridLayout').default; -module.exports.Responsive.utils = require('./lib/responsiveUtils'); -module.exports.WidthProvider = require('./lib/components/WidthProvider').default; +module.exports = require("./lib/ReactGridLayout").default; +module.exports.utils = require("./lib/utils"); +module.exports.Responsive = require("./lib/ResponsiveReactGridLayout").default; +module.exports.Responsive.utils = require("./lib/responsiveUtils"); +module.exports.WidthProvider = require("./lib/components/WidthProvider").default; diff --git a/index.js b/index.js index 2455aa050..307708f34 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ -module.exports = require('./build/ReactGridLayout').default; -module.exports.utils = require('./build/utils'); -module.exports.Responsive = require('./build/ResponsiveReactGridLayout').default; -module.exports.Responsive.utils = require('./build/responsiveUtils'); -module.exports.WidthProvider = require('./build/components/WidthProvider').default; +module.exports = require("./build/ReactGridLayout").default; +module.exports.utils = require("./build/utils"); +module.exports.Responsive = require("./build/ResponsiveReactGridLayout").default; +module.exports.Responsive.utils = require("./build/responsiveUtils"); +module.exports.WidthProvider = require("./build/components/WidthProvider").default; diff --git a/index.js.flow b/index.js.flow index 6c5fe619d..880e03a4c 100644 --- a/index.js.flow +++ b/index.js.flow @@ -1,10 +1,8 @@ // @flow -import * as utils from './lib/utils'; -export { default } from './lib/ReactGridLayout'; -export { default as Responsive } from './lib/ResponsiveReactGridLayout'; -export { default as WidthProvider } from './lib/components/WidthProvider'; +import * as utils from "./lib/utils"; +export { default } from "./lib/ReactGridLayout"; +export { default as Responsive } from "./lib/ResponsiveReactGridLayout"; +export { default as WidthProvider } from "./lib/components/WidthProvider"; -export { - utils -}; +export { utils }; diff --git a/interfaces/classnames.js b/interfaces/classnames.js index 9c4b5b5ea..95333f276 100644 --- a/interfaces/classnames.js +++ b/interfaces/classnames.js @@ -1,3 +1,4 @@ +// @flow // flow-typed signature: 3fba12a77525f37b0492c8dab3e04f0e // flow-typed version: 94e9f7e0a4/classnames_v2.x.x/flow_>=v0.28.x diff --git a/lib/GridItem.jsx b/lib/GridItem.jsx index 9ef75b1ff..863664881 100644 --- a/lib/GridItem.jsx +++ b/lib/GridItem.jsx @@ -1,9 +1,18 @@ // @flow import React from "react"; +import ReactDOM from "react-dom"; import PropTypes from "prop-types"; import { DraggableCore } from "react-draggable"; import { Resizable } from "react-resizable"; -import { perc, setTopLeft, setTransform } from "./utils"; +import { fastPositionEqual, perc, setTopLeft, setTransform } from "./utils"; +import { + calcGridItemPosition, + calcGridItemWHPx, + calcGridColWidth, + calcXY, + calcWH, + clamp +} from "./calculateUtils"; import classNames from "classnames"; import type { Element as ReactElement, Node as ReactNode } from "react"; @@ -11,9 +20,12 @@ import type { ReactDraggableCallbackData, GridDragEvent, GridResizeEvent, + DroppingPosition, Position } from "./utils"; +import type { PositionParams } from "./calculateUtils"; + type PartialPosition = { top: number, left: number }; type GridItemCallback = ( i: string, @@ -38,9 +50,12 @@ type Props = { maxRows: number, isDraggable: boolean, isResizable: boolean, + isBounded: boolean, static?: boolean, useCSSTransforms?: boolean, usePercentages?: boolean, + transformScale: number, + droppingPosition?: DroppingPosition, className: string, style?: Object, @@ -59,6 +74,8 @@ type Props = { maxH: number, i: string, + resizeHandles?: string[], + onDrag?: GridItemCallback, onDragStart?: GridItemCallback, onDragStop?: GridItemCallback, @@ -90,28 +107,28 @@ export default class GridItem extends React.Component { h: PropTypes.number.isRequired, // All optional - minW: function(props: Props, propName: string) { + minW: function (props: Props, propName: string) { const value = props[propName]; if (typeof value !== "number") return new Error("minWidth not Number"); if (value > props.w || value > props.maxW) return new Error("minWidth larger than item width/maxWidth"); }, - maxW: function(props: Props, propName: string) { + maxW: function (props: Props, propName: string) { const value = props[propName]; if (typeof value !== "number") return new Error("maxWidth not Number"); if (value < props.w || value < props.minW) return new Error("maxWidth smaller than item width/minWidth"); }, - minH: function(props: Props, propName: string) { + minH: function (props: Props, propName: string) { const value = props[propName]; if (typeof value !== "number") return new Error("minHeight not Number"); if (value > props.h || value > props.maxH) return new Error("minHeight larger than item height/maxHeight"); }, - maxH: function(props: Props, propName: string) { + maxH: function (props: Props, propName: string) { const value = props[propName]; if (typeof value !== "number") return new Error("maxHeight not Number"); if (value < props.h || value < props.minH) @@ -132,17 +149,25 @@ export default class GridItem extends React.Component { // Flags isDraggable: PropTypes.bool.isRequired, isResizable: PropTypes.bool.isRequired, + isBounded: PropTypes.bool.isRequired, static: PropTypes.bool, // Use CSS transforms instead of top/left useCSSTransforms: PropTypes.bool.isRequired, + transformScale: PropTypes.number, // Others className: PropTypes.string, // Selector for draggable handle handle: PropTypes.string, // Selector for draggable cancel (see react-draggable) - cancel: PropTypes.string + cancel: PropTypes.string, + // Current position of a dropping element + droppingPosition: PropTypes.shape({ + e: PropTypes.object.isRequired, + left: PropTypes.number.isRequired, + top: PropTypes.number.isRequired + }) }; static defaultProps = { @@ -152,7 +177,8 @@ export default class GridItem extends React.Component { minH: 1, minW: 1, maxH: Infinity, - maxW: Infinity + maxW: Infinity, + transformScale: 1 }; state: State = { @@ -161,115 +187,92 @@ export default class GridItem extends React.Component { className: "" }; - // Helper for generating column width - calcColWidth(): number { - const { margin, containerPadding, containerWidth, cols } = this.props; + currentNode: HTMLElement; + + shouldComponentUpdate(nextProps: Props, nextState: State) { + // We can't deeply compare children. If the developer memoizes them, we can + // use this optimization. + if (this.props.children !== nextProps.children) return true; + if (this.props.droppingPosition !== nextProps.droppingPosition) return true; + // TODO memoize these calculations so they don't take so long? + const oldPosition = calcGridItemPosition( + this.getPositionParams(this.props), + this.props.x, + this.props.y, + this.props.w, + this.props.h, + this.state + ); + const newPosition = calcGridItemPosition( + this.getPositionParams(nextProps), + nextProps.x, + nextProps.y, + nextProps.w, + nextProps.h, + nextState + ); return ( - (containerWidth - margin[0] * (cols - 1) - containerPadding[0] * 2) / cols + !fastPositionEqual(oldPosition, newPosition) || + this.props.useCSSTransforms !== nextProps.useCSSTransforms ); } - /** - * Return position on the page given an x, y, w, h. - * left, top, width, height are all in pixels. - * @param {Number} x X coordinate in grid units. - * @param {Number} y Y coordinate in grid units. - * @param {Number} w W coordinate in grid units. - * @param {Number} h H coordinate in grid units. - * @return {Object} Object containing coords. - */ - calcPosition( - x: number, - y: number, - w: number, - h: number, - state: ?Object - ): Position { - const { margin, containerPadding, rowHeight } = this.props; - const colWidth = this.calcColWidth(); - - const out = { - left: Math.round((colWidth + margin[0]) * x + containerPadding[0]), - top: Math.round((rowHeight + margin[1]) * y + containerPadding[1]), - // 0 * Infinity === NaN, which causes problems with resize constraints; - // Fix this if it occurs. - // Note we do it here rather than later because Math.round(Infinity) causes deopt - width: - w === Infinity - ? w - : Math.round(colWidth * w + Math.max(0, w - 1) * margin[0]), - height: - h === Infinity - ? h - : Math.round(rowHeight * h + Math.max(0, h - 1) * margin[1]) + componentDidMount() { + this.moveDroppingItem({}); + } + + componentDidUpdate(prevProps: Props) { + this.moveDroppingItem(prevProps); + } + + // When a droppingPosition is present, this means we should fire a move event, as if we had moved + // this element by `x, y` pixels. + moveDroppingItem(prevProps: Props) { + const { droppingPosition } = this.props; + if (!droppingPosition) return; + + const prevDroppingPosition = prevProps.droppingPosition || { + left: 0, + top: 0 }; + const { dragging } = this.state; - if (state && state.resizing) { - out.width = Math.round(state.resizing.width); - out.height = Math.round(state.resizing.height); + if (!this.currentNode) { + // eslint-disable-next-line react/no-find-dom-node + this.currentNode = ((ReactDOM.findDOMNode(this): any): HTMLElement); } - if (state && state.dragging) { - out.top = Math.round(state.dragging.top); - out.left = Math.round(state.dragging.left); + const shouldDrag = + (dragging && droppingPosition.left !== prevDroppingPosition.left) || + droppingPosition.top !== prevDroppingPosition.top; + + if (!dragging) { + this.onDragStart(droppingPosition.e, { + node: this.currentNode, + deltaX: droppingPosition.left, + deltaY: droppingPosition.top + }); + } else if (shouldDrag) { + const deltaX = droppingPosition.left - dragging.left; + const deltaY = droppingPosition.top - dragging.top; + + this.onDrag(droppingPosition.e, { + node: this.currentNode, + deltaX, + deltaY + }); } - - return out; } - /** - * Translate x and y coordinates from pixels to grid units. - * @param {Number} top Top position (relative to parent) in pixels. - * @param {Number} left Left position (relative to parent) in pixels. - * @return {Object} x and y in grid units. - */ - calcXY(top: number, left: number): { x: number, y: number } { - const { margin, cols, rowHeight, w, h, maxRows } = this.props; - const colWidth = this.calcColWidth(); - - // left = colWidth * x + margin * (x + 1) - // l = cx + m(x+1) - // l = cx + mx + m - // l - m = cx + mx - // l - m = x(c + m) - // (l - m) / (c + m) = x - // x = (left - margin) / (coldWidth + margin) - let x = Math.round((left - margin[0]) / (colWidth + margin[0])); - let y = Math.round((top - margin[1]) / (rowHeight + margin[1])); - - // Capping - x = Math.max(Math.min(x, cols - w), 0); - y = Math.max(Math.min(y, maxRows - h), 0); - - return { x, y }; - } - - /** - * Given a height and width in pixel values, calculate grid units. - * @param {Number} height Height in pixels. - * @param {Number} width Width in pixels. - * @return {Object} w, h as grid units. - */ - calcWH({ - height, - width - }: { - height: number, - width: number - }): { w: number, h: number } { - const { margin, maxRows, cols, rowHeight, x, y } = this.props; - const colWidth = this.calcColWidth(); - - // width = colWidth * w - (margin * (w - 1)) - // ... - // w = (width + margin) / (colWidth + margin) - let w = Math.round((width + margin[0]) / (colWidth + margin[0])); - let h = Math.round((height + margin[1]) / (rowHeight + margin[1])); - - // Capping - w = Math.max(Math.min(w, cols - x), 0); - h = Math.max(Math.min(h, maxRows - y), 0); - return { w, h }; + getPositionParams(props: Props = this.props): PositionParams { + return { + cols: props.cols, + containerPadding: props.containerPadding, + containerWidth: props.containerWidth, + margin: props.margin, + maxRows: props.maxRows, + rowHeight: props.rowHeight + }; } /** @@ -308,17 +311,22 @@ export default class GridItem extends React.Component { * @param {Element} child Child element. * @return {Element} Child wrapped in Draggable. */ - mixinDraggable(child: ReactElement): ReactElement { + mixinDraggable( + child: ReactElement, + isDraggable: boolean + ): ReactElement { return ( {child} @@ -333,16 +341,28 @@ export default class GridItem extends React.Component { */ mixinResizable( child: ReactElement, - position: Position + position: Position, + isResizable: boolean ): ReactElement { - const { cols, x, minW, minH, maxW, maxH } = this.props; + const { + cols, + x, + minW, + minH, + maxW, + maxH, + transformScale, + resizeHandles + } = this.props; + const positionParams = this.getPositionParams(); // This is the max possible width - doesn't go to infinity because of the width of the window - const maxWidth = this.calcPosition(0, 0, cols - x, 0).width; + const maxWidth = calcGridItemPosition(positionParams, 0, 0, cols - x, 0) + .width; // Calculate min/max constraints using our min & maxes - const mins = this.calcPosition(0, 0, minW, minH); - const maxes = this.calcPosition(0, 0, maxW, maxH); + const mins = calcGridItemPosition(positionParams, 0, 0, minW, minH); + const maxes = calcGridItemPosition(positionParams, 0, 0, maxW, maxH); const minConstraints = [mins.width, mins.height]; const maxConstraints = [ Math.min(maxes.width, maxWidth), @@ -350,13 +370,19 @@ export default class GridItem extends React.Component { ]; return ( {child} @@ -364,60 +390,155 @@ export default class GridItem extends React.Component { } /** - * Wrapper around drag events to provide more useful data. - * All drag events call the function with the given handler name, - * with the signature (index, x, y). - * - * @param {String} handlerName Handler name to wrap. - * @return {Function} Handler function. + * onDragStart event handler + * @param {Event} e event data + * @param {Object} callbackData an object with node, delta and position information */ - onDragHandler(handlerName: string) { - return (e: Event, { node, deltaX, deltaY }: ReactDraggableCallbackData) => { - const handler = this.props[handlerName]; - if (!handler) return; - - const newPosition: PartialPosition = { top: 0, left: 0 }; - - // Get new XY - switch (handlerName) { - case "onDragStart": { - // TODO: this wont work on nested parents - const { offsetParent } = node; - if (!offsetParent) return; - const parentRect = offsetParent.getBoundingClientRect(); - const clientRect = node.getBoundingClientRect(); - newPosition.left = - clientRect.left - parentRect.left + offsetParent.scrollLeft; - newPosition.top = - clientRect.top - parentRect.top + offsetParent.scrollTop; - this.setState({ dragging: newPosition }); - break; - } - case "onDrag": - if (!this.state.dragging) - throw new Error("onDrag called before onDragStart."); - newPosition.left = this.state.dragging.left + deltaX; - newPosition.top = this.state.dragging.top + deltaY; - this.setState({ dragging: newPosition }); - break; - case "onDragStop": - if (!this.state.dragging) - throw new Error("onDragEnd called before onDragStart."); - newPosition.left = this.state.dragging.left; - newPosition.top = this.state.dragging.top; - this.setState({ dragging: null }); - break; - default: - throw new Error( - "onDragHandler called with unrecognized handlerName: " + handlerName - ); + onDragStart = (e: Event, { node }: ReactDraggableCallbackData) => { + const { onDragStart } = this.props; + if (!onDragStart) return; + + const newPosition: PartialPosition = { top: 0, left: 0 }; + + // TODO: this wont work on nested parents + const { offsetParent } = node; + if (!offsetParent) return; + const parentRect = offsetParent.getBoundingClientRect(); + const clientRect = node.getBoundingClientRect(); + const cLeft = clientRect.left / this.props.transformScale; + const pLeft = parentRect.left / this.props.transformScale; + const cTop = clientRect.top / this.props.transformScale; + const pTop = parentRect.top / this.props.transformScale; + newPosition.left = cLeft - pLeft + offsetParent.scrollLeft; + newPosition.top = cTop - pTop + offsetParent.scrollTop; + this.setState({ dragging: newPosition }); + + // Call callback with this data + const { x, y } = calcXY( + this.getPositionParams(), + newPosition.top, + newPosition.left, + this.props.w, + this.props.h + ); + + return onDragStart.call(this, this.props.i, x, y, { + e, + node, + newPosition + }); + }; + + /** + * onDrag event handler + * @param {Event} e event data + * @param {Object} callbackData an object with node, delta and position information + */ + onDrag = (e: Event, { node, deltaX, deltaY }: ReactDraggableCallbackData) => { + const { onDrag, transformScale } = this.props; + if (!onDrag) return; + deltaX /= transformScale; + deltaY /= transformScale; + + if (!this.state.dragging) { + throw new Error("onDrag called before onDragStart."); + } + let top = this.state.dragging.top + deltaY; + let left = this.state.dragging.left + deltaX; + + const { isBounded, i, w, h, containerWidth } = this.props; + const positionParams = this.getPositionParams(); + + // Boundary calculations; keeps items within the grid + if (isBounded) { + const { offsetParent } = node; + + if (offsetParent) { + const { margin, rowHeight } = this.props; + const bottomBoundary = + offsetParent.clientHeight - calcGridItemWHPx(h, rowHeight, margin[1]); + top = clamp(top, 0, bottomBoundary); + + const colWidth = calcGridColWidth(positionParams); + const rightBoundary = + containerWidth - calcGridItemWHPx(w, colWidth, margin[0]); + left = clamp(left, 0, rightBoundary); } + } - const { x, y } = this.calcXY(newPosition.top, newPosition.left); + const newPosition: PartialPosition = { top, left }; + this.setState({ dragging: newPosition }); - return handler.call(this, this.props.i, x, y, { e, node, newPosition }); - }; - } + // Call callback with this data + const { x, y } = calcXY(positionParams, top, left, w, h); + return onDrag.call(this, i, x, y, { + e, + node, + newPosition + }); + }; + + /** + * onDragStop event handler + * @param {Event} e event data + * @param {Object} callbackData an object with node, delta and position information + */ + onDragStop = (e: Event, { node }: ReactDraggableCallbackData) => { + const { onDragStop } = this.props; + if (!onDragStop) return; + + if (!this.state.dragging) { + throw new Error("onDragEnd called before onDragStart."); + } + const { w, h, i } = this.props; + const { left, top } = this.state.dragging; + const newPosition: PartialPosition = { top, left }; + this.setState({ dragging: null }); + + const { x, y } = calcXY(this.getPositionParams(), top, left, w, h); + + return onDragStop.call(this, i, x, y, { + e, + node, + newPosition + }); + }; + + /** + * onResizeStop event handler + * @param {Event} e event data + * @param {Object} callbackData an object with node and size information + */ + onResizeStop = ( + e: Event, + callbackData: { node: HTMLElement, size: Position } + ) => { + this.onResizeHandler(e, callbackData, "onResizeStop"); + }; + + /** + * onResizeStart event handler + * @param {Event} e event data + * @param {Object} callbackData an object with node and size information + */ + onResizeStart = ( + e: Event, + callbackData: { node: HTMLElement, size: Position } + ) => { + this.onResizeHandler(e, callbackData, "onResizeStart"); + }; + + /** + * onResize event handler + * @param {Event} e event data + * @param {Object} callbackData an object with node and size information + */ + onResize = ( + e: Event, + callbackData: { node: HTMLElement, size: Position } + ) => { + this.onResizeHandler(e, callbackData, "onResize"); + }; /** * Wrapper around drag events to provide more useful data. @@ -427,31 +548,38 @@ export default class GridItem extends React.Component { * @param {String} handlerName Handler name to wrap. * @return {Function} Handler function. */ - onResizeHandler(handlerName: string) { - return ( - e: Event, - { node, size }: { node: HTMLElement, size: Position } - ) => { - const handler = this.props[handlerName]; - if (!handler) return; - const { cols, x, i, maxW, minW, maxH, minH } = this.props; + onResizeHandler( + e: Event, + { node, size }: { node: HTMLElement, size: Position }, + handlerName: string + ) { + const handler = this.props[handlerName]; + if (!handler) return; + const { cols, x, y, i, maxH, minH } = this.props; + let { minW, maxW } = this.props; + + // Get new XY + let { w, h } = calcWH( + this.getPositionParams(), + size.width, + size.height, + x, + y + ); - // Get new XY - let { w, h } = this.calcWH(size); + // minW should be at least 1 (TODO propTypes validation?) + minW = Math.max(minW, 1); - // Cap w at numCols - w = Math.min(w, cols - x); - // Ensure w is at least 1 - w = Math.max(w, 1); + // maxW should be at most (cols - x) + maxW = Math.min(maxW, cols - x); - // Min/max capping - w = Math.max(Math.min(w, maxW), minW); - h = Math.max(Math.min(h, maxH), minH); + // Min/max capping + w = clamp(w, minW, maxW); + h = clamp(h, minH, maxH); - this.setState({ resizing: handlerName === "onResizeStop" ? null : size }); + this.setState({ resizing: handlerName === "onResizeStop" ? null : size }); - handler.call(this, i, w, h, { e, node, size }); - }; + handler.call(this, i, w, h, { e, node, size }); } render(): ReactNode { @@ -462,10 +590,18 @@ export default class GridItem extends React.Component { h, isDraggable, isResizable, + droppingPosition, useCSSTransforms } = this.props; - const pos = this.calcPosition(x, y, w, h, this.state); + const pos = calcGridItemPosition( + this.getPositionParams(), + x, + y, + w, + h, + this.state + ); const child = React.Children.only(this.props.children); // Create the child element. We clone the existing element but modify its className and style. @@ -479,6 +615,7 @@ export default class GridItem extends React.Component { resizing: Boolean(this.state.resizing), "react-draggable": isDraggable, "react-draggable-dragging": Boolean(this.state.dragging), + dropping: Boolean(droppingPosition), cssTransforms: useCSSTransforms } ), @@ -491,10 +628,10 @@ export default class GridItem extends React.Component { }); // Resizable support. This is usually on but the user can toggle it off. - if (isResizable) newChild = this.mixinResizable(newChild, pos); + newChild = this.mixinResizable(newChild, pos, isResizable); // Draggable support. This is always on, except for with placeholders. - if (isDraggable) newChild = this.mixinDraggable(newChild); + newChild = this.mixinDraggable(newChild, isDraggable); return newChild; } diff --git a/lib/ReactGridLayout.jsx b/lib/ReactGridLayout.jsx index 7fd338693..3b63830f0 100644 --- a/lib/ReactGridLayout.jsx +++ b/lib/ReactGridLayout.jsx @@ -1,6 +1,6 @@ // @flow import React from "react"; -import PropTypes from "prop-types"; + import isEqual from "lodash.isequal"; import classNames from "classnames"; import { @@ -12,11 +12,16 @@ import { getLayoutItem, moveElement, synchronizeLayoutWithChildren, - validateLayout, getAllCollisions, - noop + compactType, + noop, + fastRGLPropsEqual } from "./utils"; + +import { calcXY } from "./calculateUtils"; + import GridItem from "./GridItem"; +import ReactGridLayoutPropTypes from "./ReactGridLayoutPropTypes"; import type { ChildrenArray as ReactChildrenArray, Element as ReactElement @@ -24,55 +29,45 @@ import type { // Types import type { - EventCallback, CompactType, GridResizeEvent, GridDragEvent, + DragOverEvent, Layout, + DroppingPosition, LayoutItem } from "./utils"; +import type { PositionParams } from "./calculateUtils"; + type State = { activeDrag: ?LayoutItem, layout: Layout, mounted: boolean, oldDragItem: ?LayoutItem, oldLayout: ?Layout, - oldResizeItem: ?LayoutItem + oldResizeItem: ?LayoutItem, + droppingDOMNode: ?ReactElement, + droppingPosition?: DroppingPosition, + // Mirrored props + children: ReactChildrenArray>, + compactType?: CompactType, + propsLayout?: Layout }; -export type Props = { - className: string, - style: Object, - width: number, - autoSize: boolean, - cols: number, - draggableCancel: string, - draggableHandle: string, - verticalCompact: boolean, - compactType: ?("horizontal" | "vertical"), - layout: Layout, - margin: [number, number], - containerPadding: [number, number] | null, - rowHeight: number, - maxRows: number, - isDraggable: boolean, - isResizable: boolean, - preventCollision: boolean, - useCSSTransforms: boolean, - - // Callbacks - onLayoutChange: Layout => void, - onDrag: EventCallback, - onDragStart: EventCallback, - onDragStop: EventCallback, - onResize: EventCallback, - onResizeStart: EventCallback, - onResizeStop: EventCallback, - children: ReactChildrenArray> -}; +import type { Props } from "./ReactGridLayoutPropTypes"; + // End Types +const layoutClassName = "react-grid-layout"; +let isFirefox = false; +// Try...catch will protect from navigator not existing (e.g. node) or a bad implementation of navigator +try { + isFirefox = /firefox/i.test(navigator.userAgent); +} catch (e) { + /* Ignore */ +} + /** * A reactive, fluid grid layout with draggable, resizable components. */ @@ -81,123 +76,8 @@ export default class ReactGridLayout extends React.Component { // TODO publish internal ReactClass displayName transform static displayName = "ReactGridLayout"; - static propTypes = { - // - // Basic props - // - className: PropTypes.string, - style: PropTypes.object, - - // This can be set explicitly. If it is not set, it will automatically - // be set to the container width. Note that resizes will *not* cause this to adjust. - // If you need that behavior, use WidthProvider. - width: PropTypes.number, - - // If true, the container height swells and contracts to fit contents - autoSize: PropTypes.bool, - // # of cols. - cols: PropTypes.number, - - // A selector that will not be draggable. - draggableCancel: PropTypes.string, - // A selector for the draggable handler - draggableHandle: PropTypes.string, - - // Deprecated - verticalCompact: function(props: Props) { - if ( - props.verticalCompact === false && - process.env.NODE_ENV !== "production" - ) { - console.warn( - // eslint-disable-line no-console - "`verticalCompact` on is deprecated and will be removed soon. " + - 'Use `compactType`: "horizontal" | "vertical" | null.' - ); - } - }, - // Choose vertical or hotizontal compaction - compactType: PropTypes.oneOf(["vertical", "horizontal"]), - - // layout is an array of object with the format: - // {x: Number, y: Number, w: Number, h: Number, i: String} - layout: function(props: Props) { - var layout = props.layout; - // I hope you're setting the data-grid property on the grid items - if (layout === undefined) return; - validateLayout(layout, "layout"); - }, - - // - // Grid Dimensions - // - - // Margin between items [x, y] in px - margin: PropTypes.arrayOf(PropTypes.number), - // Padding inside the container [x, y] in px - containerPadding: PropTypes.arrayOf(PropTypes.number), - // Rows have a static height, but you can change this based on breakpoints if you like - rowHeight: PropTypes.number, - // Default Infinity, but you can specify a max here if you like. - // Note that this isn't fully fleshed out and won't error if you specify a layout that - // extends beyond the row capacity. It will, however, not allow users to drag/resize - // an item past the barrier. They can push items beyond the barrier, though. - // Intentionally not documented for this reason. - maxRows: PropTypes.number, - - // - // Flags - // - isDraggable: PropTypes.bool, - isResizable: PropTypes.bool, - // If true, grid items won't change position when being dragged over. - preventCollision: PropTypes.bool, - // Use CSS transforms instead of top/left - useCSSTransforms: PropTypes.bool, - - // - // Callbacks - // - - // Callback so you can save the layout. Calls after each drag & resize stops. - onLayoutChange: PropTypes.func, - - // Calls when drag starts. Callback is of the signature (layout, oldItem, newItem, placeholder, e, ?node). - // All callbacks below have the same signature. 'start' and 'stop' callbacks omit the 'placeholder'. - onDragStart: PropTypes.func, - // Calls on each drag movement. - onDrag: PropTypes.func, - // Calls when drag is complete. - onDragStop: PropTypes.func, - //Calls when resize starts. - onResizeStart: PropTypes.func, - // Calls when resize movement happens. - onResize: PropTypes.func, - // Calls when resize is complete. - onResizeStop: PropTypes.func, - - // - // Other validations - // - - // Children must not have duplicate keys. - children: function(props: Props, propName: string) { - var children = props[propName]; - - // Check children keys for duplicates. Throw if found. - var keys = {}; - React.Children.forEach(children, function(child) { - if (keys[child.key]) { - throw new Error( - 'Duplicate child key "' + - child.key + - '" found! This will cause problems in ReactGridLayout.' - ); - } - keys[child.key] = true; - }); - } - }; + // Refactored to another module to make way for preval + static propTypes = ReactGridLayoutPropTypes; static defaultProps = { autoSize: true, @@ -211,19 +91,29 @@ export default class ReactGridLayout extends React.Component { maxRows: Infinity, // infinite vertical growth layout: [], margin: [10, 10], + isBounded: false, isDraggable: true, isResizable: true, + isDroppable: false, useCSSTransforms: true, + transformScale: 1, verticalCompact: true, compactType: "vertical", preventCollision: false, + droppingItem: { + i: "__dropping-elem__", + h: 1, + w: 1 + }, + resizeHandles: ["se"], onLayoutChange: noop, onDragStart: noop, onDrag: noop, onDragStop: noop, onResizeStart: noop, onResize: noop, - onResizeStop: noop + onResizeStop: noop, + onDrop: noop }; state: State = { @@ -233,14 +123,18 @@ export default class ReactGridLayout extends React.Component { this.props.children, this.props.cols, // Legacy support for verticalCompact: false - this.compactType() + compactType(this.props) ), mounted: false, oldDragItem: null, oldLayout: null, - oldResizeItem: null + oldResizeItem: null, + droppingDOMNode: null, + children: [] }; + dragEnterCounter = 0; + constructor(props: Props, context: any): void { super(props, context); autoBindHandlers(this, [ @@ -260,20 +154,25 @@ export default class ReactGridLayout extends React.Component { this.onLayoutMaybeChanged(this.state.layout, this.props.layout); } - componentWillReceiveProps(nextProps: Props) { + static getDerivedStateFromProps(nextProps: Props, prevState: State) { let newLayoutBase; + + if (prevState.activeDrag) { + return null; + } + // Legacy support for compactType // Allow parent to set layout directly. if ( - !isEqual(nextProps.layout, this.props.layout) || - nextProps.compactType !== this.props.compactType + !isEqual(nextProps.layout, prevState.propsLayout) || + nextProps.compactType !== prevState.compactType ) { newLayoutBase = nextProps.layout; - } else if (!childrenEqual(this.props.children, nextProps.children)) { + } else if (!childrenEqual(nextProps.children, prevState.children)) { // If children change, also regenerate the layout. Use our state // as the base in case because it may be more up to date than // what is in props. - newLayoutBase = this.state.layout; + newLayoutBase = prevState.layout; } // We need to regenerate the layout. @@ -282,10 +181,40 @@ export default class ReactGridLayout extends React.Component { newLayoutBase, nextProps.children, nextProps.cols, - this.compactType(nextProps) + compactType(nextProps) ); - const oldLayout = this.state.layout; - this.setState({ layout: newLayout }); + + return { + layout: newLayout, + // We need to save these props to state for using + // getDerivedStateFromProps instead of componentDidMount (in which we would get extra rerender) + compactType: nextProps.compactType, + children: nextProps.children, + propsLayout: nextProps.layout + }; + } + + return null; + } + + shouldComponentUpdate(nextProps: Props, nextState: State) { + return ( + // NOTE: this is almost always unequal. Therefore the only way to get better performance + // from SCU is if the user intentionally memoizes children. If they do, and they can + // handle changes properly, performance will increase. + this.props.children !== nextProps.children || + !fastRGLPropsEqual(this.props, nextProps, isEqual) || + this.state.activeDrag !== nextState.activeDrag || + this.state.mounted !== nextState.mounted || + this.state.droppingPosition !== nextState.droppingPosition + ); + } + + componentDidUpdate(prevProps: Props, prevState: State) { + if (!this.state.activeDrag) { + const newLayout = this.state.layout; + const oldLayout = prevState.layout; + this.onLayoutMaybeChanged(newLayout, oldLayout); } } @@ -308,11 +237,6 @@ export default class ReactGridLayout extends React.Component { ); } - compactType(props: ?Object): CompactType { - if (!props) props = this.props; - return props.verticalCompact === false ? null : props.compactType; - } - /** * When dragging starts * @param {String} i Id of the child @@ -368,14 +292,14 @@ export default class ReactGridLayout extends React.Component { y, isUserAction, this.props.preventCollision, - this.compactType(), + compactType(this.props), cols ); this.props.onDrag(layout, oldDragItem, l, placeholder, e, node); this.setState({ - layout: compact(layout, this.compactType(), cols), + layout: compact(layout, compactType(this.props), cols), activeDrag: placeholder }); } @@ -389,6 +313,8 @@ export default class ReactGridLayout extends React.Component { * @param {Element} node The current dragging DOM element */ onDragStop(i: string, x: number, y: number, { e, node }: GridDragEvent) { + if (!this.state.activeDrag) return; + const { oldDragItem } = this.state; let { layout } = this.state; const { cols, preventCollision } = this.props; @@ -404,14 +330,14 @@ export default class ReactGridLayout extends React.Component { y, isUserAction, preventCollision, - this.compactType(), + compactType(this.props), cols ); this.props.onDragStop(layout, oldDragItem, l, null, e, node); // Set state - const newLayout = compact(layout, this.compactType(), cols); + const newLayout = compact(layout, compactType(this.props), cols); const { oldLayout } = this.state; this.setState({ activeDrag: null, @@ -425,6 +351,7 @@ export default class ReactGridLayout extends React.Component { onLayoutMaybeChanged(newLayout: Layout, oldLayout: ?Layout) { if (!oldLayout) oldLayout = this.state.layout; + if (!isEqual(oldLayout, newLayout)) { this.props.onLayoutChange(newLayout); } @@ -493,7 +420,7 @@ export default class ReactGridLayout extends React.Component { // Re-compact the layout and set the drag placeholder. this.setState({ - layout: compact(layout, this.compactType(), cols), + layout: compact(layout, compactType(this.props), cols), activeDrag: placeholder }); } @@ -506,7 +433,7 @@ export default class ReactGridLayout extends React.Component { this.props.onResizeStop(layout, oldResizeItem, l, null, e, node); // Set state - const newLayout = compact(layout, this.compactType(), cols); + const newLayout = compact(layout, compactType(this.props), cols); const { oldLayout } = this.state; this.setState({ activeDrag: null, @@ -532,7 +459,8 @@ export default class ReactGridLayout extends React.Component { containerPadding, rowHeight, maxRows, - useCSSTransforms + useCSSTransforms, + transformScale } = this.props; // {...this.state.activeDrag} is pretty slow, actually @@ -552,7 +480,9 @@ export default class ReactGridLayout extends React.Component { rowHeight={rowHeight} isDraggable={false} isResizable={false} + isBounded={false} useCSSTransforms={useCSSTransforms} + transformScale={transformScale} >
@@ -564,7 +494,10 @@ export default class ReactGridLayout extends React.Component { * @param {Element} child React element. * @return {Element} Element wrapped in draggable and properly placed. */ - processGridItem(child: ReactElement): ?ReactElement { + processGridItem( + child: ReactElement, + isDroppingItem?: boolean + ): ?ReactElement { if (!child || !child.key) return; const l = getLayoutItem(this.state.layout, String(child.key)); if (!l) return null; @@ -577,19 +510,30 @@ export default class ReactGridLayout extends React.Component { maxRows, isDraggable, isResizable, + isBounded, useCSSTransforms, + transformScale, draggableCancel, - draggableHandle + draggableHandle, + resizeHandles } = this.props; - const { mounted } = this.state; - - // Parse 'static'. Any properties defined directly on the grid item will take precedence. - const draggable = Boolean( - !l.static && isDraggable && (l.isDraggable || l.isDraggable == null) - ); - const resizable = Boolean( - !l.static && isResizable && (l.isResizable || l.isResizable == null) - ); + const { mounted, droppingPosition } = this.state; + + // Determine user manipulations possible. + // If an item is static, it can't be manipulated by default. + // Any properties defined directly on the grid item will take precedence. + const draggable = + typeof l.isDraggable === "boolean" + ? l.isDraggable + : !l.static && isDraggable; + const resizable = + typeof l.isResizable === "boolean" + ? l.isResizable + : !l.static && isResizable; + const resizeHandlesOptions = l.resizeHandles || resizeHandles; + + // isBounded set on child if set on parent, and child is not explicitly false + const bounded = draggable && isBounded && l.isBounded !== false; return ( { onResizeStop={this.onResizeStop} isDraggable={draggable} isResizable={resizable} + isBounded={bounded} useCSSTransforms={useCSSTransforms && mounted} usePercentages={!mounted} + transformScale={transformScale} w={l.w} h={l.h} x={l.x} @@ -621,26 +567,158 @@ export default class ReactGridLayout extends React.Component { maxH={l.maxH} maxW={l.maxW} static={l.static} + droppingPosition={isDroppingItem ? droppingPosition : undefined} + resizeHandles={resizeHandlesOptions} > {child} ); } + // Called while dragging an element. Part of browser native drag/drop API. + // Native event target might be the layout itself, or an element within the layout. + onDragOver = (e: DragOverEvent) => { + // we should ignore events from layout's children in Firefox + // to avoid unpredictable jumping of a dropping placeholder + // FIXME remove this hack + if ( + isFirefox && + e.nativeEvent.target.className.indexOf(layoutClassName) === -1 + ) { + return false; + } + + const { + droppingItem, + margin, + cols, + rowHeight, + maxRows, + width, + containerPadding + } = this.props; + const { layout } = this.state; + // This is relative to the DOM element that this event fired for. + const { layerX, layerY } = e.nativeEvent; + const droppingPosition = { left: layerX, top: layerY, e }; + + if (!this.state.droppingDOMNode) { + const positionParams: PositionParams = { + cols, + margin, + maxRows, + rowHeight, + containerWidth: width, + containerPadding: containerPadding || margin + }; + + const calculatedPosition = calcXY( + positionParams, + layerY, + layerX, + droppingItem.w, + droppingItem.h + ); + + this.setState({ + droppingDOMNode:
, + droppingPosition, + layout: [ + ...layout, + { + ...droppingItem, + x: calculatedPosition.x, + y: calculatedPosition.y, + static: false, + isDraggable: true + } + ] + }); + } else if (this.state.droppingPosition) { + const { left, top } = this.state.droppingPosition; + const shouldUpdatePosition = left != layerX || top != layerY; + if (shouldUpdatePosition) { + this.setState({ droppingPosition }); + } + } + + e.stopPropagation(); + e.preventDefault(); + }; + + removeDroppingPlaceholder = () => { + const { droppingItem, cols } = this.props; + const { layout } = this.state; + + const newLayout = compact( + layout.filter(l => l.i !== droppingItem.i), + compactType(this.props), + cols + ); + + this.setState({ + layout: newLayout, + droppingDOMNode: null, + activeDrag: null, + droppingPosition: undefined + }); + }; + + onDragLeave = () => { + this.dragEnterCounter--; + + // onDragLeave can be triggered on each layout's child. + // But we know that count of dragEnter and dragLeave events + // will be balanced after leaving the layout's container + // so we can increase and decrease count of dragEnter and + // when it'll be equal to 0 we'll remove the placeholder + if (this.dragEnterCounter === 0) { + this.removeDroppingPlaceholder(); + } + }; + + onDragEnter = () => { + this.dragEnterCounter++; + }; + + onDrop = (e: Event) => { + const { droppingItem } = this.props; + const { layout } = this.state; + const item = layout.find(l => l.i === droppingItem.i); + + // reset gragEnter counter on drop + this.dragEnterCounter = 0; + + this.removeDroppingPlaceholder(); + + this.props.onDrop(layout, item, e); + }; + render() { - const { className, style } = this.props; + const { className, style, isDroppable, innerRef } = this.props; - const mergedClassName = classNames("react-grid-layout", className); + const mergedClassName = classNames(layoutClassName, className); const mergedStyle = { height: this.containerHeight(), ...style }; return ( -
+
{React.Children.map(this.props.children, child => this.processGridItem(child) )} + {isDroppable && + this.state.droppingDOMNode && + this.processGridItem(this.state.droppingDOMNode, true)} {this.placeholder()}
); diff --git a/lib/ReactGridLayoutPropTypes.js b/lib/ReactGridLayoutPropTypes.js new file mode 100644 index 000000000..7c563c957 --- /dev/null +++ b/lib/ReactGridLayoutPropTypes.js @@ -0,0 +1,194 @@ +// @flow +import PropTypes from "prop-types"; +import React from "react"; +import type { + Ref, + ChildrenArray as ReactChildrenArray, + Element as ReactElement +} from "react"; +import type { EventCallback, CompactType, Layout, LayoutItem } from "./utils"; + +export type Props = {| + className: string, + style: Object, + width: number, + autoSize: boolean, + cols: number, + draggableCancel: string, + draggableHandle: string, + verticalCompact: boolean, + compactType: CompactType, + layout: Layout, + margin: [number, number], + containerPadding: [number, number] | null, + rowHeight: number, + maxRows: number, + isBounded: boolean, + isDraggable: boolean, + isResizable: boolean, + isDroppable: boolean, + preventCollision: boolean, + useCSSTransforms: boolean, + transformScale: number, + droppingItem: $Shape, + resizeHandles: string[], + + // Callbacks + onLayoutChange: Layout => void, + onDrag: EventCallback, + onDragStart: EventCallback, + onDragStop: EventCallback, + onResize: EventCallback, + onResizeStart: EventCallback, + onResizeStop: EventCallback, + onDrop: (layout: Layout, item: ?LayoutItem, e: Event) => void, + children: ReactChildrenArray>, + innerRef?: Ref<"div"> +|}; + +export default { + // + // Basic props + // + className: PropTypes.string, + style: PropTypes.object, + + // This can be set explicitly. If it is not set, it will automatically + // be set to the container width. Note that resizes will *not* cause this to adjust. + // If you need that behavior, use WidthProvider. + width: PropTypes.number, + + // If true, the container height swells and contracts to fit contents + autoSize: PropTypes.bool, + // # of cols. + cols: PropTypes.number, + + // A selector that will not be draggable. + draggableCancel: PropTypes.string, + // A selector for the draggable handler + draggableHandle: PropTypes.string, + + // Deprecated + verticalCompact: function (props: Props) { + if ( + props.verticalCompact === false && + process.env.NODE_ENV !== "production" + ) { + console.warn( + // eslint-disable-line no-console + "`verticalCompact` on is deprecated and will be removed soon. " + + 'Use `compactType`: "horizontal" | "vertical" | null.' + ); + } + }, + // Choose vertical or hotizontal compaction + compactType: PropTypes.oneOf(["vertical", "horizontal"]), + + // layout is an array of object with the format: + // {x: Number, y: Number, w: Number, h: Number, i: String} + layout: function (props: Props) { + var layout = props.layout; + // I hope you're setting the data-grid property on the grid items + if (layout === undefined) return; + require("./utils").validateLayout(layout, "layout"); + }, + + // + // Grid Dimensions + // + + // Margin between items [x, y] in px + margin: PropTypes.arrayOf(PropTypes.number), + // Padding inside the container [x, y] in px + containerPadding: PropTypes.arrayOf(PropTypes.number), + // Rows have a static height, but you can change this based on breakpoints if you like + rowHeight: PropTypes.number, + // Default Infinity, but you can specify a max here if you like. + // Note that this isn't fully fleshed out and won't error if you specify a layout that + // extends beyond the row capacity. It will, however, not allow users to drag/resize + // an item past the barrier. They can push items beyond the barrier, though. + // Intentionally not documented for this reason. + maxRows: PropTypes.number, + + // + // Flags + // + isBounded: PropTypes.bool, + isDraggable: PropTypes.bool, + isResizable: PropTypes.bool, + // If true, grid items won't change position when being dragged over. + preventCollision: PropTypes.bool, + // Use CSS transforms instead of top/left + useCSSTransforms: PropTypes.bool, + // parent layout transform scale + transformScale: PropTypes.number, + // If true, an external element can trigger onDrop callback with a specific grid position as a parameter + isDroppable: PropTypes.bool, + // Defines which resize handles should be rendered (default: 'se') + // Allows for any combination of: + // 's' - South handle (bottom-center) + // 'w' - West handle (left-center) + // 'e' - East handle (right-center) + // 'n' - North handle (top-center) + // 'sw' - Southwest handle (bottom-left) + // 'nw' - Northwest handle (top-left) + // 'se' - Southeast handle (bottom-right) + // 'ne' - Northeast handle (top-right) + resizeHandles: PropTypes.arrayOf( + PropTypes.oneOf(["s", "w", "e", "n", "sw", "nw", "se", "ne"]) + ), + + // + // Callbacks + // + + // Callback so you can save the layout. Calls after each drag & resize stops. + onLayoutChange: PropTypes.func, + + // Calls when drag starts. Callback is of the signature (layout, oldItem, newItem, placeholder, e, ?node). + // All callbacks below have the same signature. 'start' and 'stop' callbacks omit the 'placeholder'. + onDragStart: PropTypes.func, + // Calls on each drag movement. + onDrag: PropTypes.func, + // Calls when drag is complete. + onDragStop: PropTypes.func, + //Calls when resize starts. + onResizeStart: PropTypes.func, + // Calls when resize movement happens. + onResize: PropTypes.func, + // Calls when resize is complete. + onResizeStop: PropTypes.func, + // Calls when some element is dropped. + onDrop: PropTypes.func, + + // + // Other validations + // + + droppingItem: PropTypes.shape({ + i: PropTypes.string.isRequired, + w: PropTypes.number.isRequired, + h: PropTypes.number.isRequired + }), + + // Children must not have duplicate keys. + children: function (props: Props, propName: string) { + var children = props[propName]; + + // Check children keys for duplicates. Throw if found. + var keys = {}; + React.Children.forEach(children, function (child) { + if (keys[child.key]) { + throw new Error( + 'Duplicate child key "' + + child.key + + '" found! This will cause problems in ReactGridLayout.' + ); + } + keys[child.key] = true; + }); + }, + + // Optional ref for getting a reference for the wrapping div. + innerRef: PropTypes.any +}; diff --git a/lib/ResponsiveReactGridLayout.jsx b/lib/ResponsiveReactGridLayout.jsx index 3f5ecbb5d..ad110b577 100644 --- a/lib/ResponsiveReactGridLayout.jsx +++ b/lib/ResponsiveReactGridLayout.jsx @@ -1,5 +1,5 @@ // @flow -import React from "react"; +import * as React from "react"; import PropTypes from "prop-types"; import isEqual from "lodash.isequal"; @@ -7,34 +7,53 @@ import { cloneLayout, synchronizeLayoutWithChildren, validateLayout, - noop + noop, + type Layout } from "./utils"; import { getBreakpointFromWidth, getColsFromBreakpoint, - findOrGenerateResponsiveLayout + findOrGenerateResponsiveLayout, + type ResponsiveLayout, + type Breakpoints } from "./responsiveUtils"; import ReactGridLayout from "./ReactGridLayout"; -import type { Props as RGLProps } from "./ReactGridLayout"; -import type { Layout } from "./utils"; const type = obj => Object.prototype.toString.call(obj); +/** + * Get a value of margin or containerPadding. + * + * @param {Array | Object} param Margin | containerPadding, e.g. [10, 10] | {lg: [10, 10], ...}. + * @param {String} breakpoint Breakpoint: lg, md, sm, xs and etc. + * @return {Array} + */ + +function getIndentationValue( + param: { [key: string]: [number, number] } | [number, number], + breakpoint: string +) { + return Array.isArray(param) ? param : param[breakpoint]; +} + type State = { layout: Layout, breakpoint: string, - cols: number + cols: number, + layouts?: { [key: string]: Layout } }; -type Props = { - ...$Exact, +type Props = {| + ...React.ElementConfig, // Responsive config - breakpoint: Breakpoint, - breakpoints: { [key: Breakpoint]: number }, + breakpoint?: ?Breakpoint, + breakpoints: Breakpoints, cols: { [key: Breakpoint]: number }, - layouts: { [key: Breakpoint]: Layout }, + layouts: ResponsiveLayout, width: number, + margin: { [key: Breakpoint]: [number, number] } | [number, number], + containerPadding: { [key: Breakpoint]: [number, number] } | [number, number], // Callbacks onBreakpointChange: (Breakpoint, cols: number) => void, @@ -45,7 +64,7 @@ type Props = { cols: number, containerPadding: [number, number] | null ) => void -}; +|}; export default class ResponsiveReactGridLayout extends React.Component< Props<>, @@ -68,6 +87,18 @@ export default class ResponsiveReactGridLayout extends React.Component< // # of cols. This is a breakpoint -> cols map cols: PropTypes.object, + // # of margin. This is a breakpoint -> margin map + // e.g. { lg: [5, 5], md: [10, 10], sm: [15, 15] } + // Margin between items [x, y] in px + // e.g. [10, 10] + margin: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), + + // # of containerPadding. This is a breakpoint -> containerPadding map + // e.g. { lg: [5, 5], md: [10, 10], sm: [15, 15] } + // Padding inside the container [x, y] in px + // e.g. [10, 10] + containerPadding: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), + // layouts is an object mapping breakpoints to layouts. // e.g. {lg: Layout, md: Layout, ...} layouts(props: Props<>, propName: string) { @@ -110,6 +141,14 @@ export default class ResponsiveReactGridLayout extends React.Component< breakpoints: { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }, cols: { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }, layouts: {}, + margin: [10, 10], + containerPadding: { + lg: [0, 0], + md: [0, 0], + sm: [0, 0], + xs: [0, 0], + xxs: [0, 0] + }, onBreakpointChange: noop, onLayoutChange: noop, onWidthChange: noop @@ -142,18 +181,10 @@ export default class ResponsiveReactGridLayout extends React.Component< }; } - componentWillReceiveProps(nextProps: Props<*>) { - // Allow parent to set width or breakpoint directly. - if ( - nextProps.width != this.props.width || - nextProps.breakpoint !== this.props.breakpoint || - !isEqual(nextProps.breakpoints, this.props.breakpoints) || - !isEqual(nextProps.cols, this.props.cols) - ) { - this.onWidthChange(nextProps); - } else if (!isEqual(nextProps.layouts, this.props.layouts)) { + static getDerivedStateFromProps(nextProps: Props<*>, prevState: State) { + if (!isEqual(nextProps.layouts, prevState.layouts)) { // Allow parent to set layouts directly. - const { breakpoint, cols } = this.state; + const { breakpoint, cols } = prevState; // Since we're setting an entirely new layout object, we must generate a new responsive layout // if one does not exist. @@ -165,7 +196,21 @@ export default class ResponsiveReactGridLayout extends React.Component< cols, nextProps.compactType ); - this.setState({ layout: newLayout }); + return { layout: newLayout, layouts: nextProps.layouts }; + } + + return null; + } + + componentDidUpdate(prevProps: Props<*>) { + // Allow parent to set width or breakpoint directly. + if ( + this.props.width != prevProps.width || + this.props.breakpoint !== prevProps.breakpoint || + !isEqual(this.props.breakpoints, prevProps.breakpoints) || + !isEqual(this.props.cols, prevProps.cols) + ) { + this.onWidthChange(prevProps); } } @@ -181,28 +226,29 @@ export default class ResponsiveReactGridLayout extends React.Component< * When the width changes work through breakpoints and reset state with the new width & breakpoint. * Width changes are necessary to figure out the widget widths. */ - onWidthChange(nextProps: Props<*>) { - const { breakpoints, cols, layouts, compactType } = nextProps; + onWidthChange(prevProps: Props<*>) { + const { breakpoints, cols, layouts, compactType } = this.props; const newBreakpoint = - nextProps.breakpoint || - getBreakpointFromWidth(nextProps.breakpoints, nextProps.width); + this.props.breakpoint || + getBreakpointFromWidth(this.props.breakpoints, this.props.width); const lastBreakpoint = this.state.breakpoint; const newCols: number = getColsFromBreakpoint(newBreakpoint, cols); + const newLayouts = { ...layouts }; // Breakpoint change if ( lastBreakpoint !== newBreakpoint || - this.props.breakpoints !== breakpoints || - this.props.cols !== cols + prevProps.breakpoints !== breakpoints || + prevProps.cols !== cols ) { // Preserve the current layout if the current breakpoint is not present in the next layouts. - if (!(lastBreakpoint in layouts)) - layouts[lastBreakpoint] = cloneLayout(this.state.layout); + if (!(lastBreakpoint in newLayouts)) + newLayouts[lastBreakpoint] = cloneLayout(this.state.layout); // Find or generate a new layout. let layout = findOrGenerateResponsiveLayout( - layouts, + newLayouts, breakpoints, newBreakpoint, lastBreakpoint, @@ -213,16 +259,16 @@ export default class ResponsiveReactGridLayout extends React.Component< // This adds missing items. layout = synchronizeLayoutWithChildren( layout, - nextProps.children, + this.props.children, newCols, compactType ); // Store the new layout. - layouts[newBreakpoint] = layout; + newLayouts[newBreakpoint] = layout; // callbacks - this.props.onLayoutChange(layout, layouts); + this.props.onLayoutChange(layout, newLayouts); this.props.onBreakpointChange(newBreakpoint, newCols); this.setState({ @@ -231,12 +277,19 @@ export default class ResponsiveReactGridLayout extends React.Component< cols: newCols }); } + + const margin = getIndentationValue(this.props.margin, newBreakpoint); + const containerPadding = getIndentationValue( + this.props.containerPadding, + newBreakpoint + ); + //call onWidthChange on every change of width, not only on breakpoint changes this.props.onWidthChange( - nextProps.width, - nextProps.margin, + this.props.width, + margin, newCols, - nextProps.containerPadding + containerPadding ); } @@ -247,6 +300,8 @@ export default class ResponsiveReactGridLayout extends React.Component< breakpoints, cols, layouts, + margin, + containerPadding, onBreakpointChange, onLayoutChange, onWidthChange, @@ -257,6 +312,11 @@ export default class ResponsiveReactGridLayout extends React.Component< return ( ( - ComposedComponent: ReactComponentType -): ReactComponentType { - return class WidthProvider extends React.Component { - static defaultProps = { +export default function WidthProvider( + ComposedComponent: React.AbstractComponent +): React.AbstractComponent<{| + ...Config, + measureBeforeMount?: boolean, + className?: string, + style?: Object, + width?: number +|}> { + return class WidthProvider extends React.Component< + {| + ...Config, + measureBeforeMount?: boolean, + className?: string, + style?: Object, + width?: number + |}, + WPState + > { + static defaultProps: WPDefaultProps = { measureBeforeMount: false }; @@ -57,7 +76,7 @@ export default function WidthProvider< onWindowResize = () => { if (!this.mounted) return; - // eslint-disable-next-line + // eslint-disable-next-line react/no-find-dom-node const node = ReactDOM.findDOMNode(this); // Flow casts this to Text | Element if (node instanceof HTMLElement) this.setState({ width: node.offsetWidth }); diff --git a/lib/fastRGLPropsEqual.js b/lib/fastRGLPropsEqual.js new file mode 100644 index 000000000..ae0f62064 --- /dev/null +++ b/lib/fastRGLPropsEqual.js @@ -0,0 +1,46 @@ +// @preval + +require("@babel/register"); + +// Fast way to compare RGL props in shouldComponentUpdate. +// Generates the fastest possible comparison of the type: +// function (a, b) { return a.className === b.className && a.style === b.style && ... } +// This avoids enumerating keys, avoids us keeping our own key list, and can be very easily optimized. + +const PropTypes = require("prop-types"); +const propTypes = require("./ReactGridLayoutPropTypes").default; +const keys = Object.keys(propTypes); + +// Remove 'children' key as we don't want to compare it +keys.splice(keys.indexOf("children"), 1); + +// Returns a code string indicating what to do here. +// In most cases we want to do a simple equality comparison, +// but we have some arrays and tuples and objects we want +// to do a shallow comparison on. +function getEqualType(key) { + if ( + [ + PropTypes.number, + PropTypes.bool, + PropTypes.string, + PropTypes.func + ].includes(propTypes[key]) + ) { + return `(a.${key} === b.${key})`; + } + return `isEqualImpl(a.${key}, b.${key})`; +} + +// Exports a function that compares a and b. `isEqualImpl` is a required +// third prop, as we can't otherwise access it. +module.exports = () => + eval(` + function fastRGLPropsEqual(a, b, isEqualImpl) { + if (a === b) return true; + return ( + ${keys.map(getEqualType).join(" && ")} + ); + } + fastRGLPropsEqual; +`); diff --git a/lib/responsiveUtils.js b/lib/responsiveUtils.js index 6a710767b..2abbb1121 100644 --- a/lib/responsiveUtils.js +++ b/lib/responsiveUtils.js @@ -4,22 +4,15 @@ import { cloneLayout, compact, correctBounds } from "./utils"; import type { CompactType, Layout } from "./utils"; -export type ResponsiveLayout = { - lg?: Layout, - md?: Layout, - sm?: Layout, - xs?: Layout, - xxs?: Layout -}; - -type Breakpoint = string; +export type Breakpoint = string; +export type DefaultBreakpoints = "lg" | "md" | "sm" | "xs" | "xxs"; -type Breakpoints = { - lg?: number, - md?: number, - sm?: number, - xs?: number, - xxs?: number +// + indicates read-only +export type ResponsiveLayout = { + +[breakpoint: T]: Layout +}; +export type Breakpoints = { + +[breakpoint: T]: number }; /** @@ -30,7 +23,7 @@ type Breakpoints = { * @return {String} Highest breakpoint that is less than width. */ export function getBreakpointFromWidth( - breakpoints: Breakpoints, + breakpoints: Breakpoints, width: number ): Breakpoint { const sorted = sortBreakpoints(breakpoints); @@ -50,7 +43,7 @@ export function getBreakpointFromWidth( */ export function getColsFromBreakpoint( breakpoint: Breakpoint, - cols: Breakpoints + cols: Breakpoints ): number { if (!cols[breakpoint]) { throw new Error( @@ -77,8 +70,8 @@ export function getColsFromBreakpoint( * @return {Array} New layout. */ export function findOrGenerateResponsiveLayout( - layouts: ResponsiveLayout, - breakpoints: Breakpoints, + layouts: ResponsiveLayout, + breakpoints: Breakpoints, breakpoint: Breakpoint, lastBreakpoint: Breakpoint, cols: number, @@ -110,9 +103,11 @@ export function findOrGenerateResponsiveLayout( * @param {Object} breakpoints Key/value pair of breakpoint names to widths. * @return {Array} Sorted breakpoints. */ -export function sortBreakpoints(breakpoints: Breakpoints): Array { +export function sortBreakpoints( + breakpoints: Breakpoints +): Array { const keys: Array = Object.keys(breakpoints); - return keys.sort(function(a, b) { + return keys.sort(function (a, b) { return breakpoints[a] - breakpoints[b]; }); } diff --git a/lib/utils.js b/lib/utils.js index f40016d10..b728dd633 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -18,9 +18,11 @@ export type LayoutItem = { moved?: boolean, static?: boolean, isDraggable?: ?boolean, - isResizable?: ?boolean + isResizable?: ?boolean, + resizeHandles?: Array<'s' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne'>, + isBounded?: ?boolean }; -export type Layout = Array; +export type Layout = $ReadOnlyArray; export type Position = { left: number, top: number, @@ -29,15 +31,16 @@ export type Position = { }; export type ReactDraggableCallbackData = { node: HTMLElement, - x: number, - y: number, + x?: number, + y?: number, deltaX: number, deltaY: number, - lastX: number, - lastY: number + lastX?: number, + lastY?: number }; export type PartialPosition = { left: number, top: number }; +export type DroppingPosition = { left: number, top: number, e: Event }; export type Size = { width: number, height: number }; export type GridDragEvent = { e: Event, @@ -45,6 +48,15 @@ export type GridDragEvent = { newPosition: PartialPosition }; export type GridResizeEvent = { e: Event, node: HTMLElement, size: Size }; +export type DragOverEvent = MouseEvent & { + nativeEvent: { + layerX: number, + layerY: number, + target: { + className: String + } + } +}; type REl = ReactElement; export type ReactChildren = ReactChildrenArray; @@ -101,9 +113,11 @@ export function cloneLayoutItem(layoutItem: LayoutItem): LayoutItem { maxH: layoutItem.maxH, moved: Boolean(layoutItem.moved), static: Boolean(layoutItem.static), - // These can be null + // These can be null/undefined isDraggable: layoutItem.isDraggable, - isResizable: layoutItem.isResizable + isResizable: layoutItem.isResizable, + resizeHandles: layoutItem.resizeHandles, + isBounded: layoutItem.isBounded }; } @@ -118,6 +132,27 @@ export function childrenEqual(a: ReactChildren, b: ReactChildren): boolean { ); } +/** + * See `fastRGLPropsEqual.js`. + * We want this to run as fast as possible - it is called often - and to be + * resilient to new props that we add. So rather than call lodash.isEqual, + * which isn't suited to comparing props very well, we use this specialized + * function in conjunction with preval to generate the fastest possible comparison + * function, tuned for exactly our props. + */ +type FastRGLPropsEqual = (Object, Object, Function) => boolean; +export const fastRGLPropsEqual: FastRGLPropsEqual = require("./fastRGLPropsEqual"); + +// Like the above, but a lot simpler. +export function fastPositionEqual(a: Position, b: Position) { + return ( + a.left === b.left && + a.top === b.top && + a.width === b.width && + a.height === b.height + ); +} + /** * Given two layoutitems, check if they collide. */ @@ -134,6 +169,8 @@ export function collides(l1: LayoutItem, l2: LayoutItem): boolean { * Given a layout, compact it. This involves going down each y coordinate and removing gaps * between items. * + * Does not modify layout items (clones). Creates a new layout array. + * * @param {Array} layout Layout. * @param {Boolean} verticalCompact Whether or not to compact the layout * vertically. @@ -199,7 +236,7 @@ function resolveCompactionCollision( // Optimization: we can break early if we know we're past this el // We can do this b/c it's a sorted layout - if (otherItem.y > (item.y + item.h)) break; + if (otherItem.y > item.y + item.h) break; if (collides(item, otherItem)) { resolveCompactionCollision( @@ -216,6 +253,9 @@ function resolveCompactionCollision( /** * Compact an item in the layout. + * + * Modifies item. + * */ export function compactItem( compareWith: Layout, @@ -263,6 +303,8 @@ export function compactItem( /** * Given a layout, make sure all elements fit within its bounds. * + * Modifies layout items. + * * @param {Array} layout Layout array. * @param {Number} bounds Number of columns. */ @@ -341,6 +383,8 @@ export function getStatics(layout: Layout): Array { /** * Move an element. Responsible for doing cascading movements of other elements. * + * Modifies layout items. + * * @param {Array} layout Full layout to modify. * @param {LayoutItem} l element to move. * @param {Number} [x] X position in grid units. @@ -354,20 +398,24 @@ export function moveElement( isUserAction: ?boolean, preventCollision: ?boolean, compactType: CompactType, - cols: number, + cols: number ): Layout { - if (l.static) return layout; + // If this is static and not explicitly enabled as draggable, + // no move is possible, so we can short-circuit this immediately. + if (l.static && l.isDraggable !== true) return layout; // Short-circuit if nothing to do. if (l.y === y && l.x === x) return layout; - log(`Moving element ${l.i} to [${String(x)},${String(y)}] from [${l.x},${l.y}]`); + log( + `Moving element ${l.i} to [${String(x)},${String(y)}] from [${l.x},${l.y}]` + ); const oldX = l.x; const oldY = l.y; // This is quite a bit faster than extending the object - if (typeof x === 'number') l.x = x; - if (typeof y === 'number') l.y = y; + if (typeof x === "number") l.x = x; + if (typeof y === "number") l.y = y; l.moved = true; // If this collides with anything, move it. @@ -376,9 +424,12 @@ export function moveElement( // nearest collision. let sorted = sortLayoutItems(layout, compactType); const movingUp = - compactType === "vertical" && typeof y === 'number' ? oldY >= y - : compactType === "horizontal" && typeof x === 'number' ? oldX >= x - : false; + compactType === "vertical" && typeof y === "number" + ? oldY >= y + : compactType === "horizontal" && typeof x === "number" + ? oldX >= x + : false; + // $FlowIgnore acceptable modification of read-only array as it was recently cloned if (movingUp) sorted = sorted.reverse(); const collisions = getAllCollisions(sorted, l); @@ -395,9 +446,7 @@ export function moveElement( for (let i = 0, len = collisions.length; i < len; i++) { const collision = collisions[i]; log( - `Resolving collision between ${l.i} at [${l.x},${l.y}] and ${ - collision.i - } at [${collision.x},${collision.y}]` + `Resolving collision between ${l.i} at [${l.x},${l.y}] and ${collision.i} at [${collision.x},${collision.y}]` ); // Short circuit so we can't infinite loop @@ -447,7 +496,7 @@ export function moveElementAwayFromCollision( const compactH = compactType === "horizontal"; // Compact vertically if not set to horizontal const compactV = compactType !== "horizontal"; - const preventCollision = false; // we're already colliding + const preventCollision = collidesWith.static; // we're already colliding (not for static items) // If there is enough space above the collision to put this element, move it there. // We only do this on the main collision as this can get funky in cascades and cause @@ -468,9 +517,7 @@ export function moveElementAwayFromCollision( // No collision? If so, we can go up there; otherwise, we'll end up moving down as normal if (!getFirstCollision(layout, fakeItem)) { log( - `Doing reverse collision on ${itemToMove.i} up to [${fakeItem.x},${ - fakeItem.y - }].` + `Doing reverse collision on ${itemToMove.i} up to [${fakeItem.x},${fakeItem.y}].` ); return moveElement( layout, @@ -546,8 +593,14 @@ export function sortLayoutItems( else return sortLayoutItemsByRowCol(layout); } +/** + * Sort layout items by row ascending and column ascending. + * + * Does not modify Layout. + */ export function sortLayoutItemsByRowCol(layout: Layout): Layout { - return [].concat(layout).sort(function(a, b) { + // Slice to clone array as sort modifies + return layout.slice(0).sort(function (a, b) { if (a.y > b.y || (a.y === b.y && a.x > b.x)) { return 1; } else if (a.y === b.y && a.x === b.x) { @@ -558,8 +611,13 @@ export function sortLayoutItemsByRowCol(layout: Layout): Layout { }); } +/** + * Sort layout items by column ascending then row ascending. + * + * Does not modify Layout. + */ export function sortLayoutItemsByColRow(layout: Layout): Layout { - return [].concat(layout).sort(function(a, b) { + return layout.slice(0).sort(function (a, b) { if (a.x > b.x || (a.x === b.x && a.y > b.y)) { return 1; } @@ -571,6 +629,8 @@ export function sortLayoutItemsByColRow(layout: Layout): Layout { * Generate a layout using the initialLayout and children as a template. * Missing entries will be added, extraneous ones will be truncated. * + * Does not modify initialLayout. + * * @param {Array} initialLayout Layout passed in through props. * @param {String} breakpoint Current responsive breakpoint. * @param {?String} compact Compaction option. @@ -585,7 +645,7 @@ export function synchronizeLayoutWithChildren( initialLayout = initialLayout || []; // Generate one layout item per child. - let layout: Layout = []; + const layout: LayoutItem[] = []; React.Children.forEach(children, (child: ReactElement, i: number) => { // Don't overwrite if it already exists. const exists = getLayoutItem(initialLayout, String(child.key)); @@ -620,10 +680,8 @@ export function synchronizeLayoutWithChildren( }); // Correct the layout. - layout = correctBounds(layout, { cols: cols }); - layout = compact(layout, compactType, cols); - - return layout; + const correctedLayout = correctBounds(layout, { cols: cols }); + return compact(correctedLayout, compactType, cols); } /** @@ -672,6 +730,14 @@ export function validateLayout( } } +// Legacy support for verticalCompact: false +export function compactType( + props: ?{ verticalCompact: boolean, compactType: CompactType } +): CompactType { + const { verticalCompact, compactType } = props || {}; + return verticalCompact === false ? null : compactType; +} + // Flow can't really figure this out, so we just use Object export function autoBindHandlers(el: Object, fns: Array): void { fns.forEach(key => (el[key] = el[key].bind(el))); diff --git a/package.json b/package.json index 81a335013..0f8818df0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-grid-layout", - "version": "0.16.6", + "version": "1.0.0", "description": "A draggable and resizable grid layout with responsive breakpoints, for React.", "main": "index.js", "scripts": { @@ -12,8 +12,7 @@ "dev": "make dev", "prepublishOnly": "make build", "validate": "npm ls", - "flow": "flow", - "precommit": "lint-staged && make lint" + "flow": "flow" }, "repository": { "type": "git", @@ -38,63 +37,75 @@ "dependencies": { "classnames": "2.x", "lodash.isequal": "^4.0.0", - "prop-types": "15.x", - "react-draggable": "3.x", - "react-resizable": "1.x" + "prop-types": "^15.0.0", + "react-draggable": "^4.0.0", + "react-resizable": "^1.10.0" }, "devDependencies": { - "babel-cli": "^6.24.1", - "babel-core": "^6.24.1", - "babel-eslint": "^8.2.1", - "babel-jest": "^22.2.2", - "babel-loader": "^7.1.2", - "babel-plugin-react-transform": "^3.0.0", - "babel-plugin-transform-react-constant-elements": "^6.5.0", - "babel-plugin-transform-react-inline-elements": "^6.6.5", - "babel-plugin-typecheck": "^3.6.1", - "babel-preset-es2015": "^6.24.1", - "babel-preset-react": "^6.24.1", - "babel-preset-stage-1": "^6.24.1", - "css-loader": "^0.28.9", - "ejs": "^2.4.1", - "eslint": "^4.17.0", - "eslint-plugin-flowtype": "^2.44.0", - "eslint-plugin-mocha": "^4.11.0", - "eslint-plugin-react": "^7.6.1", - "exports-loader": "^0.7.0", - "flow-bin": "^0.65.0", - "husky": "^0.14.3", - "imports-loader": "^0.7.1", - "jest-cli": "^22.3.0", - "lint-staged": "^6.1.0", - "lodash": "^4.17.5", + "@babel/cli": "^7.10.5", + "@babel/core": "^7.10.5", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/plugin-transform-flow-comments": "^7.10.4", + "@babel/preset-env": "^7.10.4", + "@babel/preset-flow": "^7.10.4", + "@babel/preset-react": "^7.10.4", + "@babel/register": "^7.10.5", + "babel-eslint": "^10.1.0", + "babel-jest": "^26.1.0", + "babel-loader": "^8.1.0", + "babel-plugin-preval": "^5.0.0", + "css-loader": "^3.6.0", + "ejs": "^3.1.3", + "enzyme": "^3.11.0", + "enzyme-adapter-react-16": "^1.15.2", + "enzyme-to-json": "^3.5.0", + "eslint": "^7.5.0", + "eslint-plugin-flowtype": "^5.2.0", + "eslint-plugin-mocha": "^7.0.1", + "eslint-plugin-react": "^7.20.3", + "exports-loader": "^1.1.0", + "flow-bin": "^0.129.0", + "husky": "^4.2.5", + "imports-loader": "^1.1.0", + "jest": "^26.1.0", + "lint-staged": "^10.2.11", + "lodash": "^4.17.19", "opener": "^1.4.3", - "prettier": "^1.10.2", - "react": "^16.2.0", - "react-dom": "^16.2.0", - "react-hot-loader": "^3.1.3", + "prettier": "^2.0.5", + "react": "^16.13.1", + "react-dom": "^16.13.1", + "react-hot-loader": "^4.12.21", "react-transform-hmr": "^1.0.2", - "style-loader": "^0.20.2", - "valiquire": "^0.3.0", - "webpack": "^3.11.0", - "webpack-dev-server": "^2.11.1" + "style-loader": "^1.2.1", + "timsort": "^0.3.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.12", + "webpack-dev-server": "^3.11.0" }, "publishConfig": { "registry": "https://registry.npmjs.org" }, "jest": { + "setupFilesAfterEnv": [ + "test/util/setupTests.js" + ], + "snapshotSerializers": [ + "enzyme-to-json/serializer" + ], "testMatch": [ "/test/spec/*.js" - ] + ], + "testURL": "http://localhost" }, "lint-staged": { - "*.{js,jsx}": [ - "prettier --write", - "git add" - ], - "*.css": [ + "*.{js,jsx,css}": [ "prettier --write", "git add" ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged && make lint && make test" + } } -} +} \ No newline at end of file diff --git a/test/dev-hook.jsx b/test/dev-hook.jsx index 83f3d9b15..04ce6f2fe 100644 --- a/test/dev-hook.jsx +++ b/test/dev-hook.jsx @@ -1,2 +1,8 @@ -var DevLayout = require("./examples/0-showcase.jsx"); -require("./test-hook.jsx")(DevLayout); +import 'react-hot-loader'; +import { hot } from 'react-hot-loader/root'; +import DevLayout from './examples/0-showcase.jsx'; +import makeLayout from './test-hook'; + +const Layout = makeLayout(DevLayout); + +export default hot(Layout); diff --git a/test/examples/0-showcase.jsx b/test/examples/0-showcase.jsx index 0d3f07801..caddcd84d 100644 --- a/test/examples/0-showcase.jsx +++ b/test/examples/0-showcase.jsx @@ -1,22 +1,37 @@ +// @flow import React from "react"; import _ from "lodash"; -import { Responsive, WidthProvider } from "react-grid-layout"; +import Responsive from '../../lib/ResponsiveReactGridLayout'; +import WidthProvider from '../../lib/components/WidthProvider'; +import type {CompactType, Layout} from '../../lib/utils'; const ResponsiveReactGridLayout = WidthProvider(Responsive); -class ShowcaseLayout extends React.Component { +type Props = {| + className: string, + cols: {[string]: number}, + onLayoutChange: Function, + rowHeight: number, +|}; +type State = {| + currentBreakpoint: string, + compactType: CompactType, + mounted: boolean, + layouts: {[string]: Layout} +|}; + +export default class ShowcaseLayout extends React.Component { static defaultProps = { className: "layout", rowHeight: 30, onLayoutChange: function() {}, cols: { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }, - initialLayout: generateLayout() }; state = { currentBreakpoint: "lg", compactType: "vertical", mounted: false, - layouts: { lg: this.props.initialLayout } + layouts: { lg: generateLayout() } }; componentDidMount() { @@ -42,7 +57,7 @@ class ShowcaseLayout extends React.Component { }); } - onBreakpointChange = breakpoint => { + onBreakpointChange = (breakpoint: string) => { this.setState({ currentBreakpoint: breakpoint }); @@ -53,11 +68,13 @@ class ShowcaseLayout extends React.Component { const compactType = oldCompactType === "horizontal" ? "vertical" - : oldCompactType === "vertical" ? null : "horizontal"; + : oldCompactType === "vertical" + ? null + : "horizontal"; this.setState({ compactType }); }; - onLayoutChange = (layout, layouts) => { + onLayoutChange = (layout: Layout, layouts: {[string]: Layout}) => { this.props.onLayoutChange(layout, layouts); }; @@ -67,14 +84,17 @@ class ShowcaseLayout extends React.Component { }); }; + onDrop = (elemParams: Object) => { + alert(`Element parameters: ${JSON.stringify(elemParams)}`); + }; + render() { + // eslint-disable-next-line no-unused-vars return (
- Current Breakpoint: {this.state.currentBreakpoint} ({ - this.props.cols[this.state.currentBreakpoint] - }{" "} - columns) + Current Breakpoint: {this.state.currentBreakpoint} ( + {this.props.cols[this.state.currentBreakpoint]} columns)
Compaction type:{" "} @@ -89,6 +109,7 @@ class ShowcaseLayout extends React.Component { layouts={this.state.layouts} onBreakpointChange={this.onBreakpointChange} onLayoutChange={this.onLayoutChange} + onDrop={this.onDrop} // WidthProvider option measureBeforeMount={false} // I like to have it animate on mount. If you don't, delete `useCSSTransforms` (it's default `true`) @@ -104,13 +125,11 @@ class ShowcaseLayout extends React.Component { } } -module.exports = ShowcaseLayout; - function generateLayout() { return _.map(_.range(0, 25), function(item, i) { var y = Math.ceil(Math.random() * 4) + 1; return { - x: (_.random(0, 5) * 2) % 12, + x: Math.round(Math.random() * 5) * 2, y: Math.floor(i / 6) * y, w: 2, h: y, @@ -120,6 +139,6 @@ function generateLayout() { }); } -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(ShowcaseLayout)); } diff --git a/test/examples/1-basic.jsx b/test/examples/1-basic.jsx index fe8705538..32905be6e 100644 --- a/test/examples/1-basic.jsx +++ b/test/examples/1-basic.jsx @@ -4,7 +4,7 @@ import RGL, { WidthProvider } from "react-grid-layout"; const ReactGridLayout = WidthProvider(RGL); -class BasicLayout extends React.PureComponent { +export default class BasicLayout extends React.PureComponent { static defaultProps = { className: "layout", items: 20, @@ -61,8 +61,6 @@ class BasicLayout extends React.PureComponent { } } -module.exports = BasicLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(BasicLayout)); } diff --git a/test/examples/10-dynamic-min-max-wh.jsx b/test/examples/10-dynamic-min-max-wh.jsx index 08cb7d1eb..04cc78cf4 100644 --- a/test/examples/10-dynamic-min-max-wh.jsx +++ b/test/examples/10-dynamic-min-max-wh.jsx @@ -10,7 +10,7 @@ const ReactGridLayout = WidthProvider(RGL); * In this grid, all elements are allowed a max width of 2 if the height < 3, * and a min width of 2 if the height >= 3. */ -class DynamicMinMaxLayout extends React.PureComponent { +export default class DynamicMinMaxLayout extends React.PureComponent { static defaultProps = { isDraggable: true, isResizable: true, @@ -79,8 +79,6 @@ class DynamicMinMaxLayout extends React.PureComponent { } } -module.exports = DynamicMinMaxLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(DynamicMinMaxLayout)); } diff --git a/test/examples/11-no-vertical-compact.jsx b/test/examples/11-no-vertical-compact.jsx index 00d55d39c..9da272499 100644 --- a/test/examples/11-no-vertical-compact.jsx +++ b/test/examples/11-no-vertical-compact.jsx @@ -4,7 +4,7 @@ import RGL, { WidthProvider } from "react-grid-layout"; const ReactGridLayout = WidthProvider(RGL); -class NoCompactingLayout extends React.PureComponent { +export default class NoCompactingLayout extends React.PureComponent { static defaultProps = { className: "layout", items: 50, @@ -63,8 +63,6 @@ class NoCompactingLayout extends React.PureComponent { } } -module.exports = NoCompactingLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(NoCompactingLayout)); } diff --git a/test/examples/12-prevent-collision.jsx b/test/examples/12-prevent-collision.jsx index 9dd01810b..e8b2e6a58 100644 --- a/test/examples/12-prevent-collision.jsx +++ b/test/examples/12-prevent-collision.jsx @@ -4,7 +4,7 @@ import RGL, { WidthProvider } from "react-grid-layout"; const ReactGridLayout = WidthProvider(RGL); -class NoCompactingLayout extends React.PureComponent { +export default class NoCollisionLayout extends React.PureComponent { static defaultProps = { className: "layout", items: 50, @@ -65,8 +65,6 @@ class NoCompactingLayout extends React.PureComponent { } } -module.exports = NoCompactingLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(NoCollisionLayout)); } diff --git a/test/examples/13-error-case.jsx b/test/examples/13-error-case.jsx index 5d6e4e1ba..ea1856280 100644 --- a/test/examples/13-error-case.jsx +++ b/test/examples/13-error-case.jsx @@ -3,7 +3,7 @@ import RGL, { WidthProvider } from "react-grid-layout"; const ReactGridLayout = WidthProvider(RGL); -class BasicLayout extends React.PureComponent { +export default class ErrorCaseLayout extends React.PureComponent { static defaultProps = { className: "layout", items: 3, @@ -76,8 +76,6 @@ class BasicLayout extends React.PureComponent { } } -module.exports = BasicLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(ErrorCaseLayout)); } diff --git a/test/examples/14-toolbox.jsx b/test/examples/14-toolbox.jsx index c8bb5a320..8328f0f92 100644 --- a/test/examples/14-toolbox.jsx +++ b/test/examples/14-toolbox.jsx @@ -34,7 +34,7 @@ class ToolBox extends React.Component { } } -class ShowcaseLayout extends React.Component { +export default class ToolboxLayout extends React.Component { static defaultProps = { className: "layout", rowHeight: 30, @@ -95,7 +95,9 @@ class ShowcaseLayout extends React.Component { const compactType = oldCompactType === "horizontal" ? "vertical" - : oldCompactType === "vertical" ? null : "horizontal"; + : oldCompactType === "vertical" + ? null + : "horizontal"; this.setState({ compactType }); }; @@ -152,10 +154,8 @@ class ShowcaseLayout extends React.Component { return (
- Current Breakpoint: {this.state.currentBreakpoint} ({ - this.props.cols[this.state.currentBreakpoint] - }{" "} - columns) + Current Breakpoint: {this.state.currentBreakpoint} ( + {this.props.cols[this.state.currentBreakpoint]} columns)
Compaction type:{" "} @@ -191,8 +191,6 @@ class ShowcaseLayout extends React.Component { } } -module.exports = ShowcaseLayout; - function generateLayout() { return _.map(_.range(0, 25), function(item, i) { var y = Math.ceil(Math.random() * 4) + 1; @@ -207,6 +205,6 @@ function generateLayout() { }); } -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(ToolboxLayout)); } diff --git a/test/examples/15-drag-from-outside.jsx b/test/examples/15-drag-from-outside.jsx new file mode 100644 index 000000000..588acb9c1 --- /dev/null +++ b/test/examples/15-drag-from-outside.jsx @@ -0,0 +1,140 @@ +import React from "react"; +import _ from "lodash"; +import { Responsive, WidthProvider } from "react-grid-layout"; +const ResponsiveReactGridLayout = WidthProvider(Responsive); + +export default class DragFromOutsideLayout extends React.Component { + static defaultProps = { + className: "layout", + rowHeight: 30, + onLayoutChange: function() {}, + cols: { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }, + }; + + state = { + currentBreakpoint: "lg", + compactType: "vertical", + mounted: false, + layouts: { lg: generateLayout() } + }; + + componentDidMount() { + this.setState({ mounted: true }); + } + + generateDOM() { + return _.map(this.state.layouts.lg, function(l, i) { + return ( +
+ {l.static ? ( + + Static - {i} + + ) : ( + {i} + )} +
+ ); + }); + } + + onBreakpointChange = breakpoint => { + this.setState({ + currentBreakpoint: breakpoint + }); + }; + + onCompactTypeChange = () => { + const { compactType: oldCompactType } = this.state; + const compactType = + oldCompactType === "horizontal" + ? "vertical" + : oldCompactType === "vertical" + ? null + : "horizontal"; + this.setState({ compactType }); + }; + + onLayoutChange = (layout, layouts) => { + this.props.onLayoutChange(layout, layouts); + }; + + onNewLayout = () => { + this.setState({ + layouts: { lg: generateLayout() } + }); + }; + + onDrop = (layout, layoutItem, event) => { + alert(`Dropped element props:\n${JSON.stringify(layoutItem, ['x', 'y', 'w', 'h'], 2)}`); + }; + + render() { + return ( +
+
+ Current Breakpoint: {this.state.currentBreakpoint} ( + {this.props.cols[this.state.currentBreakpoint]} columns) +
+
+ Compaction type:{" "} + {_.capitalize(this.state.compactType) || "No Compaction"} +
+ + +
e.dataTransfer.setData("text/plain", "")} + > + Droppable Element (Drag me!) +
+ + {this.generateDOM()} + +
+ ); + } +} + +function generateLayout() { + return _.map(_.range(0, 25), function(item, i) { + var y = Math.ceil(Math.random() * 4) + 1; + return { + x: Math.round(Math.random() * 5) * 2, + y: Math.floor(i / 6) * y, + w: 2, + h: y, + i: i.toString(), + static: Math.random() < 0.05 + }; + }); +} + +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(DragFromOutsideLayout)); +} diff --git a/test/examples/16-bounded.jsx b/test/examples/16-bounded.jsx new file mode 100644 index 000000000..b73c0223f --- /dev/null +++ b/test/examples/16-bounded.jsx @@ -0,0 +1,67 @@ +import React from "react"; +import _ from "lodash"; +import RGL, { WidthProvider } from "react-grid-layout"; + +const ReactGridLayout = WidthProvider(RGL); + +class BoundedLayout extends React.PureComponent { + static defaultProps = { + className: "layout", + items: 20, + rowHeight: 30, + onLayoutChange: function() {}, + cols: 12 + }; + + constructor(props) { + super(props); + + const layout = this.generateLayout(); + this.state = { layout }; + } + + generateDOM() { + return _.map(_.range(this.props.items), function(i) { + return ( +
+ {i} +
+ ); + }); + } + + generateLayout() { + const p = this.props; + return _.map(new Array(p.items), function(item, i) { + const y = _.result(p, "y") || Math.ceil(Math.random() * 4) + 1; + return { + x: (i * 2) % 12, + y: Math.floor(i / 6) * y, + w: 2, + h: y, + i: i.toString() + }; + }); + } + + onLayoutChange(layout) { + this.props.onLayoutChange(layout); + } + + render() { + return ( + + {this.generateDOM()} + + ); + } +} + +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(BoundedLayout)); +} diff --git a/test/examples/17-resizable-handles.jsx b/test/examples/17-resizable-handles.jsx new file mode 100644 index 000000000..3daf52b44 --- /dev/null +++ b/test/examples/17-resizable-handles.jsx @@ -0,0 +1,70 @@ +import React from "react"; +import _ from "lodash"; +import RGL, { WidthProvider } from "react-grid-layout"; +import "style-loader!css-loader!../../examples/resizable-styles.css"; + +const ReactGridLayout = WidthProvider(RGL); + +export default class ResizableHandles extends React.PureComponent { + static defaultProps = { + className: "layout", + items: 20, + rowHeight: 30, + onLayoutChange: function() {}, + cols: 12 + }; + + constructor(props) { + super(props); + + const layout = this.generateLayout(); + this.state = { layout }; + } + + generateDOM() { + return _.map(_.range(this.props.items), function(i) { + return ( +
+ {i} +
+ ); + }); + } + + generateLayout() { + const p = this.props; + const availableHandles = ["s", "w", "e", "n", "sw", "nw", "se", "ne"]; + + return _.map(new Array(p.items), function(item, i) { + const y = _.result(p, "y") || Math.ceil(Math.random() * 4) + 1; + return { + x: (i * 2) % 12, + y: Math.floor(i / 6) * y, + w: 2, + h: y, + i: i.toString(), + resizeHandles: _.shuffle(availableHandles).slice(0, _.random(1, availableHandles.length-1)) + }; + }); + } + + onLayoutChange(layout) { + this.props.onLayoutChange(layout); + } + + render() { + return ( + + {this.generateDOM()} + + ); + } +} + +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(ResizableHandles)); +} diff --git a/test/examples/12-responsive-bootstrap-style.jsx b/test/examples/17-responsive-bootstrap-style.jsx similarity index 82% rename from test/examples/12-responsive-bootstrap-style.jsx rename to test/examples/17-responsive-bootstrap-style.jsx index ac3d315f2..2cb69c3a4 100644 --- a/test/examples/12-responsive-bootstrap-style.jsx +++ b/test/examples/17-responsive-bootstrap-style.jsx @@ -6,7 +6,7 @@ const ResponsiveReactGridLayout = WidthProvider(Responsive); /** * This example illustrates how to let grid items lay themselves out with a bootstrap-style specification. */ -class BootstrapStyleLayout extends React.PureComponent { +export default class BootstrapStyleLayout extends React.PureComponent { static defaultProps = { isDraggable: true, isResizable: true, @@ -39,8 +39,6 @@ class BootstrapStyleLayout extends React.PureComponent { } } -module.exports = BootstrapStyleLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(BootstrapStyleLayout)); } diff --git a/test/examples/2-no-dragging.jsx b/test/examples/2-no-dragging.jsx index 12d8209a3..bc4718500 100644 --- a/test/examples/2-no-dragging.jsx +++ b/test/examples/2-no-dragging.jsx @@ -4,7 +4,7 @@ import RGL, { WidthProvider } from "react-grid-layout"; const ReactGridLayout = WidthProvider(RGL); -class NoDraggingLayout extends React.PureComponent { +export default class NoDraggingLayout extends React.PureComponent { static defaultProps = { className: "layout", isDraggable: false, @@ -63,8 +63,6 @@ class NoDraggingLayout extends React.PureComponent { } } -module.exports = NoDraggingLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(NoDraggingLayout)); } diff --git a/test/examples/3-messy.jsx b/test/examples/3-messy.jsx index d01c89b3c..5e0c33474 100644 --- a/test/examples/3-messy.jsx +++ b/test/examples/3-messy.jsx @@ -1,24 +1,35 @@ +// @flow import React from "react"; import _ from "lodash"; -import RGL, { WidthProvider } from "react-grid-layout"; +import RGL from '../../lib/ReactGridLayout'; +import WidthProvider from '../../lib/components/WidthProvider'; +import type {Layout} from '../../lib/utils'; const ReactGridLayout = WidthProvider(RGL); -class MessyLayout extends React.PureComponent { +type Props = {| + className: string, + cols: number, + items: number, + onLayoutChange: Function, + rowHeight: number, +|}; +type State = {| + layout: Layout +|}; + +export default class MessyLayout extends React.PureComponent { static defaultProps = { className: "layout", + cols: 12, items: 20, - rowHeight: 30, onLayoutChange: function() {}, - cols: 12 + rowHeight: 30, }; - constructor(props) { - super(props); - - const layout = this.generateLayout(); - this.state = { layout }; - } + state = { + layout: this.generateLayout() + }; generateDOM() { return _.map(_.range(this.props.items), function(i) { @@ -30,7 +41,7 @@ class MessyLayout extends React.PureComponent { }); } - generateLayout() { + generateLayout(): Layout { const p = this.props; return _.map(new Array(p.items), function(item, i) { const w = Math.ceil(Math.random() * 4); @@ -45,16 +56,18 @@ class MessyLayout extends React.PureComponent { }); } - onLayoutChange(layout) { + onLayoutChange(layout: Layout) { this.props.onLayoutChange(layout); } render() { + // eslint-disable-next-line no-unused-vars + const {items, ...props} = this.props; return ( {this.generateDOM()} @@ -62,8 +75,6 @@ class MessyLayout extends React.PureComponent { } } -module.exports = MessyLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(MessyLayout)); } diff --git a/test/examples/4-grid-property.jsx b/test/examples/4-grid-property.jsx index 80c4cc783..cafa1c600 100644 --- a/test/examples/4-grid-property.jsx +++ b/test/examples/4-grid-property.jsx @@ -4,7 +4,7 @@ import RGL, { WidthProvider } from "react-grid-layout"; const ReactGridLayout = WidthProvider(RGL); -class GridPropertyLayout extends React.PureComponent { +export default class GridPropertyLayout extends React.PureComponent { static defaultProps = { isDraggable: true, isResizable: true, @@ -54,8 +54,6 @@ class GridPropertyLayout extends React.PureComponent { } } -module.exports = GridPropertyLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(GridPropertyLayout)); } diff --git a/test/examples/5-static-elements.jsx b/test/examples/5-static-elements.jsx index 7ecd508bb..433791087 100644 --- a/test/examples/5-static-elements.jsx +++ b/test/examples/5-static-elements.jsx @@ -7,7 +7,7 @@ const ReactGridLayout = WidthProvider(RGL); * This layout demonstrates how to use static grid elements. * Static elements are not draggable or resizable, and cannot be moved. */ -class StaticElementsLayout extends React.PureComponent { +export default class StaticElementsLayout extends React.PureComponent { constructor(props) { super(props); @@ -58,8 +58,6 @@ class StaticElementsLayout extends React.PureComponent { } } -module.exports = StaticElementsLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(StaticElementsLayout)); } diff --git a/test/examples/6-dynamic-add-remove.jsx b/test/examples/6-dynamic-add-remove.jsx index 5f1349d9c..a7e693f10 100644 --- a/test/examples/6-dynamic-add-remove.jsx +++ b/test/examples/6-dynamic-add-remove.jsx @@ -6,7 +6,7 @@ const ResponsiveReactGridLayout = WidthProvider(Responsive); /** * This layout demonstrates how to use a grid with a dynamic number of elements. */ -class AddRemoveLayout extends React.PureComponent { +export default class AddRemoveLayout extends React.PureComponent { static defaultProps = { className: "layout", cols: { lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }, @@ -24,7 +24,7 @@ class AddRemoveLayout extends React.PureComponent { y: 0, w: 2, h: 2, - add: i === (list.length - 1).toString() + add: i === (list.length - 1) }; }), newCounter: 0 @@ -117,8 +117,6 @@ class AddRemoveLayout extends React.PureComponent { } } -module.exports = AddRemoveLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(AddRemoveLayout)); } diff --git a/test/examples/7-localstorage.jsx b/test/examples/7-localstorage.jsx index 9d51baf5b..73c4f43e0 100644 --- a/test/examples/7-localstorage.jsx +++ b/test/examples/7-localstorage.jsx @@ -6,7 +6,7 @@ const originalLayout = getFromLS("layout") || []; /** * This layout demonstrates how to sync to localstorage. */ -class LocalStorageLayout extends React.PureComponent { +export default class LocalStorageLayout extends React.PureComponent { static defaultProps = { className: "layout", cols: 12, @@ -91,8 +91,6 @@ function saveToLS(key, value) { } } -module.exports = LocalStorageLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(LocalStorageLayout)); } diff --git a/test/examples/8-localstorage-responsive.jsx b/test/examples/8-localstorage-responsive.jsx index 5baafdf53..78269d11c 100644 --- a/test/examples/8-localstorage-responsive.jsx +++ b/test/examples/8-localstorage-responsive.jsx @@ -7,7 +7,7 @@ const originalLayouts = getFromLS("layouts") || {}; /** * This layout demonstrates how to sync multiple responsive layouts to localstorage. */ -class ResponsiveLocalStorageLayout extends React.PureComponent { +export default class ResponsiveLocalStorageLayout extends React.PureComponent { constructor(props) { super(props); @@ -67,8 +67,6 @@ class ResponsiveLocalStorageLayout extends React.PureComponent { } } -module.exports = ResponsiveLocalStorageLayout; - function getFromLS(key) { let ls = {}; if (global.localStorage) { @@ -92,6 +90,8 @@ function saveToLS(key, value) { } } -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => + fn.default(ResponsiveLocalStorageLayout) + ); } diff --git a/test/examples/9-min-max-wh.jsx b/test/examples/9-min-max-wh.jsx index 7dec6542c..b403ccf62 100644 --- a/test/examples/9-min-max-wh.jsx +++ b/test/examples/9-min-max-wh.jsx @@ -4,7 +4,7 @@ import RGL, { WidthProvider } from "react-grid-layout"; const ReactGridLayout = WidthProvider(RGL); -class MinMaxLayout extends React.PureComponent { +export default class MinMaxLayout extends React.PureComponent { static defaultProps = { isDraggable: true, isResizable: true, @@ -65,8 +65,6 @@ class MinMaxLayout extends React.PureComponent { } } -module.exports = MinMaxLayout; - -if (require.main === module) { - require("../test-hook.jsx")(module.exports); +if (process.env.STATIC_EXAMPLES === true) { + import("../test-hook.jsx").then(fn => fn.default(MinMaxLayout)); } diff --git a/test/spec/__snapshots__/lifecycle-test.js.snap b/test/spec/__snapshots__/lifecycle-test.js.snap new file mode 100644 index 000000000..7d158ff52 --- /dev/null +++ b/test/spec/__snapshots__/lifecycle-test.js.snap @@ -0,0 +1,9058 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Lifecycle tests Basic Render 1`] = ` + + + +
+ + + +
+ + 0 + + + + +
+
+
+
+ + + +
+ + 1 + + + + +
+
+
+
+ + + +
+ + 2 + + + + +
+
+
+
+ + + +
+ + 3 + + + + +
+
+
+
+ + + +
+ + 4 + + + + +
+
+
+
+ + + +
+ + 5 + + + + +
+
+
+
+ + + +
+ + 6 + + + + +
+
+
+
+ + + +
+ + 7 + + + + +
+
+
+
+ + + +
+ + 8 + + + + +
+
+
+
+ + + +
+ + 9 + + + + +
+
+
+
+ + + +
+ + 10 + + + + +
+
+
+
+ + + +
+ + 11 + + + + +
+
+
+
+ + + +
+ + 12 + + + + +
+
+
+
+ + + +
+ + 13 + + + + +
+
+
+
+ + + +
+ + 14 + + + + +
+
+
+
+ + + +
+ + 15 + + + + +
+
+
+
+ + + +
+ + 16 + + + + +
+
+
+
+ + + +
+ + 17 + + + + +
+
+
+
+ + + +
+ + 18 + + + + +
+
+
+
+ + + +
+ + 19 + + + + +
+
+
+
+
+
+
+
+`; + +exports[`Lifecycle tests Basic Render 1`] = ` + +
+
+ Current Breakpoint: + xxs + ( + 2 + columns) +
+
+ Compaction type: + + Vertical +
+ + + + + +
+ + + +
+ + 0 + + + + +
+
+
+
+ + + +
+ + 1 + + + + +
+
+
+
+ + + +
+ + 2 + + + + +
+
+
+
+ + + +
+ + 3 + + + + +
+
+
+
+ + + +
+ + 4 + + + + +
+
+
+
+ + + +
+ + 5 + + + + +
+
+
+
+ + + +
+ + 6 + + + + +
+
+
+
+ + + +
+ + 7 + + + + +
+
+
+
+ + + +
+ + 8 + + + + +
+
+
+
+ + + +
+ + 9 + + + + +
+
+
+
+ + + +
+ + Static - + 10 + + + + +
+
+
+
+ + + +
+ + 11 + + + + +
+
+
+
+ + + +
+ + 12 + + + + +
+
+
+
+ + + +
+ + 13 + + + + +
+
+
+
+ + + +
+ + 14 + + + + +
+
+
+
+ + + +
+ + 15 + + + + +
+
+
+
+ + + +
+ + 16 + + + + +
+
+
+
+ + + +
+ + 17 + + + + +
+
+
+
+ + + +
+ + 18 + + + + +
+
+
+
+ + + +
+ + 19 + + + + +
+
+
+
+ + + +
+ + 20 + + + + +
+
+
+
+ + + +
+ + Static - + 21 + + + + +
+
+
+
+ + + +
+ + 22 + + + + +
+
+
+
+ + + +
+ + 23 + + + + +
+
+
+
+ + + +
+ + 24 + + + + +
+
+
+
+
+
+
+
+
+
+`; diff --git a/test/spec/lifecycle-test.js b/test/spec/lifecycle-test.js new file mode 100644 index 000000000..8e969de6e --- /dev/null +++ b/test/spec/lifecycle-test.js @@ -0,0 +1,193 @@ +// @flow +/* eslint-env jest */ + +import React from "react"; +import _ from "lodash"; +import TestUtils from "react-dom/test-utils"; +import ResponsiveReactGridLayout from "../../lib/ResponsiveReactGridLayout"; +import ReactGridLayout from "../../lib/ReactGridLayout"; +import BasicLayout from "../examples/1-basic"; +import ShowcaseLayout from "../examples/0-showcase"; +import DroppableLayout from "../examples/15-drag-from-outside"; +import deepFreeze from "../util/deepFreeze"; +import { shallow, mount } from "enzyme"; + +describe("Lifecycle tests", function() { + // Example layouts use randomness + let randIdx = 0; + beforeAll(() => { + const randArr = [0.001, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.999]; + jest.spyOn(global.Math, "random").mockImplementation(() => { + randIdx = (randIdx + 1) % randArr.length; + return randArr[randIdx]; + }); + }); + + beforeEach(() => { + randIdx = 0; + }); + + afterAll(() => { + global.Math.random.mockRestore(); + }); + + describe("", function() { + it("Basic Render", async function() { + const wrapper = mount(); + expect(wrapper).toMatchSnapshot(); + }); + + describe("Droppability", function() { + it("Updates when an item is dropped in", function() { + const wrapper = mount(); + const gridLayout = wrapper.find("ReactGridLayout"); + expect(gridLayout).toHaveLength(1); + + // Start: no dropping node. + expect(gridLayout.state("droppingDOMNode")).toEqual(null); + + // Find the droppable element and drag it over the grid layout. + const droppable = wrapper.find(".droppable-element"); + TestUtils.Simulate.dragOver(gridLayout.getDOMNode(), { + nativeEvent: { + target: droppable.getDOMNode(), + layerX: 200, + layerY: 150 + } + }); + + // We should have the position in our state. + expect(gridLayout.state("droppingPosition")).toHaveProperty( + "left", + 200 + ); + expect(gridLayout.state("droppingPosition")).toHaveProperty("top", 150); + // We should now have the placeholder element in our state. + expect(gridLayout.state("droppingDOMNode")).toHaveProperty( + "type", + "div" + ); + expect(gridLayout.state("droppingDOMNode")).toHaveProperty( + "key", + "__dropping-elem__" + ); + + // It should also have a layout item assigned to it. + let layoutItem = gridLayout + .state("layout") + .find(item => item.i === "__dropping-elem__"); + expect(layoutItem).toEqual({ + i: "__dropping-elem__", + h: 1, + w: 1, + x: 1, + y: 4, + static: false, + isDraggable: true + }); + + // Let's move it some more. + TestUtils.Simulate.dragOver(gridLayout.getDOMNode(), { + nativeEvent: { + target: droppable.getDOMNode(), + layerX: 0, + layerY: 300 + } + }); + + // State should change. + expect(gridLayout.state("droppingPosition")).toHaveProperty("left", 0); + expect(gridLayout.state("droppingPosition")).toHaveProperty("top", 300); + + layoutItem = gridLayout + .state("layout") + .find(item => item.i === "__dropping-elem__"); + // Using toMatchObject() here as this will inherit some undefined properties from the cloning + expect(layoutItem).toMatchObject({ + i: "__dropping-elem__", + h: 1, + w: 1, + x: 0, + y: 9, + static: false, + isDraggable: true + }); + }); + }); + }); + + describe("", function() { + it("Basic Render", async function() { + const wrapper = mount(); + expect(wrapper).toMatchSnapshot(); + }); + + it("Does not modify layout on movement", async function() { + const layouts = { + lg: [ + ..._.times(3, i => ({ + i: String(i), + x: i, + y: 0, + w: 1, + h: 1 + })) + ] + }; + const frozenLayouts = deepFreeze(layouts, { + set: true, + get: false /* don't crash on unknown gets */ + }); + // Render the basic Responsive layout. + const wrapper = mount( + + {_.times(3, i => ( +
+ ))} + + ); + + // Set that layout as state and ensure it doesn't change. + wrapper.setState({ layouts: frozenLayouts }); + wrapper.setProps({ width: 800, breakpoint: "md" }); // will generate new layout + wrapper.render(); + + expect(frozenLayouts).not.toContain("md"); + }); + }); +}); + +function simulateMovementFromTo(node, fromX, fromY, toX, toY) { + TestUtils.Simulate.mouseDown(node, { clientX: fromX, clientY: fromX }); + mouseMove(node, toX, toY); + TestUtils.Simulate.mouseUp(node); +} + +function mouseMove(node, x, y) { + const doc = node ? node.ownerDocument : document; + const evt = doc.createEvent("MouseEvents"); + // $FlowIgnore get with it, flow + evt.initMouseEvent( + "mousemove", + true, + true, + window, + 0, + 0, + 0, + x, + y, + false, + false, + false, + false, + 0, + null + ); + doc.dispatchEvent(evt); + return evt; +} diff --git a/test/spec/utils-test.js b/test/spec/utils-test.js index 34f530338..2f4577d94 100644 --- a/test/spec/utils-test.js +++ b/test/spec/utils-test.js @@ -4,16 +4,17 @@ import { bottom, collides, - validateLayout, - moveElement, compact, - sortLayoutItemsByRowCol -} from "../../lib/utils.js"; -/*:: import type { Layout } from "../../lib/utils.js"; */ - -/*:: declare function describe(name: string, fn: Function): void; */ -/*:: declare function it(name: string, fn: Function): void; */ -/*:: declare function expect(any): any; */ + fastRGLPropsEqual, + moveElement, + sortLayoutItemsByRowCol, + validateLayout +} from "../../lib/utils"; +import { + calcGridColWidth, + calcGridItemPosition +} from "../../lib/calculateUtils"; +import isEqual from "lodash.isequal"; describe("bottom", () => { it("Handles an empty layout as input", () => { @@ -74,9 +75,9 @@ describe("validateLayout", () => { }); it("Throws errors on invalid input", () => { expect(() => { - // $FlowFixMe: dynamic check validateLayout([ { i: "1", x: 0, y: 1, w: 1, h: 1 }, + // $FlowFixMe: dynamic check { i: "2", x: 1, y: 2, w: 1 } ]); }).toThrowError(/layout\[1\]\.h must be a number!/i); @@ -398,17 +399,135 @@ describe("compact horizontal", () => { it("Handles recursive collision by moving new collisions out of the way before moving item to the right", () => { const layout = [ { y: 0, x: 0, h: 2, w: 5, i: "1" }, - { y: 0, x: 0, h: 10, w: 1, i: "2" }, + { y: 1, x: 0, h: 10, w: 1, i: "2" }, { y: 5, x: 1, h: 1, w: 1, i: "3" }, { y: 5, x: 2, h: 1, w: 1, i: "4" }, { y: 5, x: 2, h: 1, w: 1, i: "5", static: true } ]; expect(compact(layout, "horizontal", 10)).toEqual([ { y: 0, x: 0, h: 2, w: 5, i: "1", moved: false, static: false }, - { y: 0, x: 5, h: 10, w: 1, i: "2", moved: false, static: false }, + { y: 1, x: 5, h: 10, w: 1, i: "2", moved: false, static: false }, { y: 5, x: 6, h: 1, w: 1, i: "3", moved: false, static: false }, { y: 5, x: 7, h: 1, w: 1, i: "4", moved: false, static: false }, { y: 5, x: 2, h: 1, w: 1, i: "5", moved: false, static: true } ]); }); }); + +const basePositionParams = { + margin: [0, 0], + containerPadding: [0, 0], + containerWidth: 800, + cols: 8, + rowHeight: 50, + maxRows: 12 +}; +describe("calcGridColWidth", () => { + it("should complete basic calculation", () => { + expect(calcGridColWidth(basePositionParams)).toEqual(100); + }); + + it("should consider margin", () => { + const positionParams = { + ...basePositionParams, + margin: [10, 10] + }; + // 70 px of margin in total (one between each of 8 items) + expect(calcGridColWidth(positionParams)).toEqual(91.25); + }); + + it("should consider container padding", () => { + const positionParams = { + ...basePositionParams, + containerPadding: [100, 0] + }; + // (800 - 100 - 100) / 8 + expect(calcGridColWidth(positionParams)).toEqual(75); + }); + + it("should consider margin and padding", () => { + const positionParams = { + ...basePositionParams, + margin: [10, 0], + containerPadding: [100, 0] + }; + // (800 - 100 - 100 - 70) / 8 + expect(calcGridColWidth(positionParams)).toEqual(66.25); + }); +}); + +describe("calcGridItemPosition", () => { + it("should complete basic calculation", () => { + const x = 1; + const y = 1; + const w = 2; + const h = 2; + const resizing = null; + const dragging = null; + const positionParams = { + ...basePositionParams, + margin: [10, 10], + containerPadding: [100, 100] + }; + expect( + calcGridItemPosition(positionParams, x, y, w, h, { resizing, dragging }) + ).toEqual({ + height: 110, // 50 * 2 + margin of 10 + left: 176, // 100 + colWidth (66.25) + margin. Rounded to complete pixel + top: 160, // 100 + height + margin + width: 143 // 2x colWidth + margin, rounded + }); + }); +}); + +describe("fastRGLPropsEqual", () => { + it("should tell us if props are equal, including arrays and objects", () => { + const props1 = { + className: "foo", + margin: [10, 10], + style: { background: "red" } + }; + const props2 = { + className: "foo", + margin: [10, 10], + style: { background: "red" } + }; + expect(fastRGLPropsEqual(props1, props2, isEqual)).toEqual(true); + }); + + it("catches changed arrays", () => { + const props1 = { + margin: [10, 10] + }; + const props2 = { + margin: [10, 11] + }; + expect(fastRGLPropsEqual(props1, props2, isEqual)).toEqual(false); + }); + + it("ignores children", () => { + const props1 = { + children: ["foo", "bar"] + }; + const props2 = { + children: ["biff", "bar"] + }; + expect(fastRGLPropsEqual(props1, props2, isEqual)).toEqual(true); + }); + + it("fails added props", () => { + const props1 = {}; + const props2 = { + droppingItem: { w: 1, h: 2, i: 3 } + }; + expect(fastRGLPropsEqual(props1, props2, isEqual)).toEqual(false); + }); + + it("ignores invalid props", () => { + const props1 = {}; + const props2 = { + somethingElse: { w: 1, h: 2, i: 3 } + }; + expect(fastRGLPropsEqual(props1, props2, isEqual)).toEqual(true); + }); +}); diff --git a/test/test-hook.jsx b/test/test-hook.jsx index bec87f7cf..e5c7b1414 100644 --- a/test/test-hook.jsx +++ b/test/test-hook.jsx @@ -1,11 +1,13 @@ import React from "react"; import ReactDOM from "react-dom"; -require("style-loader!css-loader!../css/styles.css"); -require("style-loader!css-loader!../examples/example-styles.css"); +import "style-loader!css-loader!../css/styles.css"; +import "style-loader!css-loader!../examples/example-styles.css"; typeof window !== "undefined" && (window.React = React); // for devtools -module.exports = function(Layout) { - class ExampleLayout extends React.Component { +export default function makeLayout(Layout) { + // Basic layout that mirrors the internals of its child layout by listening to `onLayoutChange`. + // It does not pass any other props to the Layout. + class ListeningLayout extends React.Component { state = { layout: [] }; onLayoutChange = layout => { @@ -14,9 +16,11 @@ module.exports = function(Layout) { stringifyLayout() { return this.state.layout.map(function(l) { + const name = l.i === "__dropping-elem__" ? "drop" : l.i; return (
- {l.i}: [{l.x}, {l.y}, {l.w}, {l.h}] + {name} + {`: [${l.x}, ${l.y}, ${l.w}, ${l.h}]`}
); }); @@ -35,9 +39,16 @@ module.exports = function(Layout) { } } - document.addEventListener("DOMContentLoaded", function() { + function run() { const contentDiv = document.getElementById("content"); const gridProps = window.gridProps || {}; - ReactDOM.render(React.createElement(ExampleLayout, gridProps), contentDiv); - }); -}; + ReactDOM.render(React.createElement(ListeningLayout, gridProps), contentDiv); + } + if (!document.getElementById("content")) { + document.addEventListener("DOMContentLoaded", run); + } else { + run(); + } + + return ListeningLayout; +} diff --git a/test/util/deepFreeze.js b/test/util/deepFreeze.js new file mode 100644 index 000000000..3a768f87a --- /dev/null +++ b/test/util/deepFreeze.js @@ -0,0 +1,35 @@ +// @flow + +// Deep freeze an object by using a Proxy. +// This is better than Object.freeze() as we can create coherent error messages +// and easily only deliver frozen subobjects when they are accessed. We can +// even add custom logic, like warning if you access a property that doesn't exist. +/* eslint-disable no-console */ +export default function deepFreeze(inputObj: T, options: {get: boolean, set: boolean} = {get: true, set: true}): $ReadOnly<{|...T|}> { + // Our handler that rejects any change to the object and any nested objects inside it + const deepFreezer = {}; + if (options.get) { + deepFreezer.get = function get(obj: T, prop: $Keys, _receiver: Proxy) { + // Clone w/o Proxy + if (prop === 'toJSON') return () => obj; + // If dealing with nested object, nest the proxy untill it reaches the direct property of it's parent proxy + if (typeof obj[prop] === 'object' && obj[prop] !== null) { + return new Proxy(obj[prop], deepFreezer); + } + // If prop is directly accessible, just do the default operation + else { + if (!(prop in obj) && prop !== 'length' && prop !== '__esModule' && typeof prop !== 'symbol') { + throw new Error(`Can not get unknown prop "${String(prop)}" on frozen object.`); + } + return obj[prop]; + } + }; + } + if (options.set) { + deepFreezer.set = function set(obj: T, prop: string, _val: any, _rec: Proxy): boolean { + throw new Error(`Can not set unknown prop "${prop}" on frozen object.`); + }; + } + // $FlowIgnore for all useful purposes the output type is T here + return new Proxy(inputObj, deepFreezer); +} \ No newline at end of file diff --git a/test/util/setupTests.js b/test/util/setupTests.js new file mode 100644 index 000000000..d1154bb08 --- /dev/null +++ b/test/util/setupTests.js @@ -0,0 +1,23 @@ +// @flow + +import Enzyme from "enzyme"; +import Adapter from "enzyme-adapter-react-16"; + +Enzyme.configure({ adapter: new Adapter() }); + +// We rely on sort() being deterministic for tests, but it changed from QuickSort to TimSort +// in Node 12. This breaks tests, so we monkey-patch it. +import { sort } from "timsort"; + +// $FlowIgnore dirty hack +Array.prototype.sort = function(comparator) { + sort(this, comparator); + return this; +}; + +// Required in drag code, not working in JSDOM +Object.defineProperty(HTMLElement.prototype, "offsetParent", { + get() { + return this.parentNode; + } +}); diff --git a/webpack-dev-server.config.js b/webpack-dev-server.config.js index 354f89188..54d94c037 100644 --- a/webpack-dev-server.config.js +++ b/webpack-dev-server.config.js @@ -1,53 +1,48 @@ -const path = require('path'); -var webpack = require("webpack"); +"use strict"; +const path = require("path"); +const webpack = require("webpack"); module.exports = { - context: __dirname, - entry: "./test/dev-hook.jsx", - output: { - path: '/', - filename: "bundle.js", - sourceMapFilename: "[file].map", - }, - module: { - loaders: [ - {test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader', - query: { - cacheDirectory: true, - plugins: [ - ['react-transform', - { - transforms: [ - { - transform: 'react-transform-hmr', - imports: ['react'], - locals: ['module'] - } - ] - } - ] - ] - } + mode: "development", + context: __dirname, + entry: "./test/dev-hook.jsx", + output: { + path: "/", + filename: "bundle.js", + sourceMapFilename: "[file].map" + }, + module: { + rules: [ + { + test: /\.jsx?$/, + exclude: /node_modules/, + loader: "babel-loader", + query: { + cacheDirectory: true, + plugins: [["react-hot-loader/babel"]] } - ] - }, - plugins: [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: JSON.stringify('development') - } - }), - ], - devtool: "eval", - devServer: { - publicPath: '/', - compress: true, - port: 4002 - }, - resolve: { - extensions: [".webpack.js", ".web.js", ".js", ".jsx"], - alias: { - 'react-grid-layout': path.join(__dirname, '/index-dev.js') } + ] + }, + plugins: [ + new webpack.DefinePlugin({ + "process.env": { + NODE_ENV: JSON.stringify("development") + } + }) + ], + devtool: "eval", + devServer: { + publicPath: "/", + compress: true, + port: 4002, + open: true, + contentBase: "." + }, + resolve: { + extensions: [".webpack.js", ".web.js", ".js", ".jsx"], + alias: { + "react-grid-layout": path.join(__dirname, "/index-dev.js") } + } }; diff --git a/webpack-examples.config.js b/webpack-examples.config.js index 75826d137..08960d077 100644 --- a/webpack-examples.config.js +++ b/webpack-examples.config.js @@ -1,52 +1,72 @@ -'use strict'; -var webpack = require('webpack'); -var fs = require('fs'); +"use strict"; +const webpack = require("webpack"); +const fs = require("fs"); // Builds example bundles module.exports = { - context: __dirname, - entry: { - commons: ["lodash"], - }, - output: { - path: __dirname + "/dist", - filename: "[name].bundle.js", - sourceMapFilename: "[file].map", - }, - module: { - loaders: [ - {test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader', query: { - cacheDirectory: true, - plugins: [ - 'transform-react-inline-elements', - 'transform-react-constant-elements', - ] - }} - ] - }, - plugins: [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: JSON.stringify('production') + mode: "development", + context: __dirname, + entry: { + commons: ["lodash"] + }, + optimization: { + splitChunks: { + cacheGroups: { + commons: { + name: "commons", + chunks: "initial", + minChunks: 2 } - }), - new webpack.optimize.CommonsChunkPlugin({ - name: 'commons', filename: 'commons.js' - }) - ], - resolve: { - extensions: [".webpack.js", ".web.js", ".js", ".jsx"], - alias: {'react-grid-layout': __dirname + '/index-dev.js'} + } } + }, + output: { + path: __dirname + "/examples", + filename: "[name].js", + sourceMapFilename: "[file].map" + }, + module: { + rules: [ + { + test: /\.jsx?$/, + exclude: /node_modules/, + loader: "babel-loader", + query: { + cacheDirectory: true + } + } + ] + }, + plugins: [ + new webpack.DefinePlugin({ + "process.env": { + NODE_ENV: JSON.stringify("production"), + // sigil to load self into #content + STATIC_EXAMPLES: JSON.stringify(true) + } + }) + ], + devServer: { + port: 4002, + open: true, + openPage: "examples/0-showcase.html", + contentBase: ".", + publicPath: "/examples/" + }, + resolve: { + extensions: [".js", ".jsx"], + alias: { "react-grid-layout": __dirname + "/index-dev.js" } + } }; // Load all entry points -var files = fs.readdirSync(__dirname + '/test/examples').filter(function(element, index, array){ +const files = fs + .readdirSync(__dirname + "/test/examples") + .filter(function(element, index, array) { return element.match(/^.+\.jsx$/); -}); + }); -for(var idx in files){ - var file = files[idx]; - var module_name = file.replace(/\.jsx$/,''); - module.exports.entry[module_name] = './test/examples/' + file; +for (const file of files) { + const module_name = file.replace(/\.jsx$/, ""); + module.exports.entry[module_name] = "./test/examples/" + file; } diff --git a/webpack.config.js b/webpack.config.js index 180305c92..83ba40f02 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,12 @@ -var webpack = require("webpack"); +// @flow +const webpack = require("webpack"); // Builds bundle usable