{"version":3,"sources":["webpack:///./node_modules/shufflejs/dist/shuffle.esm.js"],"names":["_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_createClass","protoProps","staticProps","prototype","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","__proto__","_setPrototypeOf","p","_possibleConstructorReturn","self","call","ReferenceError","_assertThisInitialized","E","on","name","callback","ctx","e","this","push","fn","once","listener","off","apply","arguments","_","emit","data","slice","evtArr","len","evts","liveEvents","tinyEmitter","TinyEmitter","proto","Element","vendor","matches","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","el","selector","nodeType","nodes","parentNode","querySelectorAll","throttleit","func","wait","args","rtn","timeoutID","last","delta","Date","setTimeout","noop","getNumber","value","parseFloat","Point","x","y","a","b","Rect","w","h","id","left","top","width","height","Classes","BASE","SHUFFLE_ITEM","VISIBLE","HIDDEN","ShuffleItem","element","isVisible","isHidden","classList","remove","add","removeAttribute","setAttribute","addClasses","applyCss","Css","INITIAL","scale","Scale","point","classes","_this","forEach","className","_this2","obj","_this3","keys","style","removeClasses","position","visibility","willChange","before","opacity","after","transitionDelay","testComputedSize","document","body","documentElement","createElement","cssText","appendChild","window","getComputedStyle","removeChild","getNumberStyle","styles","undefined","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","defaults","reverse","by","compare","randomize","sorter","arr","options","opts","assign","original","Array","from","revert","array","n","Math","floor","random","temp","sort","valA","valB","transitions","eventName","count","cancelTransitionEnd","removeEventListener","onTransitionEnd","evt","currentTarget","addEventListener","arrayMax","max","getColumnSpan","itemWidth","columnWidth","columns","threshold","columnSpan","abs","round","min","ceil","getAvailablePositions","positions","available","getShortColumn","buffer","minPosition","getCenteredPositions","itemRects","containerWidth","rowMap","itemRect","rects","rows","centeredRows","intersectingRect","lastItem","end","offset","finalRects","canMove","newRects","every","r","newRect","noOverlap","some","intersects","rowIndex","findIndex","items","includes","splice","concat","map","arrayUnique","Set","id$1","Shuffle","_TinyEmitter","delimeter","delimiter","lastSort","group","ALL_ITEMS","lastFilter","isEnabled","isDestroyed","isInitialized","_transitions","isTransitioning","_queue","_getElementOption","_init","subClass","superClass","create","constructor","_inherits","_getItems","sizer","_initItems","_onResize","_getResizeFunction","readyState","layout","bind","onLoad","containerCss","getSize","_validateStyles","_setColumns","filter","initialSort","offsetWidth","setItemTransitions","transition","speed","easing","resizeFunction","_handleResize","throttle","throttleTime","option","querySelector","jquery","overflow","category","collection","set","_getFilteredSets","_toggleFilterClasses","visible","hidden","item","_doesPassFilter","attr","getAttribute","FILTER_ATTRIBUTE_KEY","split","JSON","parse","testCategory","isArray","filterMode","FilterMode","ANY","_ref","show","hide","init","dispose","visibleItems","_getFilteredItems","_this$options","positionProps","useTransforms","cssProps","k","replace","str","m1","toLowerCase","properties","join","transitionDuration","transitionTimingFunction","transitionProperty","children","itemSelector","indexOf","gutterSize","size","gutterWidth","gutter","_getGutterSize","_getColumnSize","calculatedColumns","columnThreshold","cols","colWidth","_getContainerSize","index","staggerAmount","staggerAmountMax","shuffle","_this4","itemPositions","_getNextPositions","equals","getStylesForTransition","_getStaggerAmount","_this5","isCentered","itemsData","itemSize","_getItemPosition","getTransformedPositions","gridSize","total","span","setY","shortColumnIndex","setHeight","getItemPosition","_this6","_getConcealedItems","update","styleObject","roundTransforms","transform","itemCallback","done","_this7","_whenTransitionDone","_cancelMovement","hasSpeed","hasQueue","_startTransitions","_styleImmediately","_dispatch","EventType","LAYOUT","_this8","fns","context","pending","finished","results","maybeDone","err","result","arrayParallel","_getTransitionFunction","_movementFinished","objects","elements","_skipTransitions","sortOptions","_filter","_shrink","_updateItemCount","_resetCols","_layout","_processQueue","_setContainerSize","isOnlyLayout","newItems","_this9","sortedItems","_mergeNewItems","allSortedItemsSet","isNewItem","applyHiddenState","isUpdateLayout","_this10","oldItems","getItemByElement","_disposeItems","REMOVED","find","_this11","includeMargins","marginLeft","marginRight","marginTop","marginBottom","duration","delay","ALL","__sorter","__getColumnSpan","__getAvailablePositions","__getShortColumn","__getCenteredPositions"],"mappings":"sFAAA,SAASA,EAAgBC,EAAUC,GACjC,KAAMD,aAAoBC,GACxB,MAAM,IAAIC,UAAU,qCAIxB,SAASC,EAAkBC,EAAQC,GACjC,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CACrC,IAAIE,EAAaH,EAAMC,GACvBE,EAAWC,WAAaD,EAAWC,aAAc,EACjDD,EAAWE,cAAe,EACtB,UAAWF,IAAYA,EAAWG,UAAW,GACjDC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAIlD,SAASO,EAAad,EAAae,EAAYC,GAG7C,OAFID,GAAYb,EAAkBF,EAAYiB,UAAWF,GACrDC,GAAad,EAAkBF,EAAagB,GACzChB,EAkBT,SAASkB,EAAgBC,GAIvB,OAHAD,EAAkBP,OAAOS,eAAiBT,OAAOU,eAAiB,SAAyBF,GACzF,OAAOA,EAAEG,WAAaX,OAAOU,eAAeF,KAEvBA,GAGzB,SAASI,EAAgBJ,EAAGK,GAM1B,OALAD,EAAkBZ,OAAOS,gBAAkB,SAAyBD,EAAGK,GAErE,OADAL,EAAEG,UAAYE,EACPL,IAGcA,EAAGK,GAW5B,SAASC,EAA2BC,EAAMC,GACxC,OAAIA,GAAyB,iBAATA,GAAqC,mBAATA,EATlD,SAAgCD,GAC9B,QAAa,IAATA,EACF,MAAM,IAAIE,eAAe,6DAG3B,OAAOF,EAQAG,CAAuBH,GAHrBC,EAMX,SAASG,KAKTA,EAAEb,UAAY,CACZc,GAAI,SAAUC,EAAMC,EAAUC,GAC5B,IAAIC,EAAIC,KAAKD,IAAMC,KAAKD,EAAI,IAO5B,OALCA,EAAEH,KAAUG,EAAEH,GAAQ,KAAKK,KAAK,CAC/BC,GAAIL,EACJC,IAAKA,IAGAE,MAGTG,KAAM,SAAUP,EAAMC,EAAUC,GAC9B,IAAIR,EAAO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OA,EAEfoJ,EAAQgM,SAAW5Q,EACnB4E,EAAQiM,gBAAkBhP,EAC1B+C,EAAQkM,wBAA0BvO,EAClCqC,EAAQmM,iBAAmBrO,EAC3BkC,EAAQoM,uBAAyBnO,EAElB","file":"js/1.f859ba8d.chunk.js","sourcesContent":["function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n }\n listener._ = callback;\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nvar tinyEmitter = E;\nvar TinyEmitter = E;\ntinyEmitter.TinyEmitter = TinyEmitter;\n\nvar proto = typeof Element !== 'undefined' ? Element.prototype : {};\nvar vendor = proto.matches\n || proto.matchesSelector\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector\n || proto.oMatchesSelector;\n\nvar matchesSelector = 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 (!el || el.nodeType !== 1) return false;\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\nvar throttleit = 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\nvar arrayParallel = 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 * 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 */\nfunction getNumber(value) {\n return parseFloat(value) || 0;\n}\n\nvar Point =\n/*#__PURE__*/\nfunction () {\n /**\n * Represents a coordinate pair.\n * @param {number} [x=0] X.\n * @param {number} [y=0] Y.\n */\n function Point(x, y) {\n _classCallCheck(this, Point);\n\n this.x = getNumber(x);\n this.y = getNumber(y);\n }\n /**\n * Whether two points are equal.\n * @param {Point} a Point A.\n * @param {Point} b Point B.\n * @return {boolean}\n */\n\n\n _createClass(Point, null, [{\n key: \"equals\",\n value: function equals(a, b) {\n return a.x === b.x && a.y === b.y;\n }\n }]);\n\n return Point;\n}();\n\nvar Rect =\n/*#__PURE__*/\nfunction () {\n /**\n * Class for representing rectangular regions.\n * https://github.com/google/closure-library/blob/master/closure/goog/math/rect.js\n * @param {number} x Left.\n * @param {number} y Top.\n * @param {number} w Width.\n * @param {number} h Height.\n * @param {number} id Identifier\n * @constructor\n */\n function Rect(x, y, w, h, id) {\n _classCallCheck(this, Rect);\n\n this.id = id;\n /** @type {number} */\n\n this.left = x;\n /** @type {number} */\n\n this.top = y;\n /** @type {number} */\n\n this.width = w;\n /** @type {number} */\n\n this.height = h;\n }\n /**\n * Returns whether two rectangles intersect.\n * @param {Rect} a A Rectangle.\n * @param {Rect} b A Rectangle.\n * @return {boolean} Whether a and b intersect.\n */\n\n\n _createClass(Rect, null, [{\n key: \"intersects\",\n value: function intersects(a, b) {\n return a.left < b.left + b.width && b.left < a.left + a.width && a.top < b.top + b.height && b.top < a.top + a.height;\n }\n }]);\n\n return Rect;\n}();\n\nvar Classes = {\n BASE: 'shuffle',\n SHUFFLE_ITEM: 'shuffle-item',\n VISIBLE: 'shuffle-item--visible',\n HIDDEN: 'shuffle-item--hidden'\n};\n\nvar id = 0;\n\nvar ShuffleItem =\n/*#__PURE__*/\nfunction () {\n function ShuffleItem(element) {\n _classCallCheck(this, ShuffleItem);\n\n id += 1;\n this.id = id;\n this.element = element;\n /**\n * Used to separate items for layout and shrink.\n */\n\n this.isVisible = true;\n /**\n * Used to determine if a transition will happen. By the time the _layout\n * and _shrink methods get the ShuffleItem instances, the `isVisible` value\n * has already been changed by the separation methods, so this property is\n * needed to know if the item was visible/hidden before the shrink/layout.\n */\n\n this.isHidden = false;\n }\n\n _createClass(ShuffleItem, [{\n key: \"show\",\n value: function show() {\n this.isVisible = true;\n this.element.classList.remove(Classes.HIDDEN);\n this.element.classList.add(Classes.VISIBLE);\n this.element.removeAttribute('aria-hidden');\n }\n }, {\n key: \"hide\",\n value: function hide() {\n this.isVisible = false;\n this.element.classList.remove(Classes.VISIBLE);\n this.element.classList.add(Classes.HIDDEN);\n this.element.setAttribute('aria-hidden', true);\n }\n }, {\n key: \"init\",\n value: function 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 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 var _this3 = this;\n\n Object.keys(obj).forEach(function (key) {\n _this3.element.style[key] = obj[key];\n });\n }\n }, {\n key: \"dispose\",\n value: function dispose() {\n this.removeClasses([Classes.HIDDEN, Classes.VISIBLE, Classes.SHUFFLE_ITEM]);\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 willChange: 'transform'\n },\n VISIBLE: {\n before: {\n opacity: 1,\n visibility: 'visible'\n },\n after: {\n transitionDelay: ''\n }\n },\n HIDDEN: {\n before: {\n opacity: 0\n },\n after: {\n visibility: 'hidden',\n transitionDelay: ''\n }\n }\n};\nShuffleItem.Scale = {\n VISIBLE: 1,\n HIDDEN: 0.001\n};\n\nvar value = null;\nvar testComputedSize = (function () {\n if (value !== null) {\n return value;\n }\n\n var element = document.body || document.documentElement;\n var e = document.createElement('div');\n e.style.cssText = 'width:10px;padding:2px;box-sizing:border-box;';\n element.appendChild(e);\n value = window.getComputedStyle(e, null).width === '10px';\n element.removeChild(e);\n return value;\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 */\n\nfunction getNumberStyle(element, style) {\n var styles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window.getComputedStyle(element, null);\n var value = getNumber(styles[style]); // Support IE<=11 and W3C spec.\n\n if (!testComputedSize() && style === 'width') {\n value += getNumber(styles.paddingLeft) + getNumber(styles.paddingRight) + getNumber(styles.borderLeftWidth) + getNumber(styles.borderRightWidth);\n } else if (!testComputedSize() && style === 'height') {\n value += getNumber(styles.paddingTop) + getNumber(styles.paddingBottom) + getNumber(styles.borderTopWidth) + getNumber(styles.borderBottomWidth);\n }\n\n return value;\n}\n\n/**\n * Fisher-Yates shuffle.\n * http://stackoverflow.com/a/962890/373422\n * https://bost.ocks.org/mike/shuffle/\n * @param {Array} array Array to shuffle.\n * @return {Array} Randomly sorted array.\n */\nfunction randomize(array) {\n var n = array.length;\n\n while (n) {\n n -= 1;\n var i = Math.floor(Math.random() * (n + 1));\n var temp = array[i];\n array[i] = array[n];\n array[n] = temp;\n }\n\n return array;\n}\n\nvar defaults = {\n // Use array.reverse() to reverse the results\n reverse: false,\n // Sorting function\n by: null,\n // Custom sort function\n compare: null,\n // If true, this will skip the sorting and return a randomized order in the array\n randomize: false,\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.\n * @param {Array} arr Array to sort.\n * @param {SortOptions} options Sorting options.\n * @return {Array}\n */\n\nfunction sorter(arr, options) {\n var opts = Object.assign({}, defaults, options);\n var original = Array.from(arr);\n var revert = false;\n\n if (!arr.length) {\n return [];\n }\n\n if (opts.randomize) {\n return randomize(arr);\n } // Sort the elements by the opts.by function.\n // If we don't have opts.by, default to DOM order\n\n\n if (typeof opts.by === 'function') {\n arr.sort(function (a, b) {\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]); // If both values are undefined, use the DOM order\n\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 } else if (typeof opts.compare === 'function') {\n arr.sort(opts.compare);\n } // Revert to the original array if necessary\n\n\n if (revert) {\n return original;\n }\n\n if (opts.reverse) {\n arr.reverse();\n }\n\n return arr;\n}\n\nvar transitions = {};\nvar eventName = 'transitionend';\nvar count = 0;\n\nfunction uniqueId() {\n count += 1;\n return eventName + count;\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}\nfunction onTransitionEnd(element, callback) {\n var id = uniqueId();\n\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 transitions[id] = {\n element: element,\n listener: listener\n };\n return id;\n}\n\nfunction arrayMax(array) {\n return Math.max.apply(Math, array); // eslint-disable-line prefer-spread\n}\n\nfunction arrayMin(array) {\n return Math.min.apply(Math, array); // eslint-disable-line prefer-spread\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 */\n\nfunction getColumnSpan(itemWidth, columnWidth, columns, threshold) {\n var columnSpan = itemWidth / columnWidth; // 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\n if (Math.abs(Math.round(columnSpan) - columnSpan) < threshold) {\n // e.g. columnSpan = 4.0089945390298745\n columnSpan = Math.round(columnSpan);\n } // Ensure the column span is not more than the amount of columns in the whole layout.\n\n\n return Math.min(Math.ceil(columnSpan), columns);\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.} An array of numbers represeting the column set.\n */\n\nfunction getAvailablePositions(positions, columnSpan, columns) {\n // The item spans only one column.\n if (columnSpan === 1) {\n return positions;\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, 10]\n //\n // Next, find the first smallest number (the short column).\n // [20, 10, 10]\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\n\n var available = []; // For how many possible positions for this item there are.\n\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 * Find index of short column, the first from the left where this item will go.\n *\n * @param {Array.} 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 */\n\nfunction getShortColumn(positions, buffer) {\n var minPosition = arrayMin(positions);\n\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 * Determine the location of the next item, based on its size.\n * @param {Object} itemSize Object with width and height.\n * @param {Array.} 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 */\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 var span = getColumnSpan(itemSize.width, gridSize, total, threshold);\n var setY = getAvailablePositions(positions, span, total);\n var shortColumnIndex = getShortColumn(setY, buffer); // Position the item\n\n var point = new Point(gridSize * shortColumnIndex, setY[shortColumnIndex]); // 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\n var setHeight = setY[shortColumnIndex] + itemSize.height;\n\n for (var i = 0; i < span; i++) {\n positions[shortColumnIndex + i] = setHeight;\n }\n\n return point;\n}\n/**\n * This method attempts to center items. This method could potentially be slow\n * with a large number of items because it must place items, then check every\n * previous item to ensure there is no overlap.\n * @param {Array.} itemRects Item data objects.\n * @param {number} containerWidth Width of the containing element.\n * @return {Array.}\n */\n\nfunction getCenteredPositions(itemRects, containerWidth) {\n var rowMap = {}; // Populate rows by their offset because items could jump between rows like:\n // a c\n // bbb\n\n itemRects.forEach(function (itemRect) {\n if (rowMap[itemRect.top]) {\n // Push the point to the last row array.\n rowMap[itemRect.top].push(itemRect);\n } else {\n // Start of a new row.\n rowMap[itemRect.top] = [itemRect];\n }\n }); // For each row, find the end of the last item, then calculate\n // the remaining space by dividing it by 2. Then add that\n // offset to the x position of each point.\n\n var rects = [];\n var rows = [];\n var centeredRows = [];\n Object.keys(rowMap).forEach(function (key) {\n var itemRects = rowMap[key];\n rows.push(itemRects);\n var lastItem = itemRects[itemRects.length - 1];\n var end = lastItem.left + lastItem.width;\n var offset = Math.round((containerWidth - end) / 2);\n var finalRects = itemRects;\n var canMove = false;\n\n if (offset > 0) {\n var newRects = [];\n canMove = itemRects.every(function (r) {\n var newRect = new Rect(r.left + offset, r.top, r.width, r.height, r.id); // Check all current rects to make sure none overlap.\n\n var noOverlap = !rects.some(function (r) {\n return Rect.intersects(newRect, r);\n });\n newRects.push(newRect);\n return noOverlap;\n }); // If none of the rectangles overlapped, the whole group can be centered.\n\n if (canMove) {\n finalRects = newRects;\n }\n } // If the items are not going to be offset, ensure that the original\n // placement for this row will not overlap previous rows (row-spanning\n // elements could be in the way).\n\n\n if (!canMove) {\n var intersectingRect;\n var hasOverlap = itemRects.some(function (itemRect) {\n return rects.some(function (r) {\n var intersects = Rect.intersects(itemRect, r);\n\n if (intersects) {\n intersectingRect = r;\n }\n\n return intersects;\n });\n }); // If there is any overlap, replace the overlapping row with the original.\n\n if (hasOverlap) {\n var rowIndex = centeredRows.findIndex(function (items) {\n return items.includes(intersectingRect);\n });\n centeredRows.splice(rowIndex, 1, rows[rowIndex]);\n }\n }\n\n rects = rects.concat(finalRects);\n centeredRows.push(finalRects);\n }); // Reduce array of arrays to a single array of points.\n // https://stackoverflow.com/a/10865042/373422\n // Then reset sort back to how the items were passed to this method.\n // Remove the wrapper object with index, map to a Point.\n\n return [].concat.apply([], centeredRows) // eslint-disable-line prefer-spread\n .sort(function (a, b) {\n return a.id - b.id;\n }).map(function (itemRect) {\n return new Point(itemRect.left, itemRect.top);\n });\n}\n\n/**\n * Hyphenates a javascript style string to a css one. For example:\n * MozBoxSizing -> -moz-box-sizing.\n * @param {string} str The string to hyphenate.\n * @return {string} The hyphenated string.\n */\nfunction hyphenate(str) {\n return str.replace(/([A-Z])/g, function (str, m1) {\n return \"-\".concat(m1.toLowerCase());\n });\n}\n\nfunction arrayUnique(x) {\n return Array.from(new Set(x));\n} // Used for unique instance variables\n\n\nvar id$1 = 0;\n\nvar Shuffle =\n/*#__PURE__*/\nfunction (_TinyEmitter) {\n _inherits(Shuffle, _TinyEmitter);\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 _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Shuffle);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Shuffle).call(this));\n _this.options = Object.assign({}, Shuffle.options, options); // Allow misspelling of delimiter since that's how it used to be.\n // Remove in v6.\n\n if (_this.options.delimeter) {\n _this.options.delimiter = _this.options.delimeter;\n }\n\n _this.lastSort = {};\n _this.group = Shuffle.ALL_ITEMS;\n _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 var el = _this._getElementOption(element);\n\n if (!el) {\n throw new TypeError('Shuffle needs to be initialized with an element.');\n }\n\n _this.element = el;\n _this.id = 'shuffle_' + id$1;\n id$1 += 1;\n\n _this._init();\n\n _this.isInitialized = true;\n return _this;\n }\n\n _createClass(Shuffle, [{\n key: \"_init\",\n value: function _init() {\n this.items = this._getItems();\n this.options.sizer = this._getElementOption(this.options.sizer); // Add class and invalidate styles\n\n this.element.classList.add(Shuffle.Classes.BASE); // Set initial css for each item\n\n this._initItems(this.items); // Bind resize events\n\n\n this._onResize = this._getResizeFunction();\n window.addEventListener('resize', this._onResize); // If the page has not already emitted the `load` event, call layout on load.\n // This avoids layout issues caused by images and fonts loading after the\n // instance has been initialized.\n\n if (document.readyState !== 'complete') {\n var layout = this.layout.bind(this);\n window.addEventListener('load', function onLoad() {\n window.removeEventListener('load', onLoad);\n layout();\n });\n } // Get container css all in one request. Causes reflow\n\n\n var containerCss = window.getComputedStyle(this.element, null);\n var containerWidth = Shuffle.getSize(this.element).width; // Add styles to the container if it doesn't have them.\n\n this._validateStyles(containerCss); // 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\n\n this._setColumns(containerWidth); // Kick off!\n\n\n this.filter(this.options.group, this.options.initialSort); // 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\n this.element.offsetWidth; // eslint-disable-line no-unused-expressions\n\n this.setItemTransitions(this.items);\n this.element.style.transition = \"height \".concat(this.options.speed, \"ms \").concat(this.options.easing);\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\n return this.options.throttle ? this.options.throttle(resizeFunction, this.options.throttleTime) : resizeFunction;\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 } // Check for an element\n\n\n if (option && option.nodeType && option.nodeType === 1) {\n return option;\n } // Check for jQuery object\n\n\n if (option && option.jquery) {\n return option[0];\n }\n\n return null;\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 } // Overflow has to be hidden.\n\n\n if (styles.overflow !== 'hidden') {\n this.element.style.overflow = 'hidden';\n }\n }\n /**\n * Filter the elements by a category.\n * @param {string|string[]|function(Element):boolean} [category] Category to\n * filter by. If it's given, the last 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: ShuffleItem[], hidden: ShuffleItem[]}}\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); // Individually add/remove hidden/visible classes\n\n\n this._toggleFilterClasses(set); // Save the last filter in case elements are appended.\n\n\n this.lastFilter = category; // This is saved mainly because providing a filter function (like searching)\n // will overwrite the `lastFilter` property every time its called.\n\n if (typeof category === 'string') {\n this.group = category;\n }\n\n return set;\n }\n /**\n * Returns an object containing the visible and hidden elements.\n * @param {string|string[]|function(Element):boolean} category Category or function to filter by.\n * @param {ShuffleItem[]} items A collection of items to filter.\n * @return {{visible: ShuffleItem[], hidden: ShuffleItem[]}}\n * @private\n */\n\n }, {\n key: \"_getFilteredSets\",\n value: function _getFilteredSets(category, items) {\n var _this2 = this;\n\n var visible = [];\n var hidden = []; // category === 'all', add visible class to everything\n\n if (category === Shuffle.ALL_ITEMS) {\n visible = items; // 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 (_this2._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 * Test an item to see if it passes a category.\n * @param {string|string[]|function():boolean} 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 if (typeof category === 'function') {\n return category.call(element, element, this);\n } // Check each element's data-groups attribute against the given category.\n\n\n var attr = element.getAttribute('data-' + Shuffle.FILTER_ATTRIBUTE_KEY);\n var keys = this.options.delimiter ? attr.split(this.options.delimiter) : JSON.parse(attr);\n\n function testCategory(category) {\n return keys.includes(category);\n }\n\n if (Array.isArray(category)) {\n if (this.options.filterMode === Shuffle.FilterMode.ANY) {\n return category.some(testCategory);\n }\n\n return category.every(testCategory);\n }\n\n return keys.includes(category);\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 visible.forEach(function (item) {\n item.show();\n });\n hidden.forEach(function (item) {\n item.hide();\n });\n }\n /**\n * Set the initial css for each item\n * @param {ShuffleItem[]} items Set to initialize.\n * @private\n */\n\n }, {\n key: \"_initItems\",\n value: function _initItems(items) {\n items.forEach(function (item) {\n item.init();\n });\n }\n /**\n * Remove element reference and styles.\n * @param {ShuffleItem[]} items Set to dispose.\n * @private\n */\n\n }, {\n key: \"_disposeItems\",\n value: function _disposeItems(items) {\n items.forEach(function (item) {\n item.dispose();\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 * 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 a new Shuffle instance.\n * @param {ShuffleItem[]} items Shuffle items to set transitions on.\n * @protected\n */\n\n }, {\n key: \"setItemTransitions\",\n value: function setItemTransitions(items) {\n var _this$options = this.options,\n speed = _this$options.speed,\n easing = _this$options.easing;\n var positionProps = this.options.useTransforms ? ['transform'] : ['top', 'left']; // Allow users to transtion other properties if they exist in the `before`\n // css mapping of the shuffle item.\n\n var cssProps = Object.keys(ShuffleItem.Css.HIDDEN.before).map(function (k) {\n return hyphenate(k);\n });\n var properties = positionProps.concat(cssProps).join();\n items.forEach(function (item) {\n item.element.style.transitionDuration = speed + 'ms';\n item.element.style.transitionTimingFunction = easing;\n item.element.style.transitionProperty = properties;\n });\n }\n }, {\n key: \"_getItems\",\n value: function _getItems() {\n var _this3 = this;\n\n return Array.from(this.element.children).filter(function (el) {\n return matchesSelector(el, _this3.options.itemSelector);\n }).map(function (el) {\n return new ShuffleItem(el);\n });\n }\n /**\n * Combine the current items array with a new one and sort it by DOM order.\n * @param {ShuffleItem[]} items Items to track.\n * @return {ShuffleItem[]}\n */\n\n }, {\n key: \"_mergeNewItems\",\n value: function _mergeNewItems(items) {\n var children = Array.from(this.element.children);\n return sorter(this.items.concat(items), {\n by: function by(element) {\n return children.indexOf(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 * 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; // If the columnWidth property is a function, then the grid is fluid\n\n if (typeof this.options.columnWidth === 'function') {\n size = this.options.columnWidth(containerWidth); // columnWidth option isn't a function, are they using a sizing element?\n } else if (this.options.sizer) {\n size = Shuffle.getSize(this.options.sizer).width; // if not, how about the explicitly set option?\n } else if (this.options.columnWidth) {\n size = this.options.columnWidth; // 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; // if there's no items, use size of container\n } else {\n size = containerWidth;\n } // Don't let them set a column width of zero.\n\n\n if (size === 0) {\n size = containerWidth;\n }\n\n return size + gutterSize;\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\n if (typeof this.options.gutterWidth === 'function') {\n size = this.options.gutterWidth(containerWidth);\n } else if (this.options.sizer) {\n size = getNumberStyle(this.options.sizer, 'marginLeft');\n } else {\n size = this.options.gutterWidth;\n }\n\n return size;\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\n var columnWidth = this._getColumnSize(containerWidth, gutter);\n\n var calculatedColumns = (containerWidth + gutter) / columnWidth; // Widths given from getStyles are not precise enough...\n\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 || 0), 1);\n this.containerWidth = containerWidth;\n this.colWidth = columnWidth;\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 * 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 * 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 * Emit an event from this instance.\n * @param {string} name Event name.\n * @param {Object} [data={}] Optional object data.\n */\n\n }, {\n key: \"_dispatch\",\n value: function _dispatch(name) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (this.isDestroyed) {\n return;\n }\n\n data.shuffle = this;\n this.emit(name, data);\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\n while (i) {\n i -= 1;\n this.positions.push(0);\n }\n }\n /**\n * Loops through each item that should be shown and calculates the x, y position.\n * @param {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 _this4 = this;\n\n var itemPositions = this._getNextPositions(items);\n\n var count = 0;\n items.forEach(function (item, i) {\n function callback() {\n item.applyCss(ShuffleItem.Css.VISIBLE.after);\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\n\n if (Point.equals(item.point, itemPositions[i]) && !item.isHidden) {\n item.applyCss(ShuffleItem.Css.VISIBLE.before);\n callback();\n return;\n }\n\n item.point = itemPositions[i];\n item.scale = ShuffleItem.Scale.VISIBLE;\n item.isHidden = false; // Clone the object so that the `before` object isn't modified when the\n // transition delay is added.\n\n var styles = _this4.getStylesForTransition(item, ShuffleItem.Css.VISIBLE.before);\n\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 += 1;\n });\n }\n /**\n * Return an array of Point instances representing the future positions of\n * each item.\n * @param {ShuffleItem[]} items Array of sorted shuffle items.\n * @return {Point[]}\n * @private\n */\n\n }, {\n key: \"_getNextPositions\",\n value: function _getNextPositions(items) {\n var _this5 = this;\n\n // If position data is going to be changed, add the item's size to the\n // transformer to allow for calculations.\n if (this.options.isCentered) {\n var itemsData = items.map(function (item, i) {\n var itemSize = Shuffle.getSize(item.element, true);\n\n var point = _this5._getItemPosition(itemSize);\n\n return new Rect(point.x, point.y, itemSize.width, itemSize.height, i);\n });\n return this.getTransformedPositions(itemsData, this.containerWidth);\n } // If no transforms are going to happen, simply return an array of the\n // future points of each item.\n\n\n return items.map(function (item) {\n return _this5._getItemPosition(Shuffle.getSize(item.element, true));\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 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 * Mutate positions before they're applied.\n * @param {Rect[]} itemRects Item data objects.\n * @param {number} containerWidth Width of the containing element.\n * @return {Point[]}\n * @protected\n */\n\n }, {\n key: \"getTransformedPositions\",\n value: function getTransformedPositions(itemRects, containerWidth) {\n return getCenteredPositions(itemRects, containerWidth);\n }\n /**\n * Hides the elements that don't match our filter.\n * @param {ShuffleItem[]} collection Collection to shrink.\n * @private\n */\n\n }, {\n key: \"_shrink\",\n value: function _shrink() {\n var _this6 = this;\n\n var collection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getConcealedItems();\n var count = 0;\n collection.forEach(function (item) {\n function callback() {\n item.applyCss(ShuffleItem.Css.HIDDEN.after);\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\n\n if (item.isHidden) {\n item.applyCss(ShuffleItem.Css.HIDDEN.before);\n callback();\n return;\n }\n\n item.scale = ShuffleItem.Scale.HIDDEN;\n item.isHidden = true;\n\n var styles = _this6.getStylesForTransition(item, ShuffleItem.Css.HIDDEN.before);\n\n styles.transitionDelay = _this6._getStaggerAmount(count) + 'ms';\n\n _this6._queue.push({\n item: item,\n styles: styles,\n callback: callback\n });\n\n count += 1;\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 this.update();\n }\n /**\n * Returns styles which will be applied to the an item for a transition.\n * @param {ShuffleItem} item Item to get styles for. Should have updated\n * scale and point properties.\n * @param {Object} styleObject Extra styles that will be used in the transition.\n * @return {!Object} Transforms for transitions, left/top for animate.\n * @protected\n */\n\n }, {\n key: \"getStylesForTransition\",\n value: function getStylesForTransition(item, styleObject) {\n // Clone the object to avoid mutating the original.\n var styles = Object.assign({}, styleObject);\n\n if (this.options.useTransforms) {\n var x = this.options.roundTransforms ? Math.round(item.point.x) : item.point.x;\n var y = this.options.roundTransforms ? Math.round(item.point.y) : item.point.y;\n styles.transform = \"translate(\".concat(x, \"px, \").concat(y, \"px) scale(\").concat(item.scale, \")\");\n } else {\n styles.left = item.point.x + 'px';\n styles.top = item.point.y + 'px';\n }\n\n return styles;\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 = onTransitionEnd(element, function (evt) {\n itemCallback();\n done(null, evt);\n });\n\n this._transitions.push(id);\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 _this7 = this;\n\n return function (done) {\n opts.item.applyCss(opts.styles);\n\n _this7._whenTransitionDone(opts.item.element, opts.callback, done);\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\n this._dispatch(Shuffle.EventType.LAYOUT); // 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\n } else {\n this._dispatch(Shuffle.EventType.LAYOUT);\n } // Remove everything in the style queue\n\n\n this._queue.length = 0;\n }\n /**\n * Wait for each transition to finish, the emit the layout event.\n * @param {Object[]} transitions Array of transition objects.\n */\n\n }, {\n key: \"_startTransitions\",\n value: function _startTransitions(transitions) {\n var _this8 = this;\n\n // Set flag that shuffle is currently in motion.\n this.isTransitioning = true; // Create an array of functions to be called.\n\n var callbacks = transitions.map(function (obj) {\n return _this8._getTransitionFunction(obj);\n });\n arrayParallel(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(cancelTransitionEnd); // Reset the array.\n\n\n this._transitions.length = 0; // Show it's no longer active.\n\n this.isTransitioning = false;\n }\n /**\n * Apply styles without a transition.\n * @param {Object[]} objects Array of transition objects.\n * @private\n */\n\n }, {\n key: \"_styleImmediately\",\n value: function _styleImmediately(objects) {\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(obj.styles);\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\n this._dispatch(Shuffle.EventType.LAYOUT);\n }\n /**\n * The magic. This is what makes the plugin 'shuffle'\n * @param {string|string[]|function(Element):boolean} [category] Category to filter by.\n * Can be a function, string, or array of strings.\n * @param {SortOptions} [sortOptions] A sort object which can sort the visible set\n */\n\n }, {\n key: \"filter\",\n value: function filter(category, sortOptions) {\n if (!this.isEnabled) {\n return;\n }\n\n if (!category || category && category.length === 0) {\n category = Shuffle.ALL_ITEMS; // eslint-disable-line no-param-reassign\n }\n\n this._filter(category); // Shrink each hidden item\n\n\n this._shrink(); // How many visible elements?\n\n\n this._updateItemCount(); // Update transforms on visible elements so they will animate to their new positions.\n\n\n this.sort(sortOptions);\n }\n /**\n * Gets the visible elements, sorts them, and passes them to layout.\n * @param {SortOptions} [sortOptions] The options object to pass to `sorter`.\n */\n\n }, {\n key: \"sort\",\n value: function sort() {\n var sortOptions = 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 = sorter(this._getFilteredItems(), sortOptions);\n\n this._layout(items); // `_layout` always happens after `_shrink`, so it's safe to process the style\n // queue here with styles from the shrink method.\n\n\n this._processQueue(); // Adjust the height of the container.\n\n\n this._setContainerSize();\n\n this.lastSort = sortOptions;\n }\n /**\n * Reposition everything.\n * @param {boolean} [isOnlyLayout=false] If true, column and gutter widths won't be recalculated.\n */\n\n }, {\n key: \"update\",\n value: function update() {\n var isOnlyLayout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (this.isEnabled) {\n if (!isOnlyLayout) {\n // Get updated colCount\n this._setColumns();\n } // Layout items\n\n\n this.sort();\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 * New items have been appended to shuffle. Mix them in with the current\n * filter or sort status.\n * @param {Element[]} newItems Collection of new items.\n */\n\n }, {\n key: \"add\",\n value: function add(newItems) {\n var _this9 = this;\n\n var items = arrayUnique(newItems).map(function (el) {\n return new ShuffleItem(el);\n }); // Add classes and set initial positions.\n\n this._initItems(items); // Determine which items will go with the current filter.\n\n\n this._resetCols();\n\n var allItems = this._mergeNewItems(items);\n\n var sortedItems = sorter(allItems, this.lastSort);\n\n var allSortedItemsSet = this._filter(this.lastFilter, sortedItems);\n\n var isNewItem = function isNewItem(item) {\n return items.includes(item);\n };\n\n var applyHiddenState = function applyHiddenState(item) {\n item.scale = ShuffleItem.Scale.HIDDEN;\n item.isHidden = true;\n item.applyCss(ShuffleItem.Css.HIDDEN.before);\n item.applyCss(ShuffleItem.Css.HIDDEN.after);\n }; // Layout all items again so that new items get positions.\n // Synchonously apply positions.\n\n\n var itemPositions = this._getNextPositions(allSortedItemsSet.visible);\n\n allSortedItemsSet.visible.forEach(function (item, i) {\n if (isNewItem(item)) {\n item.point = itemPositions[i];\n applyHiddenState(item);\n item.applyCss(_this9.getStylesForTransition(item, {}));\n }\n });\n allSortedItemsSet.hidden.forEach(function (item) {\n if (isNewItem(item)) {\n applyHiddenState(item);\n }\n }); // Cause layout so that the styles above are applied.\n\n this.element.offsetWidth; // eslint-disable-line no-unused-expressions\n // Add transition to each item.\n\n this.setItemTransitions(items); // Update the list of items.\n\n this.items = this._mergeNewItems(items); // Update layout/visibility of new and old items.\n\n this.filter(this.lastFilter);\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 * 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() {\n var isUpdateLayout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.isEnabled = true;\n\n if (isUpdateLayout) {\n this.update();\n }\n }\n /**\n * Remove 1 or more shuffle items.\n * @param {Element[]} elements An array containing one or more\n * elements in shuffle\n * @return {Shuffle} The shuffle instance.\n */\n\n }, {\n key: \"remove\",\n value: function remove(elements) {\n var _this10 = this;\n\n if (!elements.length) {\n return;\n }\n\n var collection = arrayUnique(elements);\n var oldItems = collection.map(function (element) {\n return _this10.getItemByElement(element);\n }).filter(function (item) {\n return !!item;\n });\n\n var handleLayout = function handleLayout() {\n _this10._disposeItems(oldItems); // Remove the collection in the callback\n\n\n collection.forEach(function (element) {\n element.parentNode.removeChild(element);\n });\n\n _this10._dispatch(Shuffle.EventType.REMOVED, {\n collection: collection\n });\n }; // Hide collection first.\n\n\n this._toggleFilterClasses({\n visible: [],\n hidden: oldItems\n });\n\n this._shrink(oldItems);\n\n this.sort(); // 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\n this.items = this.items.filter(function (item) {\n return !oldItems.includes(item);\n });\n\n this._updateItemCount();\n\n this.once(Shuffle.EventType.LAYOUT, handleLayout);\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 undefined if it's not found.\n */\n\n }, {\n key: \"getItemByElement\",\n value: function getItemByElement(element) {\n return this.items.find(function (item) {\n return item.element === element;\n });\n }\n /**\n * Dump the elements currently stored and reinitialize all child elements which\n * match the `itemSelector`.\n */\n\n }, {\n key: \"resetItems\",\n value: function resetItems() {\n var _this11 = this;\n\n // Remove refs to current items.\n this._disposeItems(this.items);\n\n this.isInitialized = false; // Find new items in the DOM.\n\n this.items = this._getItems(); // Set initial styles on the new items.\n\n this._initItems(this.items);\n\n this.once(Shuffle.EventType.LAYOUT, function () {\n // Add transition to each item.\n _this11.setItemTransitions(_this11.items);\n\n _this11.isInitialized = true;\n }); // Lay out all items.\n\n this.filter(this.lastFilter);\n }\n /**\n * Destroys shuffle, removes events, styles, and classes\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this._cancelMovement();\n\n window.removeEventListener('resize', this._onResize); // Reset container styles\n\n this.element.classList.remove('shuffle');\n this.element.removeAttribute('style'); // Reset individual item styles\n\n this._disposeItems(this.items);\n\n this.items.length = 0;\n this._transitions.length = 0; // Null DOM references\n\n this.options.sizer = null;\n this.element = null; // 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\n this.isDestroyed = true;\n this.isEnabled = false;\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=false] Whether to include margins.\n * @return {{width: number, height: number}} The width and height.\n */\n\n }], [{\n key: \"getSize\",\n value: function getSize(element) {\n var includeMargins = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\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: width,\n height: height\n };\n }\n /**\n * Change a property or execute a function which will not have a transition\n * @param {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'; // Save current duration and delay.\n\n var data = elements.map(function (element) {\n var style = element.style;\n var duration = style.transitionDuration;\n var delay = style.transitionDelay; // Set the duration to zero so it happens immediately\n\n style.transitionDuration = zero;\n style.transitionDelay = zero;\n return {\n duration: duration,\n delay: delay\n };\n });\n callback(); // Cause forced synchronous layout.\n\n elements[0].offsetWidth; // eslint-disable-line no-unused-expressions\n // Put the duration back\n\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}(tinyEmitter);\n\nShuffle.ShuffleItem = ShuffleItem;\nShuffle.ALL_ITEMS = 'all';\nShuffle.FILTER_ATTRIBUTE_KEY = 'groups';\n/** @enum {string} */\n\nShuffle.EventType = {\n LAYOUT: 'shuffle:layout',\n REMOVED: 'shuffle:removed'\n};\n/** @enum {string} */\n\nShuffle.Classes = Classes;\n/** @enum {string} */\n\nShuffle.FilterMode = {\n ANY: 'any',\n ALL: 'all'\n}; // Overrideable options\n\nShuffle.options = {\n // Initial filter group.\n group: Shuffle.ALL_ITEMS,\n // Transition/animation speed (milliseconds).\n speed: 250,\n // CSS easing function to use.\n easing: 'cubic-bezier(0.4, 0.0, 0.2, 1)',\n // e.g. '.picture-item'.\n itemSelector: '*',\n // Element or selector string. Use an element to determine the size of columns\n // and gutters.\n sizer: null,\n // A static number or function that tells the plugin how wide the gutters\n // between columns are (in pixels).\n gutterWidth: 0,\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 // If your group is not json, and is comma delimeted, you could set delimiter\n // to ','.\n delimiter: null,\n // Useful for percentage based heights when they might not always be exactly\n // the same (in pixels).\n buffer: 0,\n // Reading the width of elements isn't precise enough and can cause columns to\n // jump between values.\n columnThreshold: 0.01,\n // Shuffle can be isInitialized with a sort object. It is the same object\n // given to the sort method.\n initialSort: null,\n // By default, shuffle will throttle resize events. This can be changed or\n // removed.\n throttle: throttleit,\n // How often shuffle can be called on resize (in milliseconds).\n throttleTime: 300,\n // Transition delay offset for each item in milliseconds.\n staggerAmount: 15,\n // Maximum stagger delay in milliseconds.\n staggerAmountMax: 150,\n // Whether to use transforms or absolute positioning.\n useTransforms: true,\n // Affects using an array with filter. e.g. `filter(['one', 'two'])`. With \"any\",\n // the element passes the test if any of its groups are in the array. With \"all\",\n // the element only passes if all groups are in the array.\n filterMode: Shuffle.FilterMode.ANY,\n // Attempt to center grid items in each row.\n isCentered: false,\n // Whether to round pixel values used in translate(x, y). This usually avoids\n // blurriness.\n roundTransforms: true\n};\nShuffle.Point = Point;\nShuffle.Rect = Rect; // Expose for testing. Hack at your own risk.\n\nShuffle.__sorter = sorter;\nShuffle.__getColumnSpan = getColumnSpan;\nShuffle.__getAvailablePositions = getAvailablePositions;\nShuffle.__getShortColumn = getShortColumn;\nShuffle.__getCenteredPositions = getCenteredPositions;\n\nexport default Shuffle;\n//# sourceMappingURL=shuffle.esm.js.map\n"],"sourceRoot":""}