You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vestride_Shuffle/dist/shuffle.min.js.map

1 line
149 KiB
Plaintext

{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///shuffle.min.js","webpack:///webpack/bootstrap 35a3cfe3322ce6f556df","webpack:///./src/point.js","webpack:///./src/classes.js","webpack:///./src/get-number.js","webpack:///./~/xtend/immutable.js","webpack:///./src/shuffle.js","webpack:///./~/array-parallel/index.js","webpack:///./~/array-uniq/index.js","webpack:///./src/computed-size.js","webpack:///./src/get-number-style.js","webpack:///./src/layout.js","webpack:///./src/on-transition-end.js","webpack:///./src/shuffle-item.js","webpack:///./src/sorter.js","webpack:///./~/custom-event-polyfill/custom-event-polyfill.js","webpack:///./~/matches-selector/index.js","webpack:///./~/throttleit/index.js","webpack:///(webpack)/buildin/global.js","webpack:///./src/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","__WEBPACK_IMPORTED_MODULE_0__get_number__","Point","x","y","equals","a","b","BASE","SHUFFLE_ITEM","VISIBLE","HIDDEN","getNumber","parseFloat","extend","target","arguments","length","source","key","_classCallCheck","instance","Constructor","TypeError","toArray","arrayLike","Array","slice","arrayMax","array","Math","max","apply","arrayIncludes","obj","indexOf","__WEBPACK_IMPORTED_MODULE_0_custom_event_polyfill__","__WEBPACK_IMPORTED_MODULE_1_matches_selector__","__WEBPACK_IMPORTED_MODULE_1_matches_selector___default","__WEBPACK_IMPORTED_MODULE_2_array_uniq__","__WEBPACK_IMPORTED_MODULE_2_array_uniq___default","__WEBPACK_IMPORTED_MODULE_3_xtend__","__WEBPACK_IMPORTED_MODULE_3_xtend___default","__WEBPACK_IMPORTED_MODULE_4_throttleit__","__WEBPACK_IMPORTED_MODULE_4_throttleit___default","__WEBPACK_IMPORTED_MODULE_5_array_parallel__","__WEBPACK_IMPORTED_MODULE_5_array_parallel___default","__WEBPACK_IMPORTED_MODULE_6__point__","__WEBPACK_IMPORTED_MODULE_7__shuffle_item__","__WEBPACK_IMPORTED_MODULE_8__classes__","__WEBPACK_IMPORTED_MODULE_9__get_number_style__","__WEBPACK_IMPORTED_MODULE_10__sorter__","__WEBPACK_IMPORTED_MODULE_11__on_transition_end__","__WEBPACK_IMPORTED_MODULE_12__layout__","_createClass","defineProperties","props","descriptor","writable","protoProps","staticProps","id","Shuffle","element","options","undefined","useSizer","lastSort","group","lastFilter","ALL_ITEMS","isEnabled","isDestroyed","isInitialized","_transitions","isTransitioning","_queue","_getElementOption","_init","items","_getItems","sizer","classList","add","Classes","_initItems","_onResize","_getResizeFunction","window","addEventListener","containerCss","getComputedStyle","containerWidth","getSize","width","_validateStyles","_setColumns","filter","initialSort","offsetWidth","_setTransitions","style","transition","speed","easing","resizeFunction","_handleResize","bind","throttle","throttleTime","option","querySelector","nodeType","jquery","styles","position","overflow","category","collection","set","_getFilteredSets","_toggleFilterClasses","_this","visible","hidden","forEach","item","_doesPassFilter","push","attr","getAttribute","FILTER_ATTRIBUTE_KEY","keys","delimeter","split","JSON","parse","isArray","some","_ref","show","hide","init","dispose","visibleItems","_getFilteredItems","str","useTransforms","_this2","children","el","itemSelector","map","by","isVisible","gutterSize","size","columnWidth","gutterWidth","gutter","_getGutterSize","_getColumnSize","calculatedColumns","abs","round","columnThreshold","cols","floor","colWidth","height","_getContainerSize","positions","index","min","staggerAmount","staggerAmountMax","details","shuffle","dispatchEvent","CustomEvent","bubbles","cancelable","detail","_this3","count","callback","transitionDelay","applyCss","Css","after","currPos","point","currScale","scale","itemSize","pos","_getItemPosition","Scale","before","_getStaggerAmount","gridSize","total","threshold","buffer","_this4","_getConcealedItems","update","_ref2","transform","left","top","itemCallback","done","evt","opts","_this5","_getStylesForTransition","_whenTransitionDone","_cancelMovement","hasSpeed","hasQueue","_startTransitions","_styleImmediately","_dispatchLayout","transitions","_this6","callbacks","_getTransitionFunction","_movementFinished","objects","_this7","elements","_skipTransitions","_dispatch","EventType","LAYOUT","sortObj","_filter","_shrink","_updateItemCount","sort","_resetCols","_layout","_processQueue","_setContainerSize","isOnlyLayout","newItems","concat","_updateItemsOrder","isUpdateLayout","_this8","oldItems","getItemByElement","handleLayout","removeEventListener","_disposeItems","parentNode","removeChild","REMOVED","remove","removeAttribute","includeMargins","marginLeft","marginRight","marginTop","marginBottom","zero","data","duration","transitionDuration","delay","ShuffleItem","__Point","__sorter","__getColumnSpan","__getAvailablePositions","__getShortColumn","noop","fns","context","maybeDone","err","result","finished","results","pending","fn","global","uniqNoSet","arr","ret","uniqSet","seen","Set","has","uniqSetWithForEach","doesForEachActuallyWork","document","body","documentElement","e","createElement","cssText","appendChild","getNumberStyle","__WEBPACK_IMPORTED_MODULE_1__computed_size__","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","arrayMin","getItemPosition","span","getColumnSpan","setY","getAvailablePositions","shortColumnIndex","getShortColumn","__WEBPACK_IMPORTED_MODULE_0__point__","setHeight","itemWidth","columns","columnSpan","ceil","available","minPosition","len","uniqueId","eventName","onTransitionEnd","listener","currentTarget","cancelTransitionEnd","__WEBPACK_IMPORTED_MODULE_1__classes__","addClasses","INITIAL","classes","className","removeClasses","visibility","will-change","opacity","randomize","tmp","current","random","sorter","__WEBPACK_IMPORTED_MODULE_0_xtend___default","defaults","original","revert","valA","valB","reverse","__WEBPACK_IMPORTED_MODULE_0_xtend__","ce","preventDefault","defaultPrevented","Error","event","params","origPrevent","createEvent","initCustomEvent","Event","match","selector","vendor","nodes","querySelectorAll","proto","Element","matches","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","func","wait","timeoutID","last","Date","rtn","ctx","args","delta","setTimeout","g","Function","eval","default"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,O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mExB,QAAA4I,GAAAkR,EAAAC,GAcA,QAAApZ,KACAqZ,EAAA,EACAC,GAAA,GAAAC,MACAC,EAAAL,EAAA9V,MAAAoW,EAAAC,GACAD,EAAA,KACAC,EAAA,KAlBA,GAAAD,GAAAC,EAAAF,EAAAH,EACAC,EAAA,CAEA,mBACAG,EAAAha,KACAia,EAAArX,SACA,IAAAsX,GAAA,GAAAJ,MAAAD,CAIA,OAHAD,KACAM,GAAAP,EAAApZ,IACAqZ,EAAAO,WAAA5Z,EAAAoZ,EAAAO,IACAH,GArBAla,EAAAD,QAAA4I,GjB4pEM,SAAU3I,EAAQD,GkB5pExB,GAAAwa,EAGAA,GAAA,WACA,MAAApa,QAGA,KAEAoa,KAAAC,SAAA,qBAAAC,MAAA,QACC,MAAA9F,GAED,gBAAApN,UACAgT,EAAAhT,QAOAvH,EAAAD,QAAAwa,GlBmqEM,SAAUva,EAAQD,EAASM,GmBvrEjCL,EAAOD,QAAUM,EAAQ,GAAaqa","file":"shuffle.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"shuffle\"] = factory();\n\telse\n\t\troot[\"shuffle\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"shuffle\"] = factory();\n\telse\n\t\troot[\"shuffle\"] = factory();\n})(this, function() {\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/******/\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// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\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 = 17);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__get_number__ = __webpack_require__(2);\n\n\n\n\n/**\n * Represents a coordinate pair.\n * @param {number} [x=0] X.\n * @param {number} [y=0] Y.\n */\nvar Point = function Point(x, y) {\n this.x = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(x);\n this.y = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(y);\n};\n\n/**\n * Whether two points are equal.\n * @param {Point} a Point A.\n * @param {Point} b Point B.\n * @return {boolean}\n */\nPoint.equals = function (a, b) {\n return a.x === b.x && a.y === b.y;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = Point;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = {\n BASE: 'shuffle',\n SHUFFLE_ITEM: 'shuffle-item',\n VISIBLE: 'shuffle-item--visible',\n HIDDEN: 'shuffle-item--hidden'\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = getNumber;\n\n\n/**\n * Always returns a numeric value, given a value. Logic from jQuery's `isNumeric`.\n * @param {*} value Possibly numeric value.\n * @return {number} `value` or zero if `value` isn't numeric.\n */\n\nfunction getNumber(value) {\n return parseFloat(value) || 0;\n}\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\nmodule.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_custom_event_polyfill__ = __webpack_require__(13);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_custom_event_polyfill___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_custom_event_polyfill__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_matches_selector__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_matches_selector___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_matches_selector__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_array_uniq__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_array_uniq___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_array_uniq__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_xtend__ = __webpack_require__(3);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_xtend___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_xtend__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_throttleit__ = __webpack_require__(15);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_throttleit___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_throttleit__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_array_parallel__ = __webpack_require__(5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_array_parallel___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_array_parallel__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__point__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__shuffle_item__ = __webpack_require__(11);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__classes__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__get_number_style__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__sorter__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__on_transition_end__ = __webpack_require__(10);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__layout__ = __webpack_require__(9);\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction toArray(arrayLike) {\n return Array.prototype.slice.call(arrayLike);\n}\n\nfunction arrayMax(array) {\n return Math.max.apply(Math, array);\n}\n\nfunction arrayIncludes(array, obj) {\n if (arguments.length === 2) {\n return arrayIncludes(array)(obj);\n }\n\n return function (obj) {\n return array.indexOf(obj) > -1;\n };\n}\n\n// Used for unique instance variables\nvar id = 0;\n\nvar Shuffle = function () {\n\n /**\n * Categorize, sort, and filter a responsive grid of items.\n *\n * @param {Element} element An element which is the parent container for the grid items.\n * @param {Object} [options=Shuffle.options] Options object.\n * @constructor\n */\n function Shuffle(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Shuffle);\n\n this.options = __WEBPACK_IMPORTED_MODULE_3_xtend___default()(Shuffle.options, options);\n\n this.useSizer = false;\n this.lastSort = {};\n this.group = this.lastFilter = Shuffle.ALL_ITEMS;\n this.isEnabled = true;\n this.isDestroyed = false;\n this.isInitialized = false;\n this._transitions = [];\n this.isTransitioning = false;\n this._queue = [];\n\n element = this._getElementOption(element);\n\n if (!element) {\n throw new TypeError('Shuffle needs to be initialized with an element.');\n }\n\n this.element = element;\n this.id = 'shuffle_' + id++;\n\n this._init();\n this.isInitialized = true;\n }\n\n _createClass(Shuffle, [{\n key: '_init',\n value: function _init() {\n this.items = this._getItems();\n\n this.options.sizer = this._getElementOption(this.options.sizer);\n\n if (this.options.sizer) {\n this.useSizer = true;\n }\n\n // Add class and invalidate styles\n this.element.classList.add(Shuffle.Classes.BASE);\n\n // Set initial css for each item\n this._initItems();\n\n // Bind resize events\n this._onResize = this._getResizeFunction();\n window.addEventListener('resize', this._onResize);\n\n // Get container css all in one request. Causes reflow\n var containerCss = window.getComputedStyle(this.element, null);\n var containerWidth = Shuffle.getSize(this.element).width;\n\n // Add styles to the container if it doesn't have them.\n this._validateStyles(containerCss);\n\n // We already got the container's width above, no need to cause another\n // reflow getting it again... Calculate the number of columns there will be\n this._setColumns(containerWidth);\n\n // Kick off!\n this.filter(this.options.group, this.options.initialSort);\n\n // The shuffle items haven't had transitions set on them yet so the user\n // doesn't see the first layout. Set them now that the first layout is done.\n // First, however, a synchronous layout must be caused for the previous\n // styles to be applied without transitions.\n this.element.offsetWidth; // jshint ignore: line\n this._setTransitions();\n this.element.style.transition = 'height ' + this.options.speed + 'ms ' + this.options.easing;\n }\n\n /**\n * Returns a throttled and proxied function for the resize handler.\n * @return {Function}\n * @private\n */\n\n }, {\n key: '_getResizeFunction',\n value: function _getResizeFunction() {\n var resizeFunction = this._handleResize.bind(this);\n return this.options.throttle ? this.options.throttle(resizeFunction, this.options.throttleTime) : resizeFunction;\n }\n\n /**\n * Retrieve an element from an option.\n * @param {string|jQuery|Element} option The option to check.\n * @return {?Element} The plain element or null.\n * @private\n */\n\n }, {\n key: '_getElementOption',\n value: function _getElementOption(option) {\n // If column width is a string, treat is as a selector and search for the\n // sizer element within the outermost container\n if (typeof option === 'string') {\n return this.element.querySelector(option);\n\n // Check for an element\n } else if (option && option.nodeType && option.nodeType === 1) {\n return option;\n\n // Check for jQuery object\n } else if (option && option.jquery) {\n return option[0];\n }\n\n return null;\n }\n\n /**\n * Ensures the shuffle container has the css styles it needs applied to it.\n * @param {Object} styles Key value pairs for position and overflow.\n * @private\n */\n\n }, {\n key: '_validateStyles',\n value: function _validateStyles(styles) {\n // Position cannot be static.\n if (styles.position === 'static') {\n this.element.style.position = 'relative';\n }\n\n // Overflow has to be hidden.\n if (styles.overflow !== 'hidden') {\n this.element.style.overflow = 'hidden';\n }\n }\n\n /**\n * Filter the elements by a category.\n * @param {string} [category] Category to filter by. If it's given, the last\n * category will be used to filter the items.\n * @param {Array} [collection] Optionally filter a collection. Defaults to\n * all the items.\n * @return {!{visible: Array, hidden: Array}}\n * @private\n */\n\n }, {\n key: '_filter',\n value: function _filter() {\n var category = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.lastFilter;\n var collection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.items;\n\n var set = this._getFilteredSets(category, collection);\n\n // Individually add/remove hidden/visible classes\n this._toggleFilterClasses(set);\n\n // Save the last filter in case elements are appended.\n this.lastFilter = category;\n\n // This is saved mainly because providing a filter function (like searching)\n // will overwrite the `lastFilter` property every time its called.\n if (typeof category === 'string') {\n this.group = category;\n }\n\n return set;\n }\n\n /**\n * Returns an object containing the visible and hidden elements.\n * @param {string|Function} category Category or function to filter by.\n * @param {Array.<Element>} items A collection of items to filter.\n * @return {!{visible: Array, hidden: Array}}\n * @private\n */\n\n }, {\n key: '_getFilteredSets',\n value: function _getFilteredSets(category, items) {\n var _this = this;\n\n var visible = [];\n var hidden = [];\n\n // category === 'all', add visible class to everything\n if (category === Shuffle.ALL_ITEMS) {\n visible = items;\n\n // Loop through each item and use provided function to determine\n // whether to hide it or not.\n } else {\n items.forEach(function (item) {\n if (_this._doesPassFilter(category, item.element)) {\n visible.push(item);\n } else {\n hidden.push(item);\n }\n });\n }\n\n return {\n visible: visible,\n hidden: hidden\n };\n }\n\n /**\n * Test an item to see if it passes a category.\n * @param {string|Function} category Category or function to filter by.\n * @param {Element} element An element to test.\n * @return {boolean} Whether it passes the category/filter.\n * @private\n */\n\n }, {\n key: '_doesPassFilter',\n value: function _doesPassFilter(category, element) {\n\n if (typeof category === 'function') {\n return category.call(element, element, this);\n\n // Check each element's data-groups attribute against the given category.\n } else {\n var attr = element.getAttribute('data-' + Shuffle.FILTER_ATTRIBUTE_KEY);\n var keys = this.options.delimeter ? attr.split(this.options.delimeter) : JSON.parse(attr);\n\n if (Array.isArray(category)) {\n return category.some(arrayIncludes(keys));\n }\n\n return arrayIncludes(keys, category);\n }\n }\n\n /**\n * Toggles the visible and hidden class names.\n * @param {{visible, hidden}} Object with visible and hidden arrays.\n * @private\n */\n\n }, {\n key: '_toggleFilterClasses',\n value: function _toggleFilterClasses(_ref) {\n var visible = _ref.visible,\n hidden = _ref.hidden;\n\n visible.forEach(function (item) {\n item.show();\n });\n\n hidden.forEach(function (item) {\n item.hide();\n });\n }\n\n /**\n * Set the initial css for each item\n * @param {Array.<ShuffleItem>} [items] Optionally specifiy at set to initialize.\n * @private\n */\n\n }, {\n key: '_initItems',\n value: function _initItems() {\n var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.items;\n\n items.forEach(function (item) {\n item.init();\n });\n }\n\n /**\n * Remove element reference and styles.\n * @private\n */\n\n }, {\n key: '_disposeItems',\n value: function _disposeItems() {\n var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.items;\n\n items.forEach(function (item) {\n item.dispose();\n });\n }\n\n /**\n * Updates the visible item count.\n * @private\n */\n\n }, {\n key: '_updateItemCount',\n value: function _updateItemCount() {\n this.visibleItems = this._getFilteredItems().length;\n }\n\n /**\n * Sets css transform transition on a group of elements. This is not executed\n * at the same time as `item.init` so that transitions don't occur upon\n * initialization of Shuffle.\n * @param {Array.<ShuffleItem>} items Shuffle items to set transitions on.\n * @private\n */\n\n }, {\n key: '_setTransitions',\n value: function _setTransitions() {\n var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.items;\n\n var speed = this.options.speed;\n var easing = this.options.easing;\n\n var str;\n if (this.options.useTransforms) {\n str = 'transform ' + speed + 'ms ' + easing + ', opacity ' + speed + 'ms ' + easing;\n } else {\n str = 'top ' + speed + 'ms ' + easing + ', left ' + speed + 'ms ' + easing + ', opacity ' + speed + 'ms ' + easing;\n }\n\n items.forEach(function (item) {\n item.element.style.transition = str;\n });\n }\n }, {\n key: '_getItems',\n value: function _getItems() {\n var _this2 = this;\n\n return toArray(this.element.children).filter(function (el) {\n return __WEBPACK_IMPORTED_MODULE_1_matches_selector___default()(el, _this2.options.itemSelector);\n }).map(function (el) {\n return new __WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */](el);\n });\n }\n\n /**\n * When new elements are added to the shuffle container, update the array of\n * items because that is the order `_layout` calls them.\n */\n\n }, {\n key: '_updateItemsOrder',\n value: function _updateItemsOrder() {\n var children = this.element.children;\n this.items = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__sorter__[\"a\" /* default */])(this.items, {\n by: function by(element) {\n return Array.prototype.indexOf.call(children, element);\n }\n });\n }\n }, {\n key: '_getFilteredItems',\n value: function _getFilteredItems() {\n return this.items.filter(function (item) {\n return item.isVisible;\n });\n }\n }, {\n key: '_getConcealedItems',\n value: function _getConcealedItems() {\n return this.items.filter(function (item) {\n return !item.isVisible;\n });\n }\n\n /**\n * Returns the column size, based on column width and sizer options.\n * @param {number} containerWidth Size of the parent container.\n * @param {number} gutterSize Size of the gutters.\n * @return {number}\n * @private\n */\n\n }, {\n key: '_getColumnSize',\n value: function _getColumnSize(containerWidth, gutterSize) {\n var size;\n\n // If the columnWidth property is a function, then the grid is fluid\n if (typeof this.options.columnWidth === 'function') {\n size = this.options.columnWidth(containerWidth);\n\n // columnWidth option isn't a function, are they using a sizing element?\n } else if (this.useSizer) {\n size = Shuffle.getSize(this.options.sizer).width;\n\n // if not, how about the explicitly set option?\n } else if (this.options.columnWidth) {\n size = this.options.columnWidth;\n\n // or use the size of the first item\n } else if (this.items.length > 0) {\n size = Shuffle.getSize(this.items[0].element, true).width;\n\n // if there's no items, use size of container\n } else {\n size = containerWidth;\n }\n\n // Don't let them set a column width of zero.\n if (size === 0) {\n size = containerWidth;\n }\n\n return size + gutterSize;\n }\n\n /**\n * Returns the gutter size, based on gutter width and sizer options.\n * @param {number} containerWidth Size of the parent container.\n * @return {number}\n * @private\n */\n\n }, {\n key: '_getGutterSize',\n value: function _getGutterSize(containerWidth) {\n var size;\n if (typeof this.options.gutterWidth === 'function') {\n size = this.options.gutterWidth(containerWidth);\n } else if (this.useSizer) {\n size = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__get_number_style__[\"a\" /* default */])(this.options.sizer, 'marginLeft');\n } else {\n size = this.options.gutterWidth;\n }\n\n return size;\n }\n\n /**\n * Calculate the number of columns to be used. Gets css if using sizer element.\n * @param {number} [containerWidth] Optionally specify a container width if\n * it's already available.\n */\n\n }, {\n key: '_setColumns',\n value: function _setColumns() {\n var containerWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Shuffle.getSize(this.element).width;\n\n var gutter = this._getGutterSize(containerWidth);\n var columnWidth = this._getColumnSize(containerWidth, gutter);\n var calculatedColumns = (containerWidth + gutter) / columnWidth;\n\n // Widths given from getStyles are not precise enough...\n if (Math.abs(Math.round(calculatedColumns) - calculatedColumns) < this.options.columnThreshold) {\n // e.g. calculatedColumns = 11.998876\n calculatedColumns = Math.round(calculatedColumns);\n }\n\n this.cols = Math.max(Math.floor(calculatedColumns), 1);\n this.containerWidth = containerWidth;\n this.colWidth = columnWidth;\n }\n\n /**\n * Adjust the height of the grid\n */\n\n }, {\n key: '_setContainerSize',\n value: function _setContainerSize() {\n this.element.style.height = this._getContainerSize() + 'px';\n }\n\n /**\n * Based on the column heights, it returns the biggest one.\n * @return {number}\n * @private\n */\n\n }, {\n key: '_getContainerSize',\n value: function _getContainerSize() {\n return arrayMax(this.positions);\n }\n\n /**\n * Get the clamped stagger amount.\n * @param {number} index Index of the item to be staggered.\n * @return {number}\n */\n\n }, {\n key: '_getStaggerAmount',\n value: function _getStaggerAmount(index) {\n return Math.min(index * this.options.staggerAmount, this.options.staggerAmountMax);\n }\n\n /**\n * @return {boolean} Whether the event was prevented or not.\n */\n\n }, {\n key: '_dispatch',\n value: function _dispatch(name) {\n var details = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (this.isDestroyed) {\n return;\n }\n\n details.shuffle = this;\n return !this.element.dispatchEvent(new CustomEvent(name, {\n bubbles: true,\n cancelable: false,\n detail: details\n }));\n }\n\n /**\n * Zeros out the y columns array, which is used to determine item placement.\n * @private\n */\n\n }, {\n key: '_resetCols',\n value: function _resetCols() {\n var i = this.cols;\n this.positions = [];\n while (i--) {\n this.positions.push(0);\n }\n }\n\n /**\n * Loops through each item that should be shown and calculates the x, y position.\n * @param {Array.<ShuffleItem>} items Array of items that will be shown/layed\n * out in order in their array.\n */\n\n }, {\n key: '_layout',\n value: function _layout(items) {\n var _this3 = this;\n\n var count = 0;\n items.forEach(function (item) {\n var currPos = item.point;\n var currScale = item.scale;\n var itemSize = Shuffle.getSize(item.element, true);\n var pos = _this3._getItemPosition(itemSize);\n\n function callback() {\n item.element.style.transitionDelay = '';\n item.applyCss(__WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Css.VISIBLE.after);\n }\n\n // If the item will not change its position, do not add it to the render\n // queue. Transitions don't fire when setting a property to the same value.\n if (__WEBPACK_IMPORTED_MODULE_6__point__[\"a\" /* default */].equals(currPos, pos) && currScale === __WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Scale.VISIBLE) {\n item.applyCss(__WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Css.VISIBLE.before);\n callback();\n return;\n }\n\n item.point = pos;\n item.scale = __WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Scale.VISIBLE;\n\n // Use xtend here to clone the object so that the `before` object isn't\n // modified when the transition delay is added.\n var styles = __WEBPACK_IMPORTED_MODULE_3_xtend___default()(__WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Css.VISIBLE.before);\n styles.transitionDelay = _this3._getStaggerAmount(count) + 'ms';\n\n _this3._queue.push({\n item: item,\n styles: styles,\n callback: callback\n });\n\n count++;\n });\n }\n\n /**\n * Determine the location of the next item, based on its size.\n * @param {{width: number, height: number}} itemSize Object with width and height.\n * @return {Point}\n * @private\n */\n\n }, {\n key: '_getItemPosition',\n value: function _getItemPosition(itemSize) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__layout__[\"a\" /* getItemPosition */])({\n itemSize: itemSize,\n positions: this.positions,\n gridSize: this.colWidth,\n total: this.cols,\n threshold: this.options.columnThreshold,\n buffer: this.options.buffer\n });\n }\n\n /**\n * Hides the elements that don't match our filter.\n * @param {Array.<ShuffleItem>} collection Collection to shrink.\n * @private\n */\n\n }, {\n key: '_shrink',\n value: function _shrink() {\n var _this4 = this;\n\n var collection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getConcealedItems();\n\n var count = 0;\n collection.forEach(function (item) {\n function callback() {\n item.applyCss(__WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Css.HIDDEN.after);\n }\n\n // Continuing would add a transitionend event listener to the element, but\n // that listener would not execute because the transform and opacity would\n // stay the same.\n // The callback is executed here because it is not guaranteed to be called\n // after the transitionend event because the transitionend could be\n // canceled if another animation starts.\n if (item.scale === __WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Scale.HIDDEN) {\n item.applyCss(__WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Css.HIDDEN.before);\n callback();\n return;\n }\n\n item.scale = __WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Scale.HIDDEN;\n\n var styles = __WEBPACK_IMPORTED_MODULE_3_xtend___default()(__WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */].Css.HIDDEN.before);\n styles.transitionDelay = _this4._getStaggerAmount(count) + 'ms';\n\n _this4._queue.push({\n item: item,\n styles: styles,\n callback: callback\n });\n\n count++;\n });\n }\n\n /**\n * Resize handler.\n * @private\n */\n\n }, {\n key: '_handleResize',\n value: function _handleResize() {\n // If shuffle is disabled, destroyed, don't do anything\n if (!this.isEnabled || this.isDestroyed) {\n return;\n }\n\n // Will need to check height in the future if it's layed out horizontaly\n var containerWidth = Shuffle.getSize(this.element).width;\n\n // containerWidth hasn't changed, don't do anything\n if (containerWidth === this.containerWidth) {\n return;\n }\n\n this.update();\n }\n\n /**\n * Returns styles which will be applied to the an item for a transition.\n * @param {Object} obj Transition options.\n * @return {!Object} Transforms for transitions, left/top for animate.\n * @private\n */\n\n }, {\n key: '_getStylesForTransition',\n value: function _getStylesForTransition(_ref2) {\n var item = _ref2.item,\n styles = _ref2.styles;\n\n if (!styles.transitionDelay) {\n styles.transitionDelay = '0ms';\n }\n\n var x = item.point.x;\n var y = item.point.y;\n\n if (this.options.useTransforms) {\n styles.transform = 'translate(' + x + 'px, ' + y + 'px) scale(' + item.scale + ')';\n } else {\n styles.left = x + 'px';\n styles.top = y + 'px';\n }\n\n return styles;\n }\n\n /**\n * Listen for the transition end on an element and execute the itemCallback\n * when it finishes.\n * @param {Element} element Element to listen on.\n * @param {Function} itemCallback Callback for the item.\n * @param {Function} done Callback to notify `parallel` that this one is done.\n */\n\n }, {\n key: '_whenTransitionDone',\n value: function _whenTransitionDone(element, itemCallback, done) {\n var id = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__on_transition_end__[\"a\" /* onTransitionEnd */])(element, function (evt) {\n itemCallback();\n done(null, evt);\n });\n\n this._transitions.push(id);\n }\n\n /**\n * Return a function which will set CSS styles and call the `done` function\n * when (if) the transition finishes.\n * @param {Object} opts Transition object.\n * @return {Function} A function to be called with a `done` function.\n */\n\n }, {\n key: '_getTransitionFunction',\n value: function _getTransitionFunction(opts) {\n var _this5 = this;\n\n return function (done) {\n opts.item.applyCss(_this5._getStylesForTransition(opts));\n _this5._whenTransitionDone(opts.item.element, opts.callback, done);\n };\n }\n\n /**\n * Execute the styles gathered in the style queue. This applies styles to elements,\n * triggering transitions.\n * @private\n */\n\n }, {\n key: '_processQueue',\n value: function _processQueue() {\n if (this.isTransitioning) {\n this._cancelMovement();\n }\n\n var hasSpeed = this.options.speed > 0;\n var hasQueue = this._queue.length > 0;\n\n if (hasQueue && hasSpeed && this.isInitialized) {\n this._startTransitions(this._queue);\n } else if (hasQueue) {\n this._styleImmediately(this._queue);\n this._dispatchLayout();\n\n // A call to layout happened, but none of the newly visible items will\n // change position or the transition duration is zero, which will not trigger\n // the transitionend event.\n } else {\n this._dispatchLayout();\n }\n\n // Remove everything in the style queue\n this._queue.length = 0;\n }\n\n /**\n * Wait for each transition to finish, the emit the layout event.\n * @param {Array.<Object>} transitions Array of transition objects.\n */\n\n }, {\n key: '_startTransitions',\n value: function _startTransitions(transitions) {\n var _this6 = this;\n\n // Set flag that shuffle is currently in motion.\n this.isTransitioning = true;\n\n // Create an array of functions to be called.\n var callbacks = transitions.map(function (obj) {\n return _this6._getTransitionFunction(obj);\n });\n\n __WEBPACK_IMPORTED_MODULE_5_array_parallel___default()(callbacks, this._movementFinished.bind(this));\n }\n }, {\n key: '_cancelMovement',\n value: function _cancelMovement() {\n // Remove the transition end event for each listener.\n this._transitions.forEach(__WEBPACK_IMPORTED_MODULE_11__on_transition_end__[\"b\" /* cancelTransitionEnd */]);\n\n // Reset the array.\n this._transitions.length = 0;\n\n // Show it's no longer active.\n this.isTransitioning = false;\n }\n\n /**\n * Apply styles without a transition.\n * @param {Array.<Object>} objects Array of transition objects.\n * @private\n */\n\n }, {\n key: '_styleImmediately',\n value: function _styleImmediately(objects) {\n var _this7 = this;\n\n if (objects.length) {\n var elements = objects.map(function (obj) {\n return obj.item.element;\n });\n\n Shuffle._skipTransitions(elements, function () {\n objects.forEach(function (obj) {\n obj.item.applyCss(_this7._getStylesForTransition(obj));\n obj.callback();\n });\n });\n }\n }\n }, {\n key: '_movementFinished',\n value: function _movementFinished() {\n this._transitions.length = 0;\n this.isTransitioning = false;\n this._dispatchLayout();\n }\n }, {\n key: '_dispatchLayout',\n value: function _dispatchLayout() {\n this._dispatch(Shuffle.EventType.LAYOUT);\n }\n\n /**\n * The magic. This is what makes the plugin 'shuffle'\n * @param {string|Function|Array.<string>} [category] Category to filter by.\n * Can be a function, string, or array of strings.\n * @param {Object} [sortObj] A sort object which can sort the visible set\n */\n\n }, {\n key: 'filter',\n value: function filter(category, sortObj) {\n if (!this.isEnabled) {\n return;\n }\n\n if (!category || category && category.length === 0) {\n category = Shuffle.ALL_ITEMS;\n }\n\n this._filter(category);\n\n // Shrink each hidden item\n this._shrink();\n\n // How many visible elements?\n this._updateItemCount();\n\n // Update transforms on visible elements so they will animate to their new positions.\n this.sort(sortObj);\n }\n\n /**\n * Gets the visible elements, sorts them, and passes them to layout.\n * @param {Object} opts the options object for the sorted plugin\n */\n\n }, {\n key: 'sort',\n value: function sort() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.lastSort;\n\n if (!this.isEnabled) {\n return;\n }\n\n this._resetCols();\n\n var items = this._getFilteredItems();\n items = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__sorter__[\"a\" /* default */])(items, opts);\n\n this._layout(items);\n\n // `_layout` always happens after `_shrink`, so it's safe to process the style\n // queue here with styles from the shrink method.\n this._processQueue();\n\n // Adjust the height of the container.\n this._setContainerSize();\n\n this.lastSort = opts;\n }\n\n /**\n * Reposition everything.\n * @param {boolean} isOnlyLayout If true, column and gutter widths won't be\n * recalculated.\n */\n\n }, {\n key: 'update',\n value: function update(isOnlyLayout) {\n if (this.isEnabled) {\n\n if (!isOnlyLayout) {\n // Get updated colCount\n this._setColumns();\n }\n\n // Layout items\n this.sort();\n }\n }\n\n /**\n * Use this instead of `update()` if you don't need the columns and gutters updated\n * Maybe an image inside `shuffle` loaded (and now has a height), which means calculations\n * could be off.\n */\n\n }, {\n key: 'layout',\n value: function layout() {\n this.update(true);\n }\n\n /**\n * New items have been appended to shuffle. Mix them in with the current\n * filter or sort status.\n * @param {Array.<Element>} newItems Collection of new items.\n */\n\n }, {\n key: 'add',\n value: function add(newItems) {\n newItems = __WEBPACK_IMPORTED_MODULE_2_array_uniq___default()(newItems).map(function (el) {\n return new __WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */](el);\n });\n\n // Add classes and set initial positions.\n this._initItems(newItems);\n\n // Add transition to each item.\n this._setTransitions(newItems);\n\n // Update the list of items.\n this.items = this.items.concat(newItems);\n this._updateItemsOrder();\n this.filter(this.lastFilter);\n }\n\n /**\n * Disables shuffle from updating dimensions and layout on resize\n */\n\n }, {\n key: 'disable',\n value: function disable() {\n this.isEnabled = false;\n }\n\n /**\n * Enables shuffle again\n * @param {boolean} [isUpdateLayout=true] if undefined, shuffle will update columns and gutters\n */\n\n }, {\n key: 'enable',\n value: function enable(isUpdateLayout) {\n this.isEnabled = true;\n if (isUpdateLayout !== false) {\n this.update();\n }\n }\n\n /**\n * Remove 1 or more shuffle items\n * @param {Array.<Element>} collection An array containing one or more\n * elements in shuffle\n * @return {Shuffle} The shuffle object\n */\n\n }, {\n key: 'remove',\n value: function remove(collection) {\n var _this8 = this;\n\n if (!collection.length) {\n return;\n }\n\n collection = __WEBPACK_IMPORTED_MODULE_2_array_uniq___default()(collection);\n\n var oldItems = collection.map(function (element) {\n return _this8.getItemByElement(element);\n }).filter(function (item) {\n return !!item;\n });\n\n var handleLayout = function handleLayout() {\n _this8.element.removeEventListener(Shuffle.EventType.LAYOUT, handleLayout);\n _this8._disposeItems(oldItems);\n\n // Remove the collection in the callback\n collection.forEach(function (element) {\n element.parentNode.removeChild(element);\n });\n\n _this8._dispatch(Shuffle.EventType.REMOVED, { collection: collection });\n\n // Let it get garbage collected\n collection = null;\n oldItems = null;\n };\n\n // Hide collection first.\n this._toggleFilterClasses({\n visible: [],\n hidden: oldItems\n });\n\n this._shrink(oldItems);\n\n this.sort();\n\n // Update the list of items here because `remove` could be called again\n // with an item that is in the process of being removed.\n this.items = this.items.filter(function (item) {\n return !arrayIncludes(oldItems, item);\n });\n this._updateItemCount();\n\n this.element.addEventListener(Shuffle.EventType.LAYOUT, handleLayout);\n }\n\n /**\n * Retrieve a shuffle item by its element.\n * @param {Element} element Element to look for.\n * @return {?ShuffleItem} A shuffle item or null if it's not found.\n */\n\n }, {\n key: 'getItemByElement',\n value: function getItemByElement(element) {\n for (var i = this.items.length - 1; i >= 0; i--) {\n if (this.items[i].element === element) {\n return this.items[i];\n }\n }\n\n return null;\n }\n\n /**\n * Destroys shuffle, removes events, styles, and classes\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._cancelMovement();\n window.removeEventListener('resize', this._onResize);\n\n // Reset container styles\n this.element.classList.remove('shuffle');\n this.element.removeAttribute('style');\n\n // Reset individual item styles\n this._disposeItems();\n\n // Null DOM references\n this.items = null;\n this.options.sizer = null;\n this.element = null;\n this._transitions = null;\n\n // Set a flag so if a debounced resize has been triggered,\n // it can first check if it is actually isDestroyed and not doing anything\n this.isDestroyed = true;\n }\n\n /**\n * Returns the outer width of an element, optionally including its margins.\n *\n * There are a few different methods for getting the width of an element, none of\n * which work perfectly for all Shuffle's use cases.\n *\n * 1. getBoundingClientRect() `left` and `right` properties.\n * - Accounts for transform scaled elements, making it useless for Shuffle\n * elements which have shrunk.\n * 2. The `offsetWidth` property.\n * - This value stays the same regardless of the elements transform property,\n * however, it does not return subpixel values.\n * 3. getComputedStyle()\n * - This works great Chrome, Firefox, Safari, but IE<=11 does not include\n * padding and border when box-sizing: border-box is set, requiring a feature\n * test and extra work to add the padding back for IE and other browsers which\n * follow the W3C spec here.\n *\n * @param {Element} element The element.\n * @param {boolean} [includeMargins] Whether to include margins. Default is false.\n * @return {{width: number, height: number}} The width and height.\n */\n\n }], [{\n key: 'getSize',\n value: function getSize(element, includeMargins) {\n // Store the styles so that they can be used by others without asking for it again.\n var styles = window.getComputedStyle(element, null);\n var width = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__get_number_style__[\"a\" /* default */])(element, 'width', styles);\n var height = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__get_number_style__[\"a\" /* default */])(element, 'height', styles);\n\n if (includeMargins) {\n var marginLeft = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__get_number_style__[\"a\" /* default */])(element, 'marginLeft', styles);\n var marginRight = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__get_number_style__[\"a\" /* default */])(element, 'marginRight', styles);\n var marginTop = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__get_number_style__[\"a\" /* default */])(element, 'marginTop', styles);\n var marginBottom = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__get_number_style__[\"a\" /* default */])(element, 'marginBottom', styles);\n width += marginLeft + marginRight;\n height += marginTop + marginBottom;\n }\n\n return {\n width: width,\n height: height\n };\n }\n\n /**\n * Change a property or execute a function which will not have a transition\n * @param {Array.<Element>} elements DOM elements that won't be transitioned.\n * @param {Function} callback A function which will be called while transition\n * is set to 0ms.\n * @private\n */\n\n }, {\n key: '_skipTransitions',\n value: function _skipTransitions(elements, callback) {\n var zero = '0ms';\n\n // Save current duration and delay.\n var data = elements.map(function (element) {\n var style = element.style;\n var duration = style.transitionDuration;\n var delay = style.transitionDelay;\n\n // Set the duration to zero so it happens immediately\n style.transitionDuration = zero;\n style.transitionDelay = zero;\n\n return {\n duration: duration,\n delay: delay\n };\n });\n\n callback();\n\n // Cause reflow.\n elements[0].offsetWidth; // jshint ignore:line\n\n // Put the duration back\n elements.forEach(function (element, i) {\n element.style.transitionDuration = data[i].duration;\n element.style.transitionDelay = data[i].delay;\n });\n }\n }]);\n\n return Shuffle;\n}();\n\nShuffle.ShuffleItem = __WEBPACK_IMPORTED_MODULE_7__shuffle_item__[\"a\" /* default */];\n\nShuffle.ALL_ITEMS = 'all';\nShuffle.FILTER_ATTRIBUTE_KEY = 'groups';\n\n/**\n * @enum {string}\n */\nShuffle.EventType = {\n LAYOUT: 'shuffle:layout',\n REMOVED: 'shuffle:removed'\n};\n\n/** @enum {string} */\nShuffle.Classes = __WEBPACK_IMPORTED_MODULE_8__classes__[\"a\" /* default */];\n\n// Overrideable options\nShuffle.options = {\n // Initial filter group.\n group: Shuffle.ALL_ITEMS,\n\n // Transition/animation speed (milliseconds).\n speed: 250,\n\n // CSS easing function to use.\n easing: 'ease',\n\n // e.g. '.picture-item'.\n itemSelector: '*',\n\n // Element or selector string. Use an element to determine the size of columns\n // and gutters.\n sizer: null,\n\n // A static number or function that tells the plugin how wide the gutters\n // between columns are (in pixels).\n gutterWidth: 0,\n\n // A static number or function that returns a number which tells the plugin\n // how wide the columns are (in pixels).\n columnWidth: 0,\n\n // If your group is not json, and is comma delimeted, you could set delimeter\n // to ','.\n delimeter: null,\n\n // Useful for percentage based heights when they might not always be exactly\n // the same (in pixels).\n buffer: 0,\n\n // Reading the width of elements isn't precise enough and can cause columns to\n // jump between values.\n columnThreshold: 0.01,\n\n // Shuffle can be isInitialized with a sort object. It is the same object\n // given to the sort method.\n initialSort: null,\n\n // By default, shuffle will throttle resize events. This can be changed or\n // removed.\n throttle: __WEBPACK_IMPORTED_MODULE_4_throttleit___default.a,\n\n // How often shuffle can be called on resize (in milliseconds).\n throttleTime: 300,\n\n // Transition delay offset for each item in milliseconds.\n staggerAmount: 15,\n\n // Maximum stagger delay in milliseconds.\n staggerAmountMax: 250,\n\n // Whether to use transforms or absolute positioning.\n useTransforms: true\n};\n\n// Expose for testing. Hack at your own risk.\nShuffle.__Point = __WEBPACK_IMPORTED_MODULE_6__point__[\"a\" /* default */];\nShuffle.__sorter = __WEBPACK_IMPORTED_MODULE_10__sorter__[\"a\" /* default */];\nShuffle.__getColumnSpan = __WEBPACK_IMPORTED_MODULE_12__layout__[\"b\" /* getColumnSpan */];\nShuffle.__getAvailablePositions = __WEBPACK_IMPORTED_MODULE_12__layout__[\"c\" /* getAvailablePositions */];\nShuffle.__getShortColumn = __WEBPACK_IMPORTED_MODULE_12__layout__[\"d\" /* getShortColumn */];\n\n/* harmony default export */ __webpack_exports__[\"default\"] = Shuffle;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\nmodule.exports = function parallel(fns, context, callback) {\n if (!callback) {\n if (typeof context === 'function') {\n callback = context\n context = null\n } else {\n callback = noop\n }\n }\n\n var pending = fns && fns.length\n if (!pending) return callback(null, []);\n\n var finished = false\n var results = new Array(pending)\n\n fns.forEach(context ? function (fn, i) {\n fn.call(context, maybeDone(i))\n } : function (fn, i) {\n fn(maybeDone(i))\n })\n\n function maybeDone(i) {\n return function (err, result) {\n if (finished) return;\n\n if (err) {\n callback(err, results)\n finished = true\n return\n }\n\n results[i] = result\n\n if (!--pending) callback(null, results);\n }\n }\n}\n\nfunction noop() {}\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global) {\n\n// there's 3 implementations written in increasing order of efficiency\n\n// 1 - no Set type is defined\nfunction uniqNoSet(arr) {\n\tvar ret = [];\n\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (ret.indexOf(arr[i]) === -1) {\n\t\t\tret.push(arr[i]);\n\t\t}\n\t}\n\n\treturn ret;\n}\n\n// 2 - a simple Set type is defined\nfunction uniqSet(arr) {\n\tvar seen = new Set();\n\treturn arr.filter(function (el) {\n\t\tif (!seen.has(el)) {\n\t\t\tseen.add(el);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t});\n}\n\n// 3 - a standard Set type is defined and it has a forEach method\nfunction uniqSetWithForEach(arr) {\n\tvar ret = [];\n\n\t(new Set(arr)).forEach(function (el) {\n\t\tret.push(el);\n\t});\n\n\treturn ret;\n}\n\n// V8 currently has a broken implementation\n// https://github.com/joyent/node/issues/8449\nfunction doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}\n\nif ('Set' in global) {\n\tif (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) {\n\t\tmodule.exports = uniqSetWithForEach;\n\t} else {\n\t\tmodule.exports = uniqSet;\n\t}\n} else {\n\tmodule.exports = uniqNoSet;\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\nvar element = document.body || document.documentElement;\nvar e = document.createElement('div');\ne.style.cssText = 'width:10px;padding:2px;box-sizing:border-box;';\nelement.appendChild(e);\n\nvar width = window.getComputedStyle(e, null).width;\nvar ret = width === '10px';\n\nelement.removeChild(e);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = ret;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__get_number__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__computed_size__ = __webpack_require__(7);\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = getNumberStyle;\n\n\n\n\n\n/**\n * Retrieve the computed style for an element, parsed as a float.\n * @param {Element} element Element to get style for.\n * @param {string} style Style property.\n * @param {CSSStyleDeclaration} [styles] Optionally include clean styles to\n * use instead of asking for them again.\n * @return {number} The parsed computed value or zero if that fails because IE\n * will return 'auto' when the element doesn't have margins instead of\n * the computed style.\n */\nfunction getNumberStyle(element, style) {\n var styles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window.getComputedStyle(element, null);\n\n var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(styles[style]);\n\n // Support IE<=11 and W3C spec.\n if (!__WEBPACK_IMPORTED_MODULE_1__computed_size__[\"a\" /* default */] && style === 'width') {\n value += __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(styles.paddingLeft) + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(styles.paddingRight) + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(styles.borderLeftWidth) + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(styles.borderRightWidth);\n } else if (!__WEBPACK_IMPORTED_MODULE_1__computed_size__[\"a\" /* default */] && style === 'height') {\n value += __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(styles.paddingTop) + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(styles.paddingBottom) + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(styles.borderTopWidth) + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__get_number__[\"a\" /* default */])(styles.borderBottomWidth);\n }\n\n return value;\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__point__ = __webpack_require__(0);\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = getItemPosition;\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = getColumnSpan;\n/* harmony export (immutable) */ __webpack_exports__[\"c\"] = getAvailablePositions;\n/* harmony export (immutable) */ __webpack_exports__[\"d\"] = getShortColumn;\n\n\n\n\nfunction arrayMax(array) {\n return Math.max.apply(Math, array);\n}\n\nfunction arrayMin(array) {\n return Math.min.apply(Math, array);\n}\n\n/**\n * Determine the location of the next item, based on its size.\n * @param {Object} itemSize Object with width and height.\n * @param {Array.<number>} positions Positions of the other current items.\n * @param {number} gridSize The column width or row height.\n * @param {number} total The total number of columns or rows.\n * @param {number} threshold Buffer value for the column to fit.\n * @param {number} buffer Vertical buffer for the height of items.\n * @return {Point}\n */\nfunction getItemPosition(_ref) {\n var itemSize = _ref.itemSize,\n positions = _ref.positions,\n gridSize = _ref.gridSize,\n total = _ref.total,\n threshold = _ref.threshold,\n buffer = _ref.buffer;\n\n var span = getColumnSpan(itemSize.width, gridSize, total, threshold);\n var setY = getAvailablePositions(positions, span, total);\n var shortColumnIndex = getShortColumn(setY, buffer);\n\n // Position the item\n var point = new __WEBPACK_IMPORTED_MODULE_0__point__[\"a\" /* default */](Math.round(gridSize * shortColumnIndex), Math.round(setY[shortColumnIndex]));\n\n // Update the columns array with the new values for each column.\n // e.g. before the update the columns could be [250, 0, 0, 0] for an item\n // which spans 2 columns. After it would be [250, itemHeight, itemHeight, 0].\n var setHeight = setY[shortColumnIndex] + itemSize.height;\n for (var i = 0; i < span; i++) {\n positions[shortColumnIndex + i] = setHeight;\n }\n\n return point;\n}\n\n/**\n * Determine the number of columns an items spans.\n * @param {number} itemWidth Width of the item.\n * @param {number} columnWidth Width of the column (includes gutter).\n * @param {number} columns Total number of columns\n * @param {number} threshold A buffer value for the size of the column to fit.\n * @return {number}\n */\nfunction getColumnSpan(itemWidth, columnWidth, columns, threshold) {\n var columnSpan = itemWidth / columnWidth;\n\n // If the difference between the rounded column span number and the\n // calculated column span number is really small, round the number to\n // make it fit.\n if (Math.abs(Math.round(columnSpan) - columnSpan) < threshold) {\n // e.g. columnSpan = 4.0089945390298745\n columnSpan = Math.round(columnSpan);\n }\n\n // Ensure the column span is not more than the amount of columns in the whole layout.\n return Math.min(Math.ceil(columnSpan), columns);\n}\n\n/**\n * Retrieves the column set to use for placement.\n * @param {number} columnSpan The number of columns this current item spans.\n * @param {number} columns The total columns in the grid.\n * @return {Array.<number>} An array of numbers represeting the column set.\n */\nfunction getAvailablePositions(positions, columnSpan, columns) {\n // The item spans only one column.\n if (columnSpan === 1) {\n return positions;\n }\n\n // The item spans more than one column, figure out how many different\n // places it could fit horizontally.\n // The group count is the number of places within the positions this block\n // could fit, ignoring the current positions of items.\n // Imagine a 2 column brick as the second item in a 4 column grid with\n // 10px height each. Find the places it would fit:\n // [20, 10, 10, 0]\n // | | |\n // * * *\n //\n // Then take the places which fit and get the bigger of the two:\n // max([20, 10]), max([10, 10]), max([10, 0]) = [20, 10, 0]\n //\n // Next, find the first smallest number (the short column).\n // [20, 10, 0]\n // |\n // *\n //\n // And that's where it should be placed!\n //\n // Another example where the second column's item extends past the first:\n // [10, 20, 10, 0] => [20, 20, 10] => 10\n var available = [];\n\n // For how many possible positions for this item there are.\n for (var i = 0; i <= columns - columnSpan; i++) {\n // Find the bigger value for each place it could fit.\n available.push(arrayMax(positions.slice(i, i + columnSpan)));\n }\n\n return available;\n}\n\n/**\n * Find index of short column, the first from the left where this item will go.\n *\n * @param {Array.<number>} positions The array to search for the smallest number.\n * @param {number} buffer Optional buffer which is very useful when the height\n * is a percentage of the width.\n * @return {number} Index of the short column.\n */\nfunction getShortColumn(positions, buffer) {\n var minPosition = arrayMin(positions);\n for (var i = 0, len = positions.length; i < len; i++) {\n if (positions[i] >= minPosition - buffer && positions[i] <= minPosition + buffer) {\n return i;\n }\n }\n\n return 0;\n}\n\n/***/ }),\n/* 10 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = onTransitionEnd;\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = cancelTransitionEnd;\n\n\nvar transitions = {};\nvar eventName = 'transitionend';\nvar count = 0;\n\nfunction uniqueId() {\n return eventName + count++;\n}\n\nfunction onTransitionEnd(element, callback) {\n var id = uniqueId();\n var listener = function listener(evt) {\n if (evt.currentTarget === evt.target) {\n cancelTransitionEnd(id);\n callback(evt);\n }\n };\n\n element.addEventListener(eventName, listener);\n\n transitions[id] = { element: element, listener: listener };\n\n return id;\n}\n\nfunction cancelTransitionEnd(id) {\n if (transitions[id]) {\n transitions[id].element.removeEventListener(eventName, transitions[id].listener);\n transitions[id] = null;\n return true;\n }\n\n return false;\n}\n\n/***/ }),\n/* 11 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__point__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__classes__ = __webpack_require__(1);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\nvar id = 0;\n\nvar ShuffleItem = function () {\n function ShuffleItem(element) {\n _classCallCheck(this, ShuffleItem);\n\n this.id = id++;\n this.element = element;\n this.isVisible = true;\n }\n\n _createClass(ShuffleItem, [{\n key: 'show',\n value: function show() {\n this.isVisible = true;\n this.element.classList.remove(__WEBPACK_IMPORTED_MODULE_1__classes__[\"a\" /* default */].HIDDEN);\n this.element.classList.add(__WEBPACK_IMPORTED_MODULE_1__classes__[\"a\" /* default */].VISIBLE);\n }\n }, {\n key: 'hide',\n value: function hide() {\n this.isVisible = false;\n this.element.classList.remove(__WEBPACK_IMPORTED_MODULE_1__classes__[\"a\" /* default */].VISIBLE);\n this.element.classList.add(__WEBPACK_IMPORTED_MODULE_1__classes__[\"a\" /* default */].HIDDEN);\n }\n }, {\n key: 'init',\n value: function init() {\n this.addClasses([__WEBPACK_IMPORTED_MODULE_1__classes__[\"a\" /* default */].SHUFFLE_ITEM, __WEBPACK_IMPORTED_MODULE_1__classes__[\"a\" /* default */].VISIBLE]);\n this.applyCss(ShuffleItem.Css.INITIAL);\n this.scale = ShuffleItem.Scale.VISIBLE;\n this.point = new __WEBPACK_IMPORTED_MODULE_0__point__[\"a\" /* default */]();\n }\n }, {\n key: 'addClasses',\n value: function addClasses(classes) {\n var _this = this;\n\n classes.forEach(function (className) {\n _this.element.classList.add(className);\n });\n }\n }, {\n key: 'removeClasses',\n value: function removeClasses(classes) {\n var _this2 = this;\n\n classes.forEach(function (className) {\n _this2.element.classList.remove(className);\n });\n }\n }, {\n key: 'applyCss',\n value: function applyCss(obj) {\n for (var key in obj) {\n this.element.style[key] = obj[key];\n }\n }\n }, {\n key: 'dispose',\n value: function dispose() {\n this.removeClasses([__WEBPACK_IMPORTED_MODULE_1__classes__[\"a\" /* default */].HIDDEN, __WEBPACK_IMPORTED_MODULE_1__classes__[\"a\" /* default */].VISIBLE, __WEBPACK_IMPORTED_MODULE_1__classes__[\"a\" /* default */].SHUFFLE_ITEM]);\n\n this.element.removeAttribute('style');\n this.element = null;\n }\n }]);\n\n return ShuffleItem;\n}();\n\nShuffleItem.Css = {\n INITIAL: {\n position: 'absolute',\n top: 0,\n left: 0,\n visibility: 'visible',\n 'will-change': 'transform'\n },\n VISIBLE: {\n before: {\n opacity: 1,\n visibility: 'visible'\n },\n after: {}\n },\n HIDDEN: {\n before: {\n opacity: 0\n },\n after: {\n visibility: 'hidden'\n }\n }\n};\n\nShuffleItem.Scale = {\n VISIBLE: 1,\n HIDDEN: 0.001\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = ShuffleItem;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_xtend__ = __webpack_require__(3);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_xtend___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_xtend__);\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = sorter;\n\n\n\n\n// http://stackoverflow.com/a/962890/373422\nfunction randomize(array) {\n var tmp;\n var current;\n var top = array.length;\n\n if (!top) {\n return array;\n }\n\n while (--top) {\n current = Math.floor(Math.random() * (top + 1));\n tmp = array[current];\n array[current] = array[top];\n array[top] = tmp;\n }\n\n return array;\n}\n\nvar defaults = {\n // Use array.reverse() to reverse the results\n reverse: false,\n\n // Sorting function\n by: null,\n\n // If true, this will skip the sorting and return a randomized order in the array\n randomize: false,\n\n // Determines which property of each item in the array is passed to the\n // sorting method.\n key: 'element'\n};\n\n// You can return `undefined` from the `by` function to revert to DOM order.\nfunction sorter(arr, options) {\n var opts = __WEBPACK_IMPORTED_MODULE_0_xtend___default()(defaults, options);\n var original = [].slice.call(arr);\n var revert = false;\n\n if (!arr.length) {\n return [];\n }\n\n if (opts.randomize) {\n return randomize(arr);\n }\n\n // Sort the elements by the opts.by function.\n // If we don't have opts.by, default to DOM order\n if (typeof opts.by === 'function') {\n arr.sort(function (a, b) {\n\n // Exit early if we already know we want to revert\n if (revert) {\n return 0;\n }\n\n var valA = opts.by(a[opts.key]);\n var valB = opts.by(b[opts.key]);\n\n // If both values are undefined, use the DOM order\n if (valA === undefined && valB === undefined) {\n revert = true;\n return 0;\n }\n\n if (valA < valB || valA === 'sortFirst' || valB === 'sortLast') {\n return -1;\n }\n\n if (valA > valB || valA === 'sortLast' || valB === 'sortFirst') {\n return 1;\n }\n\n return 0;\n });\n }\n\n // Revert to the original array if necessary\n if (revert) {\n return original;\n }\n\n if (opts.reverse) {\n arr.reverse();\n }\n\n return arr;\n}\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n// Polyfill for creating CustomEvents on IE9/10/11\n\n// code pulled from:\n// https://github.com/d4tocchini/customevent-polyfill\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill\n\ntry {\n var ce = new window.CustomEvent('test');\n ce.preventDefault();\n if (ce.defaultPrevented !== true) {\n // IE has problems with .preventDefault() on custom events\n // http://stackoverflow.com/questions/23349191\n throw new Error('Could not prevent default');\n }\n} catch(e) {\n var CustomEvent = function(event, params) {\n var evt, origPrevent;\n params = params || {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n\n evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n origPrevent = evt.preventDefault;\n evt.preventDefault = function () {\n origPrevent.call(this);\n try {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function () {\n return true;\n }\n });\n } catch(e) {\n this.defaultPrevented = true;\n }\n };\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n window.CustomEvent = CustomEvent; // expose definition to window\n}\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar proto = Element.prototype;\nvar vendor = proto.matches\n || proto.matchesSelector\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector\n || proto.oMatchesSelector;\n\nmodule.exports = match;\n\n/**\n * Match `el` to `selector`.\n *\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n * @api public\n */\n\nfunction match(el, selector) {\n if (vendor) return vendor.call(el, selector);\n var nodes = el.parentNode.querySelectorAll(selector);\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i] == el) return true;\n }\n return false;\n}\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\nmodule.exports = throttle;\n\n/**\n * Returns a new function that, when invoked, invokes `func` at most once per `wait` milliseconds.\n *\n * @param {Function} func Function to wrap.\n * @param {Number} wait Number of milliseconds that must elapse between `func` invocations.\n * @return {Function} A new function that wraps the `func` function passed in.\n */\n\nfunction throttle (func, wait) {\n var ctx, args, rtn, timeoutID; // caching\n var last = 0;\n\n return function throttled () {\n ctx = this;\n args = arguments;\n var delta = new Date() - last;\n if (!timeoutID)\n if (delta >= wait) call();\n else timeoutID = setTimeout(call, wait - delta);\n return rtn;\n };\n\n function call () {\n timeoutID = 0;\n last = +new Date();\n rtn = func.apply(ctx, args);\n ctx = null;\n args = null;\n }\n}\n\n\n/***/ }),\n/* 16 */\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/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(4).default;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// shuffle.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\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// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\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 = 17);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 35a3cfe3322ce6f556df","'use strict';\n\nimport getNumber from './get-number';\n\n/**\n * Represents a coordinate pair.\n * @param {number} [x=0] X.\n * @param {number} [y=0] Y.\n */\nconst Point = function (x, y) {\n this.x = getNumber(x);\n this.y = getNumber(y);\n};\n\n/**\n * Whether two points are equal.\n * @param {Point} a Point A.\n * @param {Point} b Point B.\n * @return {boolean}\n */\nPoint.equals = function (a, b) {\n return a.x === b.x && a.y === b.y;\n};\n\nexport default Point;\n\n\n\n// WEBPACK FOOTER //\n// ./src/point.js","export default {\n BASE: 'shuffle',\n SHUFFLE_ITEM: 'shuffle-item',\n VISIBLE: 'shuffle-item--visible',\n HIDDEN: 'shuffle-item--hidden',\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/classes.js","'use strict';\n\n/**\n * Always returns a numeric value, given a value. Logic from jQuery's `isNumeric`.\n * @param {*} value Possibly numeric value.\n * @return {number} `value` or zero if `value` isn't numeric.\n */\nexport default function getNumber(value) {\n return parseFloat(value) || 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/get-number.js","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/xtend/immutable.js\n// module id = 3\n// module chunks = 0","'use strict';\n\nimport 'custom-event-polyfill';\nimport matches from 'matches-selector';\nimport arrayUnique from 'array-uniq';\nimport xtend from 'xtend';\nimport throttle from 'throttleit';\nimport parallel from 'array-parallel';\nimport Point from './point';\nimport ShuffleItem from './shuffle-item';\nimport Classes from './classes';\nimport getNumberStyle from './get-number-style';\nimport sorter from './sorter';\nimport { onTransitionEnd, cancelTransitionEnd } from './on-transition-end';\nimport { getItemPosition, getColumnSpan, getAvailablePositions, getShortColumn } from './layout';\n\nfunction toArray(arrayLike) {\n return Array.prototype.slice.call(arrayLike);\n}\n\nfunction arrayMax(array) {\n return Math.max.apply(Math, array);\n}\n\nfunction arrayIncludes(array, obj) {\n if (arguments.length === 2) {\n return arrayIncludes(array)(obj);\n }\n\n return function (obj) {\n return array.indexOf(obj) > -1;\n };\n}\n\n// Used for unique instance variables\nlet id = 0;\n\nclass Shuffle {\n\n /**\n * Categorize, sort, and filter a responsive grid of items.\n *\n * @param {Element} element An element which is the parent container for the grid items.\n * @param {Object} [options=Shuffle.options] Options object.\n * @constructor\n */\n constructor(element, options = {}) {\n this.options = xtend(Shuffle.options, options);\n\n this.useSizer = false;\n this.lastSort = {};\n this.group = this.lastFilter = Shuffle.ALL_ITEMS;\n this.isEnabled = true;\n this.isDestroyed = false;\n this.isInitialized = false;\n this._transitions = [];\n this.isTransitioning = false;\n this._queue = [];\n\n element = this._getElementOption(element);\n\n if (!element) {\n throw new TypeError('Shuffle needs to be initialized with an element.');\n }\n\n this.element = element;\n this.id = 'shuffle_' + id++;\n\n this._init();\n this.isInitialized = true;\n }\n\n _init() {\n this.items = this._getItems();\n\n this.options.sizer = this._getElementOption(this.options.sizer);\n\n if (this.options.sizer) {\n this.useSizer = true;\n }\n\n // Add class and invalidate styles\n this.element.classList.add(Shuffle.Classes.BASE);\n\n // Set initial css for each item\n this._initItems();\n\n // Bind resize events\n this._onResize = this._getResizeFunction();\n window.addEventListener('resize', this._onResize);\n\n // Get container css all in one request. Causes reflow\n var containerCss = window.getComputedStyle(this.element, null);\n var containerWidth = Shuffle.getSize(this.element).width;\n\n // Add styles to the container if it doesn't have them.\n this._validateStyles(containerCss);\n\n // We already got the container's width above, no need to cause another\n // reflow getting it again... Calculate the number of columns there will be\n this._setColumns(containerWidth);\n\n // Kick off!\n this.filter(this.options.group, this.options.initialSort);\n\n // The shuffle items haven't had transitions set on them yet so the user\n // doesn't see the first layout. Set them now that the first layout is done.\n // First, however, a synchronous layout must be caused for the previous\n // styles to be applied without transitions.\n this.element.offsetWidth; // jshint ignore: line\n this._setTransitions();\n this.element.style.transition = 'height ' + this.options.speed + 'ms ' + this.options.easing;\n }\n\n /**\n * Returns a throttled and proxied function for the resize handler.\n * @return {Function}\n * @private\n */\n _getResizeFunction() {\n var resizeFunction = this._handleResize.bind(this);\n return this.options.throttle ?\n this.options.throttle(resizeFunction, this.options.throttleTime) :\n resizeFunction;\n }\n\n /**\n * Retrieve an element from an option.\n * @param {string|jQuery|Element} option The option to check.\n * @return {?Element} The plain element or null.\n * @private\n */\n _getElementOption(option) {\n // If column width is a string, treat is as a selector and search for the\n // sizer element within the outermost container\n if (typeof option === 'string') {\n return this.element.querySelector(option);\n\n // Check for an element\n } else if (option && option.nodeType && option.nodeType === 1) {\n return option;\n\n // Check for jQuery object\n } else if (option && option.jquery) {\n return option[0];\n }\n\n return null;\n }\n\n /**\n * Ensures the shuffle container has the css styles it needs applied to it.\n * @param {Object} styles Key value pairs for position and overflow.\n * @private\n */\n _validateStyles(styles) {\n // Position cannot be static.\n if (styles.position === 'static') {\n this.element.style.position = 'relative';\n }\n\n // Overflow has to be hidden.\n if (styles.overflow !== 'hidden') {\n this.element.style.overflow = 'hidden';\n }\n }\n\n /**\n * Filter the elements by a category.\n * @param {string} [category] Category to filter by. If it's given, the last\n * category will be used to filter the items.\n * @param {Array} [collection] Optionally filter a collection. Defaults to\n * all the items.\n * @return {!{visible: Array, hidden: Array}}\n * @private\n */\n _filter(category = this.lastFilter, collection = this.items) {\n var set = this._getFilteredSets(category, collection);\n\n // Individually add/remove hidden/visible classes\n this._toggleFilterClasses(set);\n\n // Save the last filter in case elements are appended.\n this.lastFilter = category;\n\n // This is saved mainly because providing a filter function (like searching)\n // will overwrite the `lastFilter` property every time its called.\n if (typeof category === 'string') {\n this.group = category;\n }\n\n return set;\n }\n\n /**\n * Returns an object containing the visible and hidden elements.\n * @param {string|Function} category Category or function to filter by.\n * @param {Array.<Element>} items A collection of items to filter.\n * @return {!{visible: Array, hidden: Array}}\n * @private\n */\n _getFilteredSets(category, items) {\n let visible = [];\n let hidden = [];\n\n // category === 'all', add visible class to everything\n if (category === Shuffle.ALL_ITEMS) {\n visible = items;\n\n // Loop through each item and use provided function to determine\n // whether to hide it or not.\n } else {\n items.forEach((item) => {\n if (this._doesPassFilter(category, item.element)) {\n visible.push(item);\n } else {\n hidden.push(item);\n }\n });\n }\n\n return {\n visible,\n hidden,\n };\n }\n\n /**\n * Test an item to see if it passes a category.\n * @param {string|Function} category Category or function to filter by.\n * @param {Element} element An element to test.\n * @return {boolean} Whether it passes the category/filter.\n * @private\n */\n _doesPassFilter(category, element) {\n\n if (typeof category === 'function') {\n return category.call(element, element, this);\n\n // Check each element's data-groups attribute against the given category.\n } else {\n let attr = element.getAttribute('data-' + Shuffle.FILTER_ATTRIBUTE_KEY);\n let keys = this.options.delimeter ?\n attr.split(this.options.delimeter) :\n JSON.parse(attr);\n\n if (Array.isArray(category)) {\n return category.some(arrayIncludes(keys));\n }\n\n return arrayIncludes(keys, category);\n }\n }\n\n /**\n * Toggles the visible and hidden class names.\n * @param {{visible, hidden}} Object with visible and hidden arrays.\n * @private\n */\n _toggleFilterClasses({ visible, hidden }) {\n visible.forEach((item) => {\n item.show();\n });\n\n hidden.forEach((item) => {\n item.hide();\n });\n }\n\n /**\n * Set the initial css for each item\n * @param {Array.<ShuffleItem>} [items] Optionally specifiy at set to initialize.\n * @private\n */\n _initItems(items = this.items) {\n items.forEach((item) => {\n item.init();\n });\n }\n\n /**\n * Remove element reference and styles.\n * @private\n */\n _disposeItems(items = this.items) {\n items.forEach((item) => {\n item.dispose();\n });\n }\n\n /**\n * Updates the visible item count.\n * @private\n */\n _updateItemCount() {\n this.visibleItems = this._getFilteredItems().length;\n }\n\n /**\n * Sets css transform transition on a group of elements. This is not executed\n * at the same time as `item.init` so that transitions don't occur upon\n * initialization of Shuffle.\n * @param {Array.<ShuffleItem>} items Shuffle items to set transitions on.\n * @private\n */\n _setTransitions(items = this.items) {\n let speed = this.options.speed;\n let easing = this.options.easing;\n\n var str;\n if (this.options.useTransforms) {\n str = 'transform ' + speed + 'ms ' + easing +\n ', opacity ' + speed + 'ms ' + easing;\n } else {\n str = 'top ' + speed + 'ms ' + easing +\n ', left ' + speed + 'ms ' + easing +\n ', opacity ' + speed + 'ms ' + easing;\n }\n\n items.forEach((item) => {\n item.element.style.transition = str;\n });\n }\n\n _getItems() {\n return toArray(this.element.children)\n .filter(el => matches(el, this.options.itemSelector))\n .map(el => new ShuffleItem(el));\n }\n\n /**\n * When new elements are added to the shuffle container, update the array of\n * items because that is the order `_layout` calls them.\n */\n _updateItemsOrder() {\n let children = this.element.children;\n this.items = sorter(this.items, {\n by(element) {\n return Array.prototype.indexOf.call(children, element);\n },\n });\n }\n\n _getFilteredItems() {\n return this.items.filter(item => item.isVisible);\n }\n\n _getConcealedItems() {\n return this.items.filter(item => !item.isVisible);\n }\n\n /**\n * Returns the column size, based on column width and sizer options.\n * @param {number} containerWidth Size of the parent container.\n * @param {number} gutterSize Size of the gutters.\n * @return {number}\n * @private\n */\n _getColumnSize(containerWidth, gutterSize) {\n var size;\n\n // If the columnWidth property is a function, then the grid is fluid\n if (typeof this.options.columnWidth === 'function') {\n size = this.options.columnWidth(containerWidth);\n\n // columnWidth option isn't a function, are they using a sizing element?\n } else if (this.useSizer) {\n size = Shuffle.getSize(this.options.sizer).width;\n\n // if not, how about the explicitly set option?\n } else if (this.options.columnWidth) {\n size = this.options.columnWidth;\n\n // or use the size of the first item\n } else if (this.items.length > 0) {\n size = Shuffle.getSize(this.items[0].element, true).width;\n\n // if there's no items, use size of container\n } else {\n size = containerWidth;\n }\n\n // Don't let them set a column width of zero.\n if (size === 0) {\n size = containerWidth;\n }\n\n return size + gutterSize;\n }\n\n /**\n * Returns the gutter size, based on gutter width and sizer options.\n * @param {number} containerWidth Size of the parent container.\n * @return {number}\n * @private\n */\n _getGutterSize(containerWidth) {\n var size;\n if (typeof this.options.gutterWidth === 'function') {\n size = this.options.gutterWidth(containerWidth);\n } else if (this.useSizer) {\n size = getNumberStyle(this.options.sizer, 'marginLeft');\n } else {\n size = this.options.gutterWidth;\n }\n\n return size;\n }\n\n /**\n * Calculate the number of columns to be used. Gets css if using sizer element.\n * @param {number} [containerWidth] Optionally specify a container width if\n * it's already available.\n */\n _setColumns(containerWidth = Shuffle.getSize(this.element).width) {\n var gutter = this._getGutterSize(containerWidth);\n var columnWidth = this._getColumnSize(containerWidth, gutter);\n var calculatedColumns = (containerWidth + gutter) / columnWidth;\n\n // Widths given from getStyles are not precise enough...\n if (Math.abs(Math.round(calculatedColumns) - calculatedColumns) <\n this.options.columnThreshold) {\n // e.g. calculatedColumns = 11.998876\n calculatedColumns = Math.round(calculatedColumns);\n }\n\n this.cols = Math.max(Math.floor(calculatedColumns), 1);\n this.containerWidth = containerWidth;\n this.colWidth = columnWidth;\n }\n\n /**\n * Adjust the height of the grid\n */\n _setContainerSize() {\n this.element.style.height = this._getContainerSize() + 'px';\n }\n\n /**\n * Based on the column heights, it returns the biggest one.\n * @return {number}\n * @private\n */\n _getContainerSize() {\n return arrayMax(this.positions);\n }\n\n /**\n * Get the clamped stagger amount.\n * @param {number} index Index of the item to be staggered.\n * @return {number}\n */\n _getStaggerAmount(index) {\n return Math.min(index * this.options.staggerAmount, this.options.staggerAmountMax);\n }\n\n /**\n * @return {boolean} Whether the event was prevented or not.\n */\n _dispatch(name, details = {}) {\n if (this.isDestroyed) {\n return;\n }\n\n details.shuffle = this;\n return !this.element.dispatchEvent(new CustomEvent(name, {\n bubbles: true,\n cancelable: false,\n detail: details,\n }));\n }\n\n /**\n * Zeros out the y columns array, which is used to determine item placement.\n * @private\n */\n _resetCols() {\n var i = this.cols;\n this.positions = [];\n while (i--) {\n this.positions.push(0);\n }\n }\n\n /**\n * Loops through each item that should be shown and calculates the x, y position.\n * @param {Array.<ShuffleItem>} items Array of items that will be shown/layed\n * out in order in their array.\n */\n _layout(items) {\n let count = 0;\n items.forEach((item) => {\n var currPos = item.point;\n var currScale = item.scale;\n var itemSize = Shuffle.getSize(item.element, true);\n var pos = this._getItemPosition(itemSize);\n\n function callback() {\n item.element.style.transitionDelay = '';\n item.applyCss(ShuffleItem.Css.VISIBLE.after);\n }\n\n // If the item will not change its position, do not add it to the render\n // queue. Transitions don't fire when setting a property to the same value.\n if (Point.equals(currPos, pos) && currScale === ShuffleItem.Scale.VISIBLE) {\n item.applyCss(ShuffleItem.Css.VISIBLE.before);\n callback();\n return;\n }\n\n item.point = pos;\n item.scale = ShuffleItem.Scale.VISIBLE;\n\n // Use xtend here to clone the object so that the `before` object isn't\n // modified when the transition delay is added.\n let styles = xtend(ShuffleItem.Css.VISIBLE.before);\n styles.transitionDelay = this._getStaggerAmount(count) + 'ms';\n\n this._queue.push({\n item,\n styles,\n callback,\n });\n\n count++;\n });\n }\n\n /**\n * Determine the location of the next item, based on its size.\n * @param {{width: number, height: number}} itemSize Object with width and height.\n * @return {Point}\n * @private\n */\n _getItemPosition(itemSize) {\n return getItemPosition({\n itemSize,\n positions: this.positions,\n gridSize: this.colWidth,\n total: this.cols,\n threshold: this.options.columnThreshold,\n buffer: this.options.buffer,\n });\n }\n\n /**\n * Hides the elements that don't match our filter.\n * @param {Array.<ShuffleItem>} collection Collection to shrink.\n * @private\n */\n _shrink(collection = this._getConcealedItems()) {\n let count = 0;\n collection.forEach((item) => {\n function callback() {\n item.applyCss(ShuffleItem.Css.HIDDEN.after);\n }\n\n // Continuing would add a transitionend event listener to the element, but\n // that listener would not execute because the transform and opacity would\n // stay the same.\n // The callback is executed here because it is not guaranteed to be called\n // after the transitionend event because the transitionend could be\n // canceled if another animation starts.\n if (item.scale === ShuffleItem.Scale.HIDDEN) {\n item.applyCss(ShuffleItem.Css.HIDDEN.before);\n callback();\n return;\n }\n\n item.scale = ShuffleItem.Scale.HIDDEN;\n\n let styles = xtend(ShuffleItem.Css.HIDDEN.before);\n styles.transitionDelay = this._getStaggerAmount(count) + 'ms';\n\n this._queue.push({\n item,\n styles,\n callback,\n });\n\n count++;\n });\n }\n\n /**\n * Resize handler.\n * @private\n */\n _handleResize() {\n // If shuffle is disabled, destroyed, don't do anything\n if (!this.isEnabled || this.isDestroyed) {\n return;\n }\n\n // Will need to check height in the future if it's layed out horizontaly\n var containerWidth = Shuffle.getSize(this.element).width;\n\n // containerWidth hasn't changed, don't do anything\n if (containerWidth === this.containerWidth) {\n return;\n }\n\n this.update();\n }\n\n /**\n * Returns styles which will be applied to the an item for a transition.\n * @param {Object} obj Transition options.\n * @return {!Object} Transforms for transitions, left/top for animate.\n * @private\n */\n _getStylesForTransition({ item, styles }) {\n if (!styles.transitionDelay) {\n styles.transitionDelay = '0ms';\n }\n\n let x = item.point.x;\n let y = item.point.y;\n\n if (this.options.useTransforms) {\n styles.transform = `translate(${x}px, ${y}px) scale(${item.scale})`;\n } else {\n styles.left = x + 'px';\n styles.top = y + 'px';\n }\n\n return styles;\n }\n\n /**\n * Listen for the transition end on an element and execute the itemCallback\n * when it finishes.\n * @param {Element} element Element to listen on.\n * @param {Function} itemCallback Callback for the item.\n * @param {Function} done Callback to notify `parallel` that this one is done.\n */\n _whenTransitionDone(element, itemCallback, done) {\n let id = onTransitionEnd(element, (evt) => {\n itemCallback();\n done(null, evt);\n });\n\n this._transitions.push(id);\n }\n\n /**\n * Return a function which will set CSS styles and call the `done` function\n * when (if) the transition finishes.\n * @param {Object} opts Transition object.\n * @return {Function} A function to be called with a `done` function.\n */\n _getTransitionFunction(opts) {\n return (done) => {\n opts.item.applyCss(this._getStylesForTransition(opts));\n this._whenTransitionDone(opts.item.element, opts.callback, done);\n };\n }\n\n /**\n * Execute the styles gathered in the style queue. This applies styles to elements,\n * triggering transitions.\n * @private\n */\n _processQueue() {\n if (this.isTransitioning) {\n this._cancelMovement();\n }\n\n let hasSpeed = this.options.speed > 0;\n let hasQueue = this._queue.length > 0;\n\n if (hasQueue && hasSpeed && this.isInitialized) {\n this._startTransitions(this._queue);\n\n } else if (hasQueue) {\n this._styleImmediately(this._queue);\n this._dispatchLayout();\n\n // A call to layout happened, but none of the newly visible items will\n // change position or the transition duration is zero, which will not trigger\n // the transitionend event.\n } else {\n this._dispatchLayout();\n }\n\n // Remove everything in the style queue\n this._queue.length = 0;\n }\n\n /**\n * Wait for each transition to finish, the emit the layout event.\n * @param {Array.<Object>} transitions Array of transition objects.\n */\n _startTransitions(transitions) {\n // Set flag that shuffle is currently in motion.\n this.isTransitioning = true;\n\n // Create an array of functions to be called.\n let callbacks = transitions.map(obj => this._getTransitionFunction(obj));\n\n parallel(callbacks, this._movementFinished.bind(this));\n }\n\n _cancelMovement() {\n // Remove the transition end event for each listener.\n this._transitions.forEach(cancelTransitionEnd);\n\n // Reset the array.\n this._transitions.length = 0;\n\n // Show it's no longer active.\n this.isTransitioning = false;\n }\n\n /**\n * Apply styles without a transition.\n * @param {Array.<Object>} objects Array of transition objects.\n * @private\n */\n _styleImmediately(objects) {\n if (objects.length) {\n let elements = objects.map(obj => obj.item.element);\n\n Shuffle._skipTransitions(elements, () => {\n objects.forEach((obj) => {\n obj.item.applyCss(this._getStylesForTransition(obj));\n obj.callback();\n });\n });\n }\n }\n\n _movementFinished() {\n this._transitions.length = 0;\n this.isTransitioning = false;\n this._dispatchLayout();\n }\n\n _dispatchLayout() {\n this._dispatch(Shuffle.EventType.LAYOUT);\n }\n\n /**\n * The magic. This is what makes the plugin 'shuffle'\n * @param {string|Function|Array.<string>} [category] Category to filter by.\n * Can be a function, string, or array of strings.\n * @param {Object} [sortObj] A sort object which can sort the visible set\n */\n filter(category, sortObj) {\n if (!this.isEnabled) {\n return;\n }\n\n if (!category || (category && category.length === 0)) {\n category = Shuffle.ALL_ITEMS;\n }\n\n this._filter(category);\n\n // Shrink each hidden item\n this._shrink();\n\n // How many visible elements?\n this._updateItemCount();\n\n // Update transforms on visible elements so they will animate to their new positions.\n this.sort(sortObj);\n }\n\n /**\n * Gets the visible elements, sorts them, and passes them to layout.\n * @param {Object} opts the options object for the sorted plugin\n */\n sort(opts = this.lastSort) {\n if (!this.isEnabled) {\n return;\n }\n\n this._resetCols();\n\n var items = this._getFilteredItems();\n items = sorter(items, opts);\n\n this._layout(items);\n\n // `_layout` always happens after `_shrink`, so it's safe to process the style\n // queue here with styles from the shrink method.\n this._processQueue();\n\n // Adjust the height of the container.\n this._setContainerSize();\n\n this.lastSort = opts;\n }\n\n /**\n * Reposition everything.\n * @param {boolean} isOnlyLayout If true, column and gutter widths won't be\n * recalculated.\n */\n update(isOnlyLayout) {\n if (this.isEnabled) {\n\n if (!isOnlyLayout) {\n // Get updated colCount\n this._setColumns();\n }\n\n // Layout items\n this.sort();\n }\n }\n\n /**\n * Use this instead of `update()` if you don't need the columns and gutters updated\n * Maybe an image inside `shuffle` loaded (and now has a height), which means calculations\n * could be off.\n */\n layout() {\n this.update(true);\n }\n\n /**\n * New items have been appended to shuffle. Mix them in with the current\n * filter or sort status.\n * @param {Array.<Element>} newItems Collection of new items.\n */\n add(newItems) {\n newItems = arrayUnique(newItems).map(el => new ShuffleItem(el));\n\n // Add classes and set initial positions.\n this._initItems(newItems);\n\n // Add transition to each item.\n this._setTransitions(newItems);\n\n // Update the list of items.\n this.items = this.items.concat(newItems);\n this._updateItemsOrder();\n this.filter(this.lastFilter);\n }\n\n /**\n * Disables shuffle from updating dimensions and layout on resize\n */\n disable() {\n this.isEnabled = false;\n }\n\n /**\n * Enables shuffle again\n * @param {boolean} [isUpdateLayout=true] if undefined, shuffle will update columns and gutters\n */\n enable(isUpdateLayout) {\n this.isEnabled = true;\n if (isUpdateLayout !== false) {\n this.update();\n }\n }\n\n /**\n * Remove 1 or more shuffle items\n * @param {Array.<Element>} collection An array containing one or more\n * elements in shuffle\n * @return {Shuffle} The shuffle object\n */\n remove(collection) {\n if (!collection.length) {\n return;\n }\n\n collection = arrayUnique(collection);\n\n let oldItems = collection\n .map(element => this.getItemByElement(element))\n .filter(item => !!item);\n\n let handleLayout = () => {\n this.element.removeEventListener(Shuffle.EventType.LAYOUT, handleLayout);\n this._disposeItems(oldItems);\n\n // Remove the collection in the callback\n collection.forEach((element) => {\n element.parentNode.removeChild(element);\n });\n\n this._dispatch(Shuffle.EventType.REMOVED, { collection });\n\n // Let it get garbage collected\n collection = null;\n oldItems = null;\n };\n\n // Hide collection first.\n this._toggleFilterClasses({\n visible: [],\n hidden: oldItems,\n });\n\n this._shrink(oldItems);\n\n this.sort();\n\n // Update the list of items here because `remove` could be called again\n // with an item that is in the process of being removed.\n this.items = this.items.filter(item => !arrayIncludes(oldItems, item));\n this._updateItemCount();\n\n this.element.addEventListener(Shuffle.EventType.LAYOUT, handleLayout);\n }\n\n /**\n * Retrieve a shuffle item by its element.\n * @param {Element} element Element to look for.\n * @return {?ShuffleItem} A shuffle item or null if it's not found.\n */\n getItemByElement(element) {\n for (var i = this.items.length - 1; i >= 0; i--) {\n if (this.items[i].element === element) {\n return this.items[i];\n }\n }\n\n return null;\n }\n\n /**\n * Destroys shuffle, removes events, styles, and classes\n */\n destroy() {\n this._cancelMovement();\n window.removeEventListener('resize', this._onResize);\n\n // Reset container styles\n this.element.classList.remove('shuffle');\n this.element.removeAttribute('style');\n\n // Reset individual item styles\n this._disposeItems();\n\n // Null DOM references\n this.items = null;\n this.options.sizer = null;\n this.element = null;\n this._transitions = null;\n\n // Set a flag so if a debounced resize has been triggered,\n // it can first check if it is actually isDestroyed and not doing anything\n this.isDestroyed = true;\n }\n\n /**\n * Returns the outer width of an element, optionally including its margins.\n *\n * There are a few different methods for getting the width of an element, none of\n * which work perfectly for all Shuffle's use cases.\n *\n * 1. getBoundingClientRect() `left` and `right` properties.\n * - Accounts for transform scaled elements, making it useless for Shuffle\n * elements which have shrunk.\n * 2. The `offsetWidth` property.\n * - This value stays the same regardless of the elements transform property,\n * however, it does not return subpixel values.\n * 3. getComputedStyle()\n * - This works great Chrome, Firefox, Safari, but IE<=11 does not include\n * padding and border when box-sizing: border-box is set, requiring a feature\n * test and extra work to add the padding back for IE and other browsers which\n * follow the W3C spec here.\n *\n * @param {Element} element The element.\n * @param {boolean} [includeMargins] Whether to include margins. Default is false.\n * @return {{width: number, height: number}} The width and height.\n */\n static getSize(element, includeMargins) {\n // Store the styles so that they can be used by others without asking for it again.\n var styles = window.getComputedStyle(element, null);\n var width = getNumberStyle(element, 'width', styles);\n var height = getNumberStyle(element, 'height', styles);\n\n if (includeMargins) {\n var marginLeft = getNumberStyle(element, 'marginLeft', styles);\n var marginRight = getNumberStyle(element, 'marginRight', styles);\n var marginTop = getNumberStyle(element, 'marginTop', styles);\n var marginBottom = getNumberStyle(element, 'marginBottom', styles);\n width += marginLeft + marginRight;\n height += marginTop + marginBottom;\n }\n\n return {\n width,\n height,\n };\n }\n\n /**\n * Change a property or execute a function which will not have a transition\n * @param {Array.<Element>} elements DOM elements that won't be transitioned.\n * @param {Function} callback A function which will be called while transition\n * is set to 0ms.\n * @private\n */\n static _skipTransitions(elements, callback) {\n let zero = '0ms';\n\n // Save current duration and delay.\n let data = elements.map((element) => {\n let style = element.style;\n let duration = style.transitionDuration;\n let delay = style.transitionDelay;\n\n // Set the duration to zero so it happens immediately\n style.transitionDuration = zero;\n style.transitionDelay = zero;\n\n return {\n duration,\n delay,\n };\n });\n\n callback();\n\n // Cause reflow.\n elements[0].offsetWidth; // jshint ignore:line\n\n // Put the duration back\n elements.forEach((element, i) => {\n element.style.transitionDuration = data[i].duration;\n element.style.transitionDelay = data[i].delay;\n });\n }\n}\n\nShuffle.ShuffleItem = ShuffleItem;\n\nShuffle.ALL_ITEMS = 'all';\nShuffle.FILTER_ATTRIBUTE_KEY = 'groups';\n\n/**\n * @enum {string}\n */\nShuffle.EventType = {\n LAYOUT: 'shuffle:layout',\n REMOVED: 'shuffle:removed',\n};\n\n/** @enum {string} */\nShuffle.Classes = Classes;\n\n// Overrideable options\nShuffle.options = {\n // Initial filter group.\n group: Shuffle.ALL_ITEMS,\n\n // Transition/animation speed (milliseconds).\n speed: 250,\n\n // CSS easing function to use.\n easing: 'ease',\n\n // e.g. '.picture-item'.\n itemSelector: '*',\n\n // Element or selector string. Use an element to determine the size of columns\n // and gutters.\n sizer: null,\n\n // A static number or function that tells the plugin how wide the gutters\n // between columns are (in pixels).\n gutterWidth: 0,\n\n // A static number or function that returns a number which tells the plugin\n // how wide the columns are (in pixels).\n columnWidth: 0,\n\n // If your group is not json, and is comma delimeted, you could set delimeter\n // to ','.\n delimeter: null,\n\n // Useful for percentage based heights when they might not always be exactly\n // the same (in pixels).\n buffer: 0,\n\n // Reading the width of elements isn't precise enough and can cause columns to\n // jump between values.\n columnThreshold: 0.01,\n\n // Shuffle can be isInitialized with a sort object. It is the same object\n // given to the sort method.\n initialSort: null,\n\n // By default, shuffle will throttle resize events. This can be changed or\n // removed.\n throttle: throttle,\n\n // How often shuffle can be called on resize (in milliseconds).\n throttleTime: 300,\n\n // Transition delay offset for each item in milliseconds.\n staggerAmount: 15,\n\n // Maximum stagger delay in milliseconds.\n staggerAmountMax: 250,\n\n // Whether to use transforms or absolute positioning.\n useTransforms: true,\n};\n\n// Expose for testing. Hack at your own risk.\nShuffle.__Point = Point;\nShuffle.__sorter = sorter;\nShuffle.__getColumnSpan = getColumnSpan;\nShuffle.__getAvailablePositions = getAvailablePositions;\nShuffle.__getShortColumn = getShortColumn;\n\nexport default Shuffle;\n\n\n\n// WEBPACK FOOTER //\n// ./src/shuffle.js","module.exports = function parallel(fns, context, callback) {\n if (!callback) {\n if (typeof context === 'function') {\n callback = context\n context = null\n } else {\n callback = noop\n }\n }\n\n var pending = fns && fns.length\n if (!pending) return callback(null, []);\n\n var finished = false\n var results = new Array(pending)\n\n fns.forEach(context ? function (fn, i) {\n fn.call(context, maybeDone(i))\n } : function (fn, i) {\n fn(maybeDone(i))\n })\n\n function maybeDone(i) {\n return function (err, result) {\n if (finished) return;\n\n if (err) {\n callback(err, results)\n finished = true\n return\n }\n\n results[i] = result\n\n if (!--pending) callback(null, results);\n }\n }\n}\n\nfunction noop() {}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/array-parallel/index.js\n// module id = 5\n// module chunks = 0","'use strict';\n\n// there's 3 implementations written in increasing order of efficiency\n\n// 1 - no Set type is defined\nfunction uniqNoSet(arr) {\n\tvar ret = [];\n\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (ret.indexOf(arr[i]) === -1) {\n\t\t\tret.push(arr[i]);\n\t\t}\n\t}\n\n\treturn ret;\n}\n\n// 2 - a simple Set type is defined\nfunction uniqSet(arr) {\n\tvar seen = new Set();\n\treturn arr.filter(function (el) {\n\t\tif (!seen.has(el)) {\n\t\t\tseen.add(el);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t});\n}\n\n// 3 - a standard Set type is defined and it has a forEach method\nfunction uniqSetWithForEach(arr) {\n\tvar ret = [];\n\n\t(new Set(arr)).forEach(function (el) {\n\t\tret.push(el);\n\t});\n\n\treturn ret;\n}\n\n// V8 currently has a broken implementation\n// https://github.com/joyent/node/issues/8449\nfunction doesForEachActuallyWork() {\n\tvar ret = false;\n\n\t(new Set([true])).forEach(function (el) {\n\t\tret = el;\n\t});\n\n\treturn ret === true;\n}\n\nif ('Set' in global) {\n\tif (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) {\n\t\tmodule.exports = uniqSetWithForEach;\n\t} else {\n\t\tmodule.exports = uniqSet;\n\t}\n} else {\n\tmodule.exports = uniqNoSet;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/array-uniq/index.js\n// module id = 6\n// module chunks = 0","\nlet element = document.body || document.documentElement;\nlet e = document.createElement('div');\ne.style.cssText = 'width:10px;padding:2px;box-sizing:border-box;';\nelement.appendChild(e);\n\nlet width = window.getComputedStyle(e, null).width;\nlet ret = width === '10px';\n\nelement.removeChild(e);\n\nexport default ret;\n\n\n\n// WEBPACK FOOTER //\n// ./src/computed-size.js","'use strict';\n\nimport getNumber from './get-number';\nimport COMPUTED_SIZE_INCLUDES_PADDING from './computed-size';\n\n/**\n * Retrieve the computed style for an element, parsed as a float.\n * @param {Element} element Element to get style for.\n * @param {string} style Style property.\n * @param {CSSStyleDeclaration} [styles] Optionally include clean styles to\n * use instead of asking for them again.\n * @return {number} The parsed computed value or zero if that fails because IE\n * will return 'auto' when the element doesn't have margins instead of\n * the computed style.\n */\nexport default function getNumberStyle(element, style,\n styles = window.getComputedStyle(element, null)) {\n var value = getNumber(styles[style]);\n\n // Support IE<=11 and W3C spec.\n if (!COMPUTED_SIZE_INCLUDES_PADDING && style === 'width') {\n value += getNumber(styles.paddingLeft) +\n getNumber(styles.paddingRight) +\n getNumber(styles.borderLeftWidth) +\n getNumber(styles.borderRightWidth);\n } else if (!COMPUTED_SIZE_INCLUDES_PADDING && style === 'height') {\n value += getNumber(styles.paddingTop) +\n getNumber(styles.paddingBottom) +\n getNumber(styles.borderTopWidth) +\n getNumber(styles.borderBottomWidth);\n }\n\n return value;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/get-number-style.js","'use strict';\n\nimport Point from './point';\n\nfunction arrayMax(array) {\n return Math.max.apply(Math, array);\n}\n\nfunction arrayMin(array) {\n return Math.min.apply(Math, array);\n}\n\n/**\n * Determine the location of the next item, based on its size.\n * @param {Object} itemSize Object with width and height.\n * @param {Array.<number>} positions Positions of the other current items.\n * @param {number} gridSize The column width or row height.\n * @param {number} total The total number of columns or rows.\n * @param {number} threshold Buffer value for the column to fit.\n * @param {number} buffer Vertical buffer for the height of items.\n * @return {Point}\n */\nexport function getItemPosition({ itemSize, positions, gridSize, total, threshold, buffer }) {\n var span = getColumnSpan(itemSize.width, gridSize, total, threshold);\n var setY = getAvailablePositions(positions, span, total);\n var shortColumnIndex = getShortColumn(setY, buffer);\n\n // Position the item\n var point = new Point(\n Math.round(gridSize * shortColumnIndex),\n Math.round(setY[shortColumnIndex]));\n\n // Update the columns array with the new values for each column.\n // e.g. before the update the columns could be [250, 0, 0, 0] for an item\n // which spans 2 columns. After it would be [250, itemHeight, itemHeight, 0].\n var setHeight = setY[shortColumnIndex] + itemSize.height;\n for (var i = 0; i < span; i++) {\n positions[shortColumnIndex + i] = setHeight;\n }\n\n return point;\n}\n\n/**\n * Determine the number of columns an items spans.\n * @param {number} itemWidth Width of the item.\n * @param {number} columnWidth Width of the column (includes gutter).\n * @param {number} columns Total number of columns\n * @param {number} threshold A buffer value for the size of the column to fit.\n * @return {number}\n */\nexport function getColumnSpan(itemWidth, columnWidth, columns, threshold) {\n var columnSpan = itemWidth / columnWidth;\n\n // If the difference between the rounded column span number and the\n // calculated column span number is really small, round the number to\n // make it fit.\n if (Math.abs(Math.round(columnSpan) - columnSpan) < threshold) {\n // e.g. columnSpan = 4.0089945390298745\n columnSpan = Math.round(columnSpan);\n }\n\n // Ensure the column span is not more than the amount of columns in the whole layout.\n return Math.min(Math.ceil(columnSpan), columns);\n}\n\n/**\n * Retrieves the column set to use for placement.\n * @param {number} columnSpan The number of columns this current item spans.\n * @param {number} columns The total columns in the grid.\n * @return {Array.<number>} An array of numbers represeting the column set.\n */\nexport function getAvailablePositions(positions, columnSpan, columns) {\n // The item spans only one column.\n if (columnSpan === 1) {\n return positions;\n }\n\n // The item spans more than one column, figure out how many different\n // places it could fit horizontally.\n // The group count is the number of places within the positions this block\n // could fit, ignoring the current positions of items.\n // Imagine a 2 column brick as the second item in a 4 column grid with\n // 10px height each. Find the places it would fit:\n // [20, 10, 10, 0]\n // | | |\n // * * *\n //\n // Then take the places which fit and get the bigger of the two:\n // max([20, 10]), max([10, 10]), max([10, 0]) = [20, 10, 0]\n //\n // Next, find the first smallest number (the short column).\n // [20, 10, 0]\n // |\n // *\n //\n // And that's where it should be placed!\n //\n // Another example where the second column's item extends past the first:\n // [10, 20, 10, 0] => [20, 20, 10] => 10\n var available = [];\n\n // For how many possible positions for this item there are.\n for (var i = 0; i <= columns - columnSpan; i++) {\n // Find the bigger value for each place it could fit.\n available.push(arrayMax(positions.slice(i, i + columnSpan)));\n }\n\n return available;\n}\n\n/**\n * Find index of short column, the first from the left where this item will go.\n *\n * @param {Array.<number>} positions The array to search for the smallest number.\n * @param {number} buffer Optional buffer which is very useful when the height\n * is a percentage of the width.\n * @return {number} Index of the short column.\n */\nexport function getShortColumn(positions, buffer) {\n var minPosition = arrayMin(positions);\n for (var i = 0, len = positions.length; i < len; i++) {\n if (positions[i] >= minPosition - buffer && positions[i] <= minPosition + buffer) {\n return i;\n }\n }\n\n return 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/layout.js","'use strict';\n\nlet transitions = {};\nlet eventName = 'transitionend';\nlet count = 0;\n\nfunction uniqueId() {\n return eventName + count++;\n}\n\nexport function onTransitionEnd(element, callback) {\n let id = uniqueId();\n let listener = (evt) => {\n if (evt.currentTarget === evt.target) {\n cancelTransitionEnd(id);\n callback(evt);\n }\n };\n\n element.addEventListener(eventName, listener);\n\n transitions[id] = { element, listener };\n\n return id;\n}\n\nexport function cancelTransitionEnd(id) {\n if (transitions[id]) {\n transitions[id].element.removeEventListener(eventName, transitions[id].listener);\n transitions[id] = null;\n return true;\n }\n\n return false;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/on-transition-end.js","import Point from './point';\nimport Classes from './classes';\n\nlet id = 0;\n\nclass ShuffleItem {\n constructor(element) {\n this.id = id++;\n this.element = element;\n this.isVisible = true;\n }\n\n show() {\n this.isVisible = true;\n this.element.classList.remove(Classes.HIDDEN);\n this.element.classList.add(Classes.VISIBLE);\n }\n\n hide() {\n this.isVisible = false;\n this.element.classList.remove(Classes.VISIBLE);\n this.element.classList.add(Classes.HIDDEN);\n }\n\n init() {\n this.addClasses([Classes.SHUFFLE_ITEM, Classes.VISIBLE]);\n this.applyCss(ShuffleItem.Css.INITIAL);\n this.scale = ShuffleItem.Scale.VISIBLE;\n this.point = new Point();\n }\n\n addClasses(classes) {\n classes.forEach((className) => {\n this.element.classList.add(className);\n });\n }\n\n removeClasses(classes) {\n classes.forEach((className) => {\n this.element.classList.remove(className);\n });\n }\n\n applyCss(obj) {\n for (var key in obj) {\n this.element.style[key] = obj[key];\n }\n }\n\n dispose() {\n this.removeClasses([\n Classes.HIDDEN,\n Classes.VISIBLE,\n Classes.SHUFFLE_ITEM,\n ]);\n\n this.element.removeAttribute('style');\n this.element = null;\n }\n}\n\nShuffleItem.Css = {\n INITIAL: {\n position: 'absolute',\n top: 0,\n left: 0,\n visibility: 'visible',\n 'will-change': 'transform',\n },\n VISIBLE: {\n before: {\n opacity: 1,\n visibility: 'visible',\n },\n after: {},\n },\n HIDDEN: {\n before: {\n opacity: 0,\n },\n after: {\n visibility: 'hidden',\n },\n },\n};\n\nShuffleItem.Scale = {\n VISIBLE: 1,\n HIDDEN: 0.001,\n};\n\nexport default ShuffleItem;\n\n\n\n// WEBPACK FOOTER //\n// ./src/shuffle-item.js","'use strict';\n\nimport xtend from 'xtend';\n\n// http://stackoverflow.com/a/962890/373422\nfunction randomize(array) {\n var tmp;\n var current;\n let top = array.length;\n\n if (!top) {\n return array;\n }\n\n while (--top) {\n current = Math.floor(Math.random() * (top + 1));\n tmp = array[current];\n array[current] = array[top];\n array[top] = tmp;\n }\n\n return array;\n}\n\nlet defaults = {\n // Use array.reverse() to reverse the results\n reverse: false,\n\n // Sorting function\n by: null,\n\n // If true, this will skip the sorting and return a randomized order in the array\n randomize: false,\n\n // Determines which property of each item in the array is passed to the\n // sorting method.\n key: 'element',\n};\n\n// You can return `undefined` from the `by` function to revert to DOM order.\nexport default function sorter(arr, options) {\n let opts = xtend(defaults, options);\n let original = [].slice.call(arr);\n let revert = false;\n\n if (!arr.length) {\n return [];\n }\n\n if (opts.randomize) {\n return randomize(arr);\n }\n\n // Sort the elements by the opts.by function.\n // If we don't have opts.by, default to DOM order\n if (typeof opts.by === 'function') {\n arr.sort(function (a, b) {\n\n // Exit early if we already know we want to revert\n if (revert) {\n return 0;\n }\n\n let valA = opts.by(a[opts.key]);\n let valB = opts.by(b[opts.key]);\n\n // If both values are undefined, use the DOM order\n if (valA === undefined && valB === undefined) {\n revert = true;\n return 0;\n }\n\n if (valA < valB || valA === 'sortFirst' || valB === 'sortLast') {\n return -1;\n }\n\n if (valA > valB || valA === 'sortLast' || valB === 'sortFirst') {\n return 1;\n }\n\n return 0;\n });\n }\n\n // Revert to the original array if necessary\n if (revert) {\n return original;\n }\n\n if (opts.reverse) {\n arr.reverse();\n }\n\n return arr;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/sorter.js","// Polyfill for creating CustomEvents on IE9/10/11\n\n// code pulled from:\n// https://github.com/d4tocchini/customevent-polyfill\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill\n\ntry {\n var ce = new window.CustomEvent('test');\n ce.preventDefault();\n if (ce.defaultPrevented !== true) {\n // IE has problems with .preventDefault() on custom events\n // http://stackoverflow.com/questions/23349191\n throw new Error('Could not prevent default');\n }\n} catch(e) {\n var CustomEvent = function(event, params) {\n var evt, origPrevent;\n params = params || {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n\n evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n origPrevent = evt.preventDefault;\n evt.preventDefault = function () {\n origPrevent.call(this);\n try {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function () {\n return true;\n }\n });\n } catch(e) {\n this.defaultPrevented = true;\n }\n };\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n window.CustomEvent = CustomEvent; // expose definition to window\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/custom-event-polyfill/custom-event-polyfill.js\n// module id = 13\n// module chunks = 0","'use strict';\n\nvar proto = Element.prototype;\nvar vendor = proto.matches\n || proto.matchesSelector\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector\n || proto.oMatchesSelector;\n\nmodule.exports = match;\n\n/**\n * Match `el` to `selector`.\n *\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n * @api public\n */\n\nfunction match(el, selector) {\n if (vendor) return vendor.call(el, selector);\n var nodes = el.parentNode.querySelectorAll(selector);\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i] == el) return true;\n }\n return false;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/matches-selector/index.js\n// module id = 14\n// module chunks = 0","module.exports = throttle;\n\n/**\n * Returns a new function that, when invoked, invokes `func` at most once per `wait` milliseconds.\n *\n * @param {Function} func Function to wrap.\n * @param {Number} wait Number of milliseconds that must elapse between `func` invocations.\n * @return {Function} A new function that wraps the `func` function passed in.\n */\n\nfunction throttle (func, wait) {\n var ctx, args, rtn, timeoutID; // caching\n var last = 0;\n\n return function throttled () {\n ctx = this;\n args = arguments;\n var delta = new Date() - last;\n if (!timeoutID)\n if (delta >= wait) call();\n else timeoutID = setTimeout(call, wait - delta);\n return rtn;\n };\n\n function call () {\n timeoutID = 0;\n last = +new Date();\n rtn = func.apply(ctx, args);\n ctx = null;\n args = null;\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/throttleit/index.js\n// module id = 15\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 = 16\n// module chunks = 0","module.exports = require('./shuffle').default;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js"],"sourceRoot":""}