PageSourceSearch

https://dulichninhbinh.com.vn/en/templates/01/assets/js/-Filterable-Cards--1.min.js

js dulichninhbinh.com.vn collected 2026-10-02 12:53:37 UTC 46,412 bytes, 1,128 lines download raw bytes

vendor: 4,226 bytes, lines 1-106
1/*!
2 * imagesLoaded PACKAGED v4.1.4
3 * JavaScript is all like "You images are done yet or what?"
4 * MIT License
5 */
6! function(t, e) {
7    "function" == typeof define && define.amd ? define("ev-emitter/ev-emitter", e) : "object" == typeof module && module.exports ? module.exports = e() : t.EvEmitter = e()
8}("undefined" != typeof window ? window : this, (function() {
9    function t() {}
10    var e = t.prototype;
11    return e.on = function(t, e) {
12        if (t && e) {
13            var r = this._events = this._events || {},
14                i = r[t] = r[t] || [];
15            return -1 == i.indexOf(e) && i.push(e), this
16        }
17    }, e.once = function(t, e) {
18        if (t && e) {
19            this.on(t, e);
20            var r = this._onceEvents = this._onceEvents || {};
21            return (r[t] = r[t] || {})[e] = !0, this
22        }
23    }, e.off = function(t, e) {
24        var r = this._events && this._events[t];
25        if (r && r.length) {
26            var i = r.indexOf(e);
27            return -1 != i && r.splice(i, 1), this
28        }
29    }, e.emitEvent = function(t, e) {
30        var r = this._events && this._events[t];
31        if (r && r.length) {
32            r = r.slice(0), e = e || [];
33            for (var i = this._onceEvents && this._onceEvents[t], n = 0; n < r.length; n++) {
34                var o = r[n];
35                i && i[o] && (this.off(t, o), delete i[o]), o.apply(this, e)
36            }
37            return this
38        }
39    }, e.allOff = function() {
40        delete this._events, delete this._onceEvents
41    }, t
42})),
43function(t, e) {
44    "use strict";
45    "function" == typeof define && define.amd ? define(["ev-emitter/ev-emitter"], (function(r) {
46        return e(t, r)
47    })) : "object" == typeof module && module.exports ? module.exports = e(t, require("ev-emitter")) : t.imagesLoaded = e(t, t.EvEmitter)
48}("undefined" != typeof window ? window : this, (function(t, e) {
49    function r(t, e) {
50        for (var r in e) t[r] = e[r];
51        return t
52    }
53
54    function i(t, e, n) {
55        if (!(this instanceof i)) return new i(t, e, n);
56        var o = t;
57        return "string" == typeof t && (o = document.querySelectorAll(t)), o ? (this.elements = function(t) {
58            return Array.isArray(t) ? t : "object" == typeof t && "number" == typeof t.length ? l.call(t) : [t]
59        }(o), this.options = r({}, this.options), "function" == typeof e ? n = e : r(this.options, e), n && this.on("always", n), this.getImages(), s && (this.jqDeferred = new s.Deferred), void setTimeout(this.check.bind(this))) : void a.error("Bad element for imagesLoaded " + (o || t))
60    }
61
62    function n(t) {
63        this.img = t
64    }
65
66    function o(t, e) {
67        this.url = t, this.element = e, this.img = new Image
68    }
69    var s = t.jQuery,
70        a = t.console,
71        l = Array.prototype.slice;
72    i.prototype = Object.create(e.prototype), i.prototype.options = {}, i.prototype.getImages = function() {
73        this.images = [], this.elements.forEach(this.addElementImages, this)
74    }, i.prototype.addElementImages = function(t) {
75        "IMG" == t.nodeName && this.addImage(t), !0 === this.options.background && this.addElementBackgroundImages(t);
76        var e = t.nodeType;
77        if (e && u[e]) {
78            for (var r = t.querySelectorAll("img"), i = 0; i < r.length; i++) {
79                var n = r[i];
80                this.addImage(n)
81            }
82            if ("string" == typeof this.options.background) {
83                var o = t.querySelectorAll(this.options.background);
84                for (i = 0; i < o.length; i++) {
85                    var s = o[i];
86                    this.addElementBackgroundImages(s)
87                }
88            }
89        }
90    };
91    var u = {
92        1: !0,
93        9: !0,
94        11: !0
95    };
96    return i.prototype.addElementBackgroundImages = function(t) {
97        var e = getComputedStyle(t);
98        if (e)
99            for (var r = /url\((['"])?(.*?)\1\)/gi, i = r.exec(e.backgroundImage); null !== i;) {
100                var n = i && i[2];
101                n && this.addBackground(n, t), i = r.exec(e.backgroundImage)
102            }
103    }, i.prototype.addImage = function(t) {
104        var e = new n(t);
105        this.images.push(e)
106    }
106, i.prototype.addBackground = function(t, e) {
107        var r = new o(t, e);
108        this.images.push(r)
109    }, i.prototype.check = function() {
110        function t(t, r, i) {
111            setTimeout((function() {
112                e.progress(t, r, i)
113            }))
114        }
115        var e = this;
116        return this.progressedCount = 0, this.hasAnyBroken = !1, this.images.length ? void this.images.forEach((function(e) {
117            e.once("progress", t), e.check()
118        })) : void this.complete()
119    }, i.prototype.progress = function(t, e, r) {
120        this.progressedCount++, this.hasAnyBroken = this.hasAnyBroken || !t.isLoaded, this.emitEvent("progress", [this, t, e]), this.jqDeferred && this.jqDeferred.notify && this.jqDeferred.notify(this, t), this.progressedCount == this.images.length && this.complete(), this.options.debug && a && a.log("progress: " + r, t, e)
121    }, i.prototype.complete = function() {
122        var t = this.hasAnyBroken ? "fail" : "done";
123        if (this.isComplete = !0, this.emitEvent(t, [this]), this.emitEvent("always", [this]), this.jqDeferred) {
124            var e = this.hasAnyBroken ? "reject" : "resolve";
125            this.jqDeferred[e](this)
126        }
127    }, n.prototype = Object.create(e.prototype), n.prototype.check = function() {
128        return this.getIsImageComplete() ? void this.confirm(0 !== this.img.naturalWidth, "naturalWidth") : (this.proxyImage = new Image, this.proxyImage.addEventListener("load", this), this.proxyImage.addEventListener("error", this), this.img.addEventListener("load", this), this.img.addEventListener("error", this), void(this.proxyImage.src = this.img.src))
129    }, n.prototype.getIsImageComplete = function() {
130        return this.img.complete && this.img.naturalWidth
131    }, n.prototype.confirm = function(t, e) {
132        this.isLoaded = t, this.emitEvent("progress", [this, this.img, e])
133    }, n.prototype.handleEvent = function(t) {
134        var e = "on" + t.type;
135        this[e] && this[e](t)
136    }, n.prototype.onload = function() {
137        this.confirm(!0, "onload"), this.unbindEvents()
138    }, n.prototype.onerror = function() {
139        this.confirm(!1, "onerror"), this.unbindEvents()
140    }, n.prototype.unbindEvents = function() {
141        this.proxyImage.removeEventListener("load", this), this.proxyImage.removeEventListener("error", this), this.img.removeEventListener("load", this), this.img.removeEventListener("error", this)
142    }, o.prototype = Object.create(n.prototype), o.prototype.check = function() {
143        this.img.addEventListener("load", this), this.img.addEventListener("error", this), this.img.src = this.url, this.getIsImageComplete() && (this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), this.unbindEvents())
144    }, o.prototype.unbindEvents = function() {
145        this.img.removeEventListener("load", this), this.img.removeEventListener("error", this)
146    }, o.prototype.confirm = function(t, e) {
147        this.isLoaded = t, this.emitEvent("progress", [this, this.element, e])
148    }, i.makeJQueryPlugin = function(e) {
149        (e = e || t.jQuery) && ((s = e).fn.imagesLoaded = function(t, e) {
150            return new i(this, t, e).jqDeferred.promise(s(this))
151        })
152    }, i.makeJQueryPlugin(), i
153})),
154function(t) {
155    function e(i) {
156        if (r[i]) return r[i].exports;
157        var n = r[i] = {
158            i: i,
159            l: !1,
160            exports: {}
161        };
162        return t[i].call(n.exports, n, n.exports, e), n.l = !0, n.exports
163    }
164    var r = {};
165    e.m = t, e.c = r, e.d = function(t, r, i) {
166        e.o(t, r) || Object.defineProperty(t, r, {
167            configurable: !1,
168            enumerable: !0,
169            get: i
170        })
171    }, e.n = function(t) {
172        var r = t && t.__esModule ? function() {
173            return t.default
174        } : function() {
175            return t
176        };
177        return e.d(r, "a", r), r
178    }, e.o = function(t, e) {
179        return Object.prototype.hasOwnProperty.call(t, e)
180    }, e.p = "", e(e.s = 4)
181}([function(t, e, r) {
182    "use strict";
183    r.d(e, "b", (function() {
184        return n
185    })), r.d(e, "h", (function() {
186        return o
187    })), r.d(e, "i", (function() {
188        return s
189    })), r.d(e, "g", (function() {
190        return a
191    })), r.d(e, "e", (function() {
192        return l
193    })), r.d(e, "j", (function() {
194        return u
195    })), r.d(e, "f", (function() {
196        return c
197    })), r.d(e, "k", (function() {
198        return f
199    })), r.d(e, "c", (function() {
200        return h
201    })), r.d(e, "d", (function() {
202        return p
203    })), r.d(e, "l", (function() {
204        return d
205    })), r.d(e, "a", (function() {
206        return v
207    }));
208    var i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
209            return typeof t
210        } : function(t) {
211            return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
212        },
213        n = function(t, e) {
214            for (var r = 0; r < t.length; r++) {
215                for (var i = !1, n = t[r], o = 0; o < e.length; o++) n === e[o] && (i = !0);
216                if (!i) return !1
217            }
218            return !0
219        },
220        o = function(t) {
221            var e = {};
222            for (var r in t) e[r] = t[r];
223            return e
224        },
225        s = function t(e, r) {
226            var n = o(r);
227            for (var s in e) s in n ? "object" !== i(n[s]) || "object" !== i(e[s]) || Array.isArray(e[s]) || (n[s] = t("object" === i(n[s]) ? n[s] : {}, e[s])) : n[s] = e[s];
228            return n
229        },
230        a = function(t, e) {
231            return Array.prototype.filter.call(t, (function(t) {
232                return e.includes(t)
233            }))
234        },
235        l = function(t, e, r) {
236            var i = void 0;
237            return function() {
238                var n = this,
239                    o = arguments;
240                clearTimeout(i), i = setTimeout((function() {
241                    i = null, r || t.apply(n, o)
242                }), e), r && !i && t.apply(n, o)
243            }
244        },
245        u = function(t) {
246            for (var e = t.slice(0), r = []; 0 !== e.length;) {
247                var i = Math.floor(e.length * Math.random());
248                r.push(e[i]), e.splice(i, 1)
249            }
250            return r
251        },
252        c = function(t, e) {
253            if (t.length !== e.length) return !1;
254            for (var r = 0; r < t.length; r++)
255                if (t[r].props.index !== e[r].props.index) return !1;
256            return !0
257        },
258        f = function(t, e) {
259            return t.slice(0).sort(function(t) {
260                return function(e, r) {
261                    var i = t(e),
262                        n = t(r);
263                    return i < n ? -1 : i > n ? 1 : 0
264                }
265            }(e))
266        },
267        h = function(t, e, r, n, o) {
268            if (void 0 !== e) {
269                var s = new Error('Filterizr: expected type of option "' + t + '" to be "' + r + '", but its type is: "' + (void 0 === e ? "undefined" : i(e)) + '"'),
270                    a = !1,
271                    l = !1,
272                    u = r.includes("array");
273                if ((void 0 === e ? "undefined" : i(e)).match(r) ? a = !0 : !a && u && (l = Array.isArray(e)), !a && !u) throw s;
274                if (!a && u && !l) throw s;
275                var c = function(t) {
276                    return t ? " For further help read here: " + t : ""
277                };
278                if (Array.isArray(n)) {
279                    var f = !1;
280                    if (n.forEach((function(t) {
281                            t === e && (f = !0)
282                        })), !f) throw new Error('Filterizr: allowed values for option "' + t + '" are: ' + n.map((function(t) {
283                        return '"' + t + '"'
284                    }
284)).join(", ") + '. Value received: "' + e + '".' + c(o))
285                } else if (n instanceof RegExp) {
286                    if (!e.match(n)) throw new Error('Filterizr: invalid value "' + e + '" for option "' + t + '" received.' + c(o))
287                }
288            }
289        },
290        p = /(^linear$)|(^ease-in-out$)|(^ease-in$)|(^ease-out$)|(^ease$)|(^step-start$)|(^step-end$)|(^steps\(\d\s*,\s*(end|start)\))$|(^cubic-bezier\((\d*\.*\d+)\s*,\s*(\d*\.*\d+)\s*,\s*(\d*\.*\d+)\s*,\s*(\d*\.*\d+)\))$/,
291        d = "\n  webkitTransitionEnd.Filterizr \n  otransitionend.Filterizr \n  oTransitionEnd.Filterizr \n  msTransitionEnd.Filterizr \n  transitionend.Filterizr\n",
292        v = {
293            IDLE: "IDLE",
294            FILTERING: "FILTERING",
295            SORTING: "SORTING",
296            SHUFFLING: "SHUFFLING"
297        }
298}, function(t, e, r) {
299    "use strict";
300
301    function i(t, e) {
302        if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
303    }
304    var n = r(2),
305        o = r(0),
306        s = function() {
307            function t(t, e) {
308                for (var r = 0; r < e.length; r++) {
309                    var i = e[r];
310                    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i)
311                }
312            }
313            return function(e, r, i) {
314                return r && t(e.prototype, r), i && t(e, i), e
315            }
316        }(),
317        a = window.jQuery,
318        l = function() {
319            function t() {
320                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ".filtr-container",
321                    r = arguments[1];
322                i(this, t), this.$node = a(e), this.props = {
323                    FilterItems: this.getFilterItems(r),
324                    w: this.getWidth(),
325                    h: 0
326                }, this.$node.css({
327                    padding: 0,
328                    position: "relative"
329                }), this.updateFilterItemsDimensions()
330            }
331            return s(t, [{
332                key: "destroy",
333                value: function() {
334                    this.$node.attr("style", "").find(".filtr-item").attr("style", ""), this.unbindEvents()
335                }
336            }, {
337                key: "getFilterItems",
338                value: function(t) {
339                    return a.map(this.$node.find(".filtr-item"), (function(e, r) {
340                        return new n.a(a(e), r, t)
341                    }))
342                }
343            }, {
344                key: "push",
345                value: function(t, e) {
346                    var r = this.props.FilterItems;
347                    this.$node.append(t);
348                    var i = r.length,
349                        o = new n.a(t, i, e);
350                    this.props.FilterItems.push(o)
351                }
352            }, {
353                key: "calcColumns",
354                value: function() {
355                    return Math.round(this.props.w / this.props.FilterItems[0].props.w)
356                }
357            }, {
358                key: "updateFilterItemsTransitionStyle",
359                value: function(t, e, r, i) {
360                    this.props.FilterItems.forEach((function(n) {
361                        return n.$node.css({
362                            transition: "all " + t + "s " + e + " " + n.calcDelay(r, i) + "ms"
363                        })
364                    }))
365                }
366            }, {
367                key: "updateHeight",
368                value: function(t) {
369                    this.props.h = t, this.$node.css("height", t)
370                }
371            }, {
372                key: "updateWidth",
373                value: function() {
374                    this.props.w = this.getWidth()
375                }
376            }, {
377                key: "updateFilterItemsDimensions",
378                value: function() {
379                    this.props.FilterItems.forEach((function(t) {
380                        return t.updateDimensions()
381                    }))
382                }
383            }, {
384                key: "getWidth",
385                value: function() {
386                    return this.$node.innerWidth()
387                }
388            }, {
389                key: "bindTransitionEnd",
390                value: function(t, e) {
391                    this.$node.on(o.l, Object(o.e)((function() {
392                        t()
393                    }), e))
394                }
395            }, {
396                key: "bindEvents",
397                value: function(t) {
398                    this.$node.on("filteringStart.Filterizr", t.onFilteringStart), this.$node.on("filteringEnd.Filterizr", t.onFilteringEnd), this.$node.on("shufflingStart.Filterizr", t.onShufflingStart), this.$node.on("shufflingEnd.Filterizr", t.onShufflingEnd), this.$node.on("sortingStart.Filterizr", t.onSortingStart), this.$node.on("sortingEnd.Filterizr", t.onSortingEnd)
399                }
400            }, {
401                key: "unbindEvents",
402                value: function() {
403                    this.$node.off(o.l + "\n      filteringStart.Filterizr \n      filteringEnd.Filterizr \n      shufflingStart.Filterizr \n      shufflingEnd.Filterizr \n      sortingStart.Filterizr \n      sortingEnd.Filterizr")
404                }
405            }, {
406                key: "trigger",
407                value: function(t) {
408                    this.$node.trigger(t)
409                }
410            }]), t
411        }();
412    e.a = l
413}, function(t, e, r) {
414    "use strict";
415    var i = r(0),
416        n = function() {
417            function t(t, e) {
418                for (var r = 0; r < e.length; r++) {
419                    var i = e[r];
420                    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i)
421                }
422            }
423            return function(e, r, i) {
424                return r && t(e.prototype, r), i && t(e, i), e
425            }
426        }(),
427        o = function() {
428            function t(e, r, i) {
429                var n = this;
430                ! function(t, e) {
431                    if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
432                }(this, t);
433                var o = i.delay,
434                    s = i.delayMode,
435                    a = i.filterOutCss,
436                    l = i.animationDuration,
437                    u = i.easing;
438                this.$node = e, this.props = {
439                    data: function() {
440                        var t = n.$node.data();
441                        return delete t.category, delete t.sort, t
442                    }(),
443                    index: r,
444                    sortData: this.$node.data("sort"),
445                    lastPosition: {
446                        left: 0,
447                        top: 0
448                    },
449                    filteredOut: !1,
450                    w: this.getWidth(),
451                    h: this.getHeight()
452                }, this.$node.css(a).css({
453                    "-webkit-backface-visibility": "hidden",
454                    perspective: "1000px",
455                    "-webkit-perspective": "1000px",
456                    "-webkit-transform-style": "preserve-3d",
457                    position: "absolute",
458                    transition: "all " + l + "s " + u + " " + this.calcDelay(o, s) + "ms"
459                }), this.bindEvents()
460            }
461            return n(t, [{
462                key: "filterIn",
463                value: function(t, e) {
464                    var r = Object(i.h)(e);
465                    r.transform += " translate3d(" + t.left + "px," + t.top + "px, 0)", this.$node.css(r), this.props.lastPosition = t, this.props.filteredOut = !1
466                }
467            }, {
468                key: "filterOut",
469                value: function(t) {
470                    var e = Object(i.h)(t),
471                        r = this.props.lastPosition;
472                    e.transform += " translate3d(" + r.left + "px," + r.top + "px, 0)", this.$node.css(e), this.props.filteredOut = !0
473                }
474            }, {
475                key: "calcDelay",
476                value: function(t, e) {
477                    var r = 0;
478                    return "progressive" === e ? r = t * this.props.index : this.props.index % 2 == 0 && (r = t), r
479                }
480            }, {
481                key: "contentsMatchSearch",
482                value: function(t) {
483                    return Boolean(this.getContentsLowercase().includes(t))
484                }
485            }, {
486                key: "getContentsLowercase",
487                value: function() {
488                    return this.$node.text().toLowerCase()
489                }
490            }, {
491                key: "getCategories",
492                value: function() {
493                    return this.$node.attr("data-category").split(/\s*,\s*/g)
494                }
495            }, {
496                key: "getHeight",
497                value: function() {
498                    return this.$node.innerHeight()
499                }
500            }, {
501                key: "getWidth",
502                value: function() {
503                    return this.$node.innerWidth()
504                }
505            }, {
506                key: "trigger",
507                value: function(t) {
508                    this.$node.trigger(t)
509                }
510            }, {
511                key: "updateDimensions",
512                value: function() {
513                    this.props.w = this.getWidth(), this.props.h = this.getHeight()
514                }
515            }, {
516                key: "bindEvents",
517                value: function() {
518                    var t = this;
519                    this.$node.on(i.l, (function() {
520                        var e = t.props.filteredOut;
521                        t.$node.toggleClass("filteredOut", e), t.$node.css("z-index", e ? -1e3 : "")
522                    }))
523                }
524            }, {
525                key: "unbindEvents",
526                value: function() {
527                    this.$node.off(i.l)
528                }
529            }]), t
530        }();
531    e.a = o
532}, function(t, e, r) {
533    "use strict";
534    e.a = {
535        animationDuration: .5,
536        callbacks: {
537            onFilteringStart: function() {},
538            onFilteringEnd: function() {},
539            onShufflingStart: function() {},
540            onShufflingEnd: function() {},
541            onSortingStart: function() {},
542            onSortingEnd: function() {}
543        },
544        controlsSelector: "",
545        delay: 0,
546        delayMode: "progressive",
547        easing: "ease-out",
548        filter: "all",
549        filterOutCss: {
550            opacity: 0,
551            transform: "scale(0.5)"
552        },
553        filterInCss: {
554            opacity: 1,
555            transform: "scale(1)"
556        },
557        layout: "sameSize",
558        multifilterLogicalOperator: "or",
559        setupControls: !0
560    }
561}, function(t, e, r) {
562    t.exports = r(5)
563}, function(t, e, r) {
564    "use strict";
565
566    function i(t) {
567        if (Array.isArray(t)) {
568            for (var e = 0, r = Array(t.length); e < t.length; e++) r[e] = t[e];
569            return r
570        }
571        return Array.from(t)
572    }
573    Object.defineProperty(e, "__esModule", {
574        value: !0
575    });
576    var n = r(6),
577        o = r(1),
578        s = r(2),
579        a = r(3);
580    r.d(e, "Filterizr", (function() {
581        return n.a
582    })), r.d(e, "FilterContainer", (function() {
583        return o.a
584    })), r.d(e, "FilterItem", (function() {
585        return s.a
586    })), r.d(e, "DefaultOptions", (function() {
587        return a.a
588    }));
589    var l, u, c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
590        return typeof t
591    } : function(t) {
592        return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
593    };
594    l = u = window.jQuery,
595        function(t) {
596            if (!t) throw new Error("Filterizr requires jQuery to work.");
597            t.fn.filterizr = function() {
598                var e = "." + t.trim(this.get(0).className).replace(/\s+/g, "."),
599                    r = arguments;
600                if (!this._fltr && 0 === r.length || 1 === r.length && "object" === c(r[0])) {
601                    var o = r.length > 0 ? r[0] : a.a;
602                    this._fltr = new n.a(e, o)
603                } else if (r.length >= 1 && "string" == typeof r[0]) {
604                    var s = r[0],
605                        l = Array.prototype.slice.call(r, 1),
606                        u = this._fltr;
607                    switch (s) {
608                        case "filter":
609                            return u.filter.apply(u, i(l)), this;
610                        case "insertItem":
611                            return u.insertItem.apply(u, i(l)), this;
612                        case "toggleFilter":
613                            return u.toggleFilter.apply(u, i(l)), this;
614                        case "sort":
615                            return u.sort.apply(u, i(l)), this;
616                        case "shuffle":
617                            return u.shuffle.apply(u, i(l)), this;
618                        case "search":
619                            return u.search.apply(u, i(l)), this;
620                        case "setOptions":
621                            return u.setOptions.apply(u, i(l)), this;
622                        case "destroy":
623                            return u.destroy.apply(u, i(l)), delete this._fltr, this;
624                        default:
625                            throw new Error("Filterizr: " + s + " is not part of the Filterizr API. Please refer to the docs for more information.")
626                    }
627                }
628                return this
629            }
630        }(u), e.default = l, r(15)
631}, function(t, e, r) {
632    "use strict";
633
634    function i(t, e) {
635        if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
636    }
637    var n = r(7),
638        o = r(1),
639        s = r(8),
640        a = r(3),
641        l = r(0),
642        u = function() {
643            function t(t, e) {
644                for (var r = 0; r < e.length; r++) {
645                    var i = e[r];
646                    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i)
647                }
648            }
649            return function(e, r, i) {
650                return r && t(e.prototype, r), i && t(e, i), e
651            }
652        }(),
653        c = window.jQuery,
654        f = function() {
655            function t() {
656                var e = arguments.length >
656 0 && void 0 !== arguments[0] ? arguments[0] : ".filtr-container",
657                    r = arguments[1];
658                i(this, t), this.options = Object(l.i)(a.a, r);
659                var s = new o.a(e, this.options);
660                if (!s.$node.length) throw new Error("Filterizr: could not find a container with the selector " + e + ", to initialize Filterizr.");
661                new n.a(this, this.options.controlsSelector), this.props = {
662                    filterizrState: l.a.IDLE,
663                    searchTerm: "",
664                    sort: "index",
665                    sortOrder: "asc",
666                    FilterContainer: s,
667                    FilterItems: s.props.FilterItems,
668                    FilteredItems: []
669                }, this.bindEvents(), this.filter(this.options.filter)
670            }
671            return u(t, [{
672                key: "filter",
673                value: function(t) {
674                    var e = this.props,
675                        r = e.searchTerm,
676                        i = e.FilterContainer,
677                        n = e.FilterItems;
678                    i.trigger("filteringStart"), this.props.filterizrState = l.a.FILTERING, t = Array.isArray(t) ? t.map((function(t) {
679                        return t.toString()
680                    })) : t.toString();
681                    var o = this.searchFilterItems(this.filterFilterItems(n, t), r);
682                    this.props.FilteredItems = o, this.render(o)
683                }
684            }, {
685                key: "destroy",
686                value: function() {
687                    var t = this.props.FilterContainer,
688                        e = this.options.controlsSelector;
689                    t.destroy(), c(window).off("resize.Filterizr"), c(e + "[data-filter]").off("click.Filterizr"), c(e + "[data-multifilter]").off("click.Filterizr"), c(e + "[data-shuffle]").off("click.Filterizr"), c(e + "[data-search]").off("keyup.Filterizr"), c(e + "[data-sortAsc]").off("click.Filterizr"), c(e + "[data-sortDesc]").off("click.Filterizr")
690                }
691            }, {
692                key: "insertItem",
693                value: function(t) {
694                    var e = this.props.FilterContainer,
695                        r = t.clone().attr("style", "");
696                    e.push(r, this.options);
697                    var i = this.filterFilterItems(this.props.FilterItems, this.options.filter);
698                    this.render(i)
699                }
700            }, {
701                key: "sort",
702                value: function() {
703                    var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "index",
704                        e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "asc",
705                        r = this.props,
706                        i = r.FilterContainer,
707                        n = r.FilterItems;
708                    i.trigger("sortingStart"), this.props.filterizrState = l.a.SORTING, this.props.FilterItems = this.sortFilterItems(n, t, e);
709                    var o = this.filterFilterItems(this.props.FilterItems, this.options.filter);
710                    this.props.FilteredItems = o, this.render(o)
711                }
712            }, {
713                key: "search",
714                value: function() {
715                    var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.props.searchTerm,
716                        e = this.props.FilterItems,
717                        r = this.searchFilterItems(this.filterFilterItems(e, this.options.filter), t);
718                    this.props.FilteredItems = r, this.render(r)
719                }
720            }, {
721                key: "shuffle",
722                value: function() {
723                    var t = this.props,
724                        e = t.FilterContainer,
725                        r = t.FilteredItems;
726                    e.trigger("shufflingStart"), this.props.filterizrState = l.a.SHUFFLING;
727                    var i = this.shuffleFilterItems(r);
728                    this.props.FilteredItems = i, this.render(i)
729                }
730            }, {
731                key: "setOptions",
732                value: function(t) {
733                    Object(l.c)("animationDuration", t.animationDuration, "number"), Object(l.c)("callbacks", t.callbacks, "object"), Object(l.c)("controlsSelector", t.controlsSelector, "string"), Object(l.c)("delay", t.delay, "number"), Object(l.c)("easing", t.easing, "string", l.d, "https://www.w3schools.com/cssref/css3_pr_transition-timing-function.asp"), Object(l.c)("delayMode", t.delayMode, "string", ["progressive", "alternate"]), Object(l.c)("filter", t.filter, "string|number|array"), Object(l.c)("filterOutCss", t.filterOutCss, "object"), Object(l.c)("filterInCss", t.filterOutCss, "object"), Object(l.c)("layout", t.layout, "string", ["sameSize", "vertical", "horizontal", "sameHeight", "sameWidth", "packed"]), Object(l.c)("multifilterLogicalOperator", t.multifilterLogicalOperator, "string", ["and", "or"]), Object(l.c)("setupControls", t.setupControls, "boolean"), this.options = Object(l.i)(this.options, t), (t.animationDuration || t.delay || t.delayMode || t.easing) && this.props.FilterContainer.updateFilterItemsTransitionStyle(t.animationDuration, t.easing, t.delay, t.delayMode), (t.callbacks || t.animationDuration) && this.rebindFilterContainerEvents(), t.filter && this.filter(t.filter), t.multifilterLogicalOperator && this.filter(this.options.filter)
734                }
735            }, {
736                key: "toggleFilter",
737                value: function(t) {
738                    var e = this.options.filter;
739                    "all" === e ? e = t : Array.isArray(e) ? e.includes(t) ? 1 === (e = e.filter((function(e) {
740                        return e !== t
741                    }))).length && (e = e[0]) : e.push(t) : e = e === t ? "all" : [e, t], this.options.filter = e, this.filter(this.options.filter)
742                }
743            }, {
744                key: "filterFilterItems",
745                value: function(t, e) {
746                    var r = this.options.multifilterLogicalOperator;
747                    return "all" === e ? t : t.filter((function(t) {
748                        var i = t.getCategories();
749                        return Array.isArray(e) ? "or" === r ? Ob
749ject(l.g)(i, e).length : Object(l.b)(e, i) : i.includes(e)
750                    }))
751                }
752            }, {
753                key: "sortFilterItems",
754                value: function(t) {
755                    var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "index",
756                        r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "asc",
757                        i = Object(l.k)(t, (function(t) {
758                            return "index" !== e && "sortData" !== e ? t.props.data[e] : t.props[e]
759                        }));
760                    return "asc" === r ? i : i.reverse()
761                }
762            }, {
763                key: "searchFilterItems",
764                value: function(t) {
765                    var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.props.searchTerm;
766                    return e ? t.filter((function(t) {
767                        return t.contentsMatchSearch(e)
768                    })) : t
769                }
770            }, {
771                key: "shuffleFilterItems",
772                value: function(t) {
773                    for (var e = Object(l.j)(t); t.length > 1 && Object(l.f)(t, e);) e = Object(l.j)(t);
774                    return e
775                }
776            }, {
777                key: "render",
778                value: function(t) {
779                    var e = this,
780                        r = this.options,
781                        i = r.filter,
782                        n = r.filterInCss,
783                        o = r.filterOutCss,
784                        a = r.layout,
785                        u = r.multifilterLogicalOperator;
786                    this.props.FilterItems.filter((function(t) {
787                        var r = t.getCategories(),
788                            n = Array.isArray(i),
789                            o = t.contentsMatchSearch(e.props.searchTerm);
790                        return !(n ? "or" === u ? Object(l.g)(r, i).length : Object(l.b)(i, r) : r.includes(i)) || !o
791                    })).forEach((function(t) {
792                        t.filterOut(o)
793                    }));
794                    var c = Object(s.a)(a, this);
795                    t.forEach((function(t, e) {
796                        t.filterIn(c[e], n)
797                    }))
798                }
799            }, {
800                key: "onTransitionEndCallback",
801                value: function() {
802                    var t = this.props,
803                        e = t.filterizrState,
804                        r = t.FilterContainer;
805                    switch (e) {
806                        case l.a.FILTERING:
807                            r.trigger("filteringEnd");
808                            break;
809                        case l.a.SORTING:
810                            r.trigger("sortingEnd");
811                            break;
812                        case l.a.SHUFFLING:
813                            r.trigger("shufflingEnd")
814                    }
815                    this.props.filterizrState = l.a.IDLE
816                }
817            }, {
818                key: "rebindFilterContainerEvents",
819                value: function() {
820                    var t = this,
821                        e = this.props.FilterContainer,
822                        r = this.options,
823                        i = r.animationDuration,
824                        n = r.callbacks;
825                    e.unbindEvents(), e.bindEvents(n), e.bindTransitionEnd((function() {
826                        t.onTransitionEndCallback()
827                    }), i)
828                }
829            }, {
830                key: "bindEvents",
831                value: function() {
832                    var t = this,
833                        e = this.props.FilterContainer;
834                    this.rebindFilterContainerEvents(), c(window).on("resize.Filterizr", Object(l.e)((function() {
835                        e.updateWidth(), e.updateFilterItemsDimensions(), t.filter(t.options.filter)
836                    }), 250))
837                }
838            }]), t
839        }();
840    e.a = f
841}, function(t, e, r) {
842    "use strict";
843
844    function i(t, e) {
845        if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
846    }
847    var n = r(0),
848        o = function() {
849            function t(t, e) {
850                for (var r = 0; r < e.length; r++) {
851                    var i = e[r];
852                    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i)
853                }
854            }
855            return function(e, r, i) {
856                return r && t(e.prototype, r), i && t(e, i), e
857            }
858        }(),
859        s = window.jQuery,
860        a = function() {
861            function t(e) {
862                var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "";
863                i(this, t), this.props = {
864                    Filterizr: e,
865                    selector: r
866                }, this.setupFilterControls(), this.setupShuffleControls(), this.setupSearchControl
866s(), this.setupSortControls()
867            }
868            return o(t, [{
869                key: "setupFilterControls",
870                value: function() {
871                    var t = this.props,
872                        e = t.Filterizr,
873                        r = t.selector;
874                    s(r + "[data-filter]").on("click.Filterizr", (function(t) {
875                        var r = s(t.currentTarget).attr("data-filter");
876                        e.options.filter = r, e.filter(e.options.filter)
877                    })), s(r + "[data-multifilter]").on("click.Filterizr", (function(t) {
878                        var r = s(t.target).attr("data-multifilter");
879                        e.toggleFilter(r)
880                    }))
881                }
882            }, {
883                key: "setupShuffleControls",
884                value: function() {
885                    var t = this.props,
886                        e = t.Filterizr,
887                        r = t.selector;
888                    s(r + "[data-shuffle]").on("click.Filterizr", (function() {
889                        e.shuffle()
890                    }))
891                }
892            }, {
893                key: "setupSearchControls",
894                value: function() {
895                    var t = this.props,
896                        e = t.Filterizr,
897                        r = t.selector;
898                    s(r + "[data-search]").on("keyup.Filterizr", Object(n.e)((function(t) {
899                        var r = s(t.target).val();
900                        e.props.searchTerm = r.toLowerCase(), e.search(e.props.searchTerm)
901                    }), 250))
902                }
903            }, {
904                key: "setupSortControls",
905                value: function() {
906                    var t = this.props,
907                        e = t.Filterizr,
908                        r = t.selector;
909                    s(r + "[data-sortAsc]").on("click.Filterizr", (function() {
910                        var t = s(r + "[data-sortOrder]").val();
911                        e.props.sortOrder = "asc", e.sort(t, "asc")
912                    })), s(r + "[data-sortDesc]").on("click.Filterizr", (function() {
913                        var t = s(r + "[data-sortOrder]").val();
914                        e.props.sortOrder = "desc", e.sort(t, "desc")
915                    }))
916                }
917            }]), t
918        }();
919    e.a = a
920}, function(t, e, r) {
921    "use strict";
922    var i = r(9),
923        n = r(10),
924        o = r(11),
925        s = r(12),
926        a = r(13),
927        l = r(14);
928    e.a = function(t, e) {
929        switch (t) {
930            case "horizontal":
931                return Object(i.a)(e);
932            case "vertical":
933                return Object(n.a)(e);
934            case "sameHeight":
935                return Object(o.a)(e);
936            case "sameWidth":
937                return Object(s.a)(e);
938            case "sameSize":
939                return Object(a.a)(e);
940            case "packed":
941                return Object(l.a)(e);
942            default:
943                return Object(a.a)(e)
944        }
945    }
946}, function(t, e, r) {
947    "use strict";
948    e.a = function(t) {
949        var e = t.props,
950            r = e.FilterContainer,
951            i = e.FilteredItems,
952            n = 0,
953            o = 0,
954            s = i.map((function(t) {
955                var e = t.props,
956                    r = e.w,
957                    i = e.h,
958                    s = {
959                        left: n,
960                        top: 0
961                    };
962                return n += r, i > o && (o = i), s
963            }));
964        return r.updateHeight(o), s
965    }
966}, function(t, e, r) {
967    "use strict";
968    e.a = function(t) {
969        var e = t.props,
970            r = e.FilterContainer,
971            i = e.FilteredItems,
972            n = 0,
973            o = i.map((function(t) {
974                var e = t.props.h,
975                    r = {
976                        left: 0,
977                        top: n
978                    };
979                return n += e, r
980            }));
981        return r.updateHeight(n), o
982    }
983}, function(t, e, r) {
984    "use strict";
985    e.a = function(t) {
986        var e = t.props,
987            r = e.FilterContainer,
988            i = e.FilteredItems,
989            n = r.props.w,
990            o = i[0].props.h,
991            s = 0,
992            a = 0,
993            l = i.map((function(t) {
994                var e = t.props.w;
995                a + e > n && (s++, a = 0);
996                var r = {
997                    left: a,
998                    top: o * s
999                };
1000                return a += e, r
1001            }));
1002        return r.updateHeight((s + 1) * i[0].props.h), l
1003    }
1004}, function(t, e, r) {
1005    "use strict";
1006    var i = function(t, e, r) {
1007        var i = 0;
1008        if (r < e - 1) return 0;
1009        for (r -= e; r >= 0;) i += t[r].props.h, r -= e;
1010        return i
1011    };
1012    e.a = function(t) {
1013        var e = t.props,
1014            r = e.FilterContainer,
1015            n = e.FilteredItems,
1016            o = r.calcColumns(),
1017            s = 0,
1018            a = Array.apply(null, Array(o)).map(Number.prototype.valueOf, 0),
1019            l = n.map((function(t, e) {
1020                var r = t.props,
1021                    l = r.w,
1022                    u = r.h;
1023                e % o == 0 && e >= o && s++;
1024                var c = e - o * s;
1025                return a[c] += u, {
1026                    left: c * l,
1027                    top: i(n, o, e)
1028                }
1029            }));
1030        return r.updateHeight(Math.max.apply(Math, function(t) {
1031            if (Array.isArray(t)) {
1032                for (var e = 0, r = Array(t.length); e < t.length; e++) r[e] = t[e];
1033                return r
1034            }
1035            return Array.from(t)
1036        }(a))), l
1037    }
1038}, function(t, e, r) {
1039    "use strict";
1040    e.a = function(t) {
1041        var e = t.props,
1042            r = e.FilterContainer,
1043            i = e.FilteredItems,
1044            n = r.calcColumns(),
1045            o = 0,
1046            s = i.map((function(t, e) {
1047                return e % n == 0 && e >= n && o++, {
1048                    left: (e - n * o) * t.props.w,
1049                    top: o * t.props.h
1050                }
1051            })),
1052            a = i[0] && i[0].props.h || 0;
1053        return r.updateHeight((o + 1) * a), s
1054    }
1055}, function(t, e, r) {
1056    "use strict";
1057    var i = function(t) {
1058        this.init(t)
1059    };
1060    i.prototype = {
1061        init: function(t) {
1062            this.root = {
1063                x: 0,
1064                y: 0,
1065                w: t
1066            }
1067        },
1068        fit: function(t) {
1069            var e, r, i, n = t.length,
1070                o = n > 0 ? t[0].h : 0;
1071            for (this.root.h = o, e = 0; e < n; e++) i = t[e], (r = this.findNode(this.root, i.w, i.h)) ? i.fit = this.splitNode(r, i.w, i.h) : i.fit = this.growDown(i.w, i.h)
1072        },
1073        findNode: function(t, e, r) {
1074            return t.used ? this.findNode(t.right, e, r) || this.findNode(t.down, e, r) : e <= t.w && r <= t.h ? t : null
1075        },
1076        splitNode: function(t, e, r) {
1077            return t.used = !0, t.down = {
1078                x: t.x,
1079                y: t.y + r,
1080                w: t.w,
1081                h: t.h - r
1082            }, t.right = {
1083                x: t.x + e,
1084                y: t.y,
1085                w: t.w - e,
1086                h: r
1087            }, t
1088        },
1089        growDown: function(t, e) {
1090            var r;
1091            return this.root = {
1092                used: !0,
1093                x: 0,
1094                y: 0,
1095                w: this.root.w,
1096                h: this.root.h + e,
1097                down: {
1098                    x: 0,
1099                    y: this.root.h,
1100                    w: this.root.w,
1101                    h: e
1102                },
1103                right: this.root
1104            }, (r = this.findNode(this.root, t, e)) ? this.splitNode(r, t, e) : null
1105        }
1106    }, e.a = function(t) {
1107        var e = t.props,
1108            r = e.FilterContainer,
1109            n = e.FilteredItems,
1110            o = new i(r.props.w),
1111            s = n.map((function(t) {
1112                var e = t.props;
1113                return {
1114                    w: e.w,
1115                    h: e.h
1116                }
1117            }));
1118        o.fit(s);
1119        var a = s.map((function(t) {
1120            var e = t.fit;
1121            return {
1122                left: e.x,
1123                top: e.y
1124            }
1125        }));
1126        return r.updateHeight(o.root.h), a
1127    }
1128}, function(t, e, r) {}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.