"use strict";function _toConsumableArray(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}!function(){function t(o,r){function m(t,e){if(t.data){var i=t.data.staticClass?t.data.staticClass+" ":"";t.data.staticClass=i+e}}function s(t){return t.__underlying_element}var t,e;return{props:{options:{type:Object,default:{layoutMode:"masonry",masonry:{gutter:10}},sort:String},itemSelector:{type:String,default:"item"},list:{type:Array,required:!0}},name:"isotope",render:function t(e){var i=this,n={},r=this.prevChildren=this.children,o=this.$slots.default||[],s=this.children=[],a=this.removedIndex=[];o.forEach(function(t){return m(t,i.itemSelector)});for(var l=0;l<o.length;l++){var u=o[l];if(u.tag)if(null!=u.key&&0!==String(u.key).indexOf("__vlist"))s.push(u),n[u.key]=u;else{var c=u.componentOptions,h=c?c.Ctor.options.name||c.tag||"":u.tag;console.log("Warning template error: isotope children must be keyed: <"+h+">")}}var f=this.displayChildren=[].concat(s);if(r)for(var d=0;d<r.length;d++){var p=r[d];n[p.key]||(f.splice(d,0,p),a.push(d))}return e("div",null,f)},mounted:function t(){var n=this,e=o.merge({},this.compiledOptions),i=function t(e){o.forOwn(e,function(i,t){e[t]=function(t){var e=s(t);return console.log("filteeeer",e),i.call(n,e.vm,e.index)}})};console.log("options",e.getFilterData),i(e.getSortData),i(e.getFilterData),this.$nextTick(function(){n._isotopeOptions=e,n.link(),n.listen();var t=new r(n.$el,e);t._requestUpdate=function(){t._willUpdate||(t._willUpdate=!0,n.$nextTick(function(){t.arrange(),t._willUpdate=!1}))},n.iso=t})},beforeDestroy:function t(){this.iso.destroy(),o.forEach(this._listeners,function(t){t()}),this._filterlistener&&this._filterlistener(),this.iso=null},beforeUpdate:function t(){this._oldChidren=Array.prototype.slice.call(this.$el.children)},updated:function t(){var e=this;if(this.iso){var i=[].concat(_toConsumableArray(this.$el.children)),n=o.difference(i,this._oldChidren),r=this.removedIndex.map(function(t){return e.$el.children[t]});this.cleanupNodes(),this.link(),(r.length||n.length)&&(this.listen(),this.iso.remove(r),this.iso.insert(n),this.iso._requestUpdate())}},methods:{cleanupNodes:function t(){var e=this;this.removedIndex.reverse(),this.removedIndex.forEach(function(t){return e._vnode.children.splice(t,1)})},link:function t(){var n=this,e;(this.$slots.default||[]).forEach(function(t,e){var i=t.elm;i&&(i.__underlying_element={vm:n.list[e],index:e})})},listen:function t(){var n=this;this._listeners=o(this.compiledOptions.getSortData).map(function(i){return o.map(n.list,function(t,e){return n.$watch(function(){return i(t)},function(){n.iso.updateSortData(),n.iso._requestUpdate()})})}).flatten().value()},sort:function t(e){var t=e;o.isString(e)&&(t={sortBy:e}),this.arrange(t),this.$emit("sort",e)},filter:function t(i){var n=this,t=this._isotopeOptions.getFilterData[i];this._filterlistener=this.$watch(function(){return o.map(n.list,function(t,e){return n.options.getFilterData[i](t,e)})},function(){n.iso._requestUpdate()}),this.arrange({filter:t}),this.$emit("filter",i)},unfilter:function t(){this.arrange({filter:function t(){return!0}}),this.$emit("filter",null)},layout:function t(e){var t=e;o.isString(e)&&(t={layoutMode:e}),this.arrange(t),this.$emit("layout",t)},arrange:function t(e){this.iso.arrange(e),this.$emit("arrange",e)},shuffle:function t(){this.iso.shuffle(),this.$emit("shuffle"),this.$emit("sort",null)},getFilteredItemElements:function t(){return this.iso.getFilteredItemElements()},getElementItems:function t(){return this.iso.getElementItems()}},computed:{compiledOptions:function t(){var i=o.merge({},this.options,{itemSelector:"."+this.itemSelector,isJQueryFiltering:!1});return o.forOwn(i.getSortData,function(e,t){o.isString(e)&&(i.getSortData[t]=function(t){return t[e]})}),i}}}}if(window.Vue&&window.lodash&&window.Isotope){var e=t(window.lodash,window.Isotope);Vue.component("isotope",e)}}();