-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathvue-draggable-nested-tree.min.js
7 lines (7 loc) · 61.3 KB
/
vue-draggable-nested-tree.min.js
1
2
3
4
5
6
7
/*!
* vue-draggable-nested-tree v2.3.0-beta.1
* (c) 2018-present phphe <phphe@outlook.com>
* Released under the MIT License.
*/
!function (t, e) { "object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e(t.vueDraggableNestedTree = {}) }(this, function (t) { "use strict"; var e = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t }, r = function (t) { return Object(e(t)) }, n = {}.hasOwnProperty, i = function (t, e) { return n.call(t, e) }, o = {}.toString, a = function (t) { return o.call(t).slice(8, -1) }, c = Object("z").propertyIsEnumerable(0) ? Object : function (t) { return "String" == a(t) ? t.split("") : Object(t) }, l = function (t) { return c(e(t)) }, u = Math.ceil, s = Math.floor, d = function (t) { return isNaN(t = +t) ? 0 : (t > 0 ? s : u)(t) }, f = Math.min, p = Math.max, h = Math.min; function g(t, e) { return t(e = { exports: {} }, e.exports), e.exports } var v, y = g(function (t) { var e = t.exports = { version: "2.6.1" }; "number" == typeof __e && (__e = e) }), m = (y.version, g(function (t) { var e = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = e) })), b = g(function (t) { var e = m["__core-js_shared__"] || (m["__core-js_shared__"] = {}); (t.exports = function (t, r) { return e[t] || (e[t] = void 0 !== r ? r : {}) })("versions", []).push({ version: y.version, mode: "pure", copyright: "© 2018 Denis Pushkarev (zloirock.ru)" }) }), _ = 0, N = Math.random(), S = function (t) { return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++_ + N).toString(36)) }, O = b("keys"), x = function (t) { return O[t] || (O[t] = S(t)) }, T = (v = !1, function (t, e, r) { var n, i, o = l(t), a = (n = o.length) > 0 ? f(d(n), 9007199254740991) : 0, c = function (t, e) { return (t = d(t)) < 0 ? p(t + e, 0) : h(t, e) }(r, a); if (v && e != e) { for (; a > c;)if ((i = o[c++]) != i) return !0 } else for (; a > c; c++)if ((v || c in o) && o[c] === e) return v || c || 0; return !v && -1 }), E = x("IE_PROTO"), w = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), P = Object.keys || function (t) { return function (t, e) { var r, n = l(t), o = 0, a = []; for (r in n) r != E && i(n, r) && a.push(r); for (; e.length > o;)i(n, r = e[o++]) && (~T(a, r) || a.push(r)); return a }(t, w) }, k = function (t, e, r) { if (function (t) { if ("function" != typeof t) throw TypeError(t + " is not a function!") }(t), void 0 === e) return t; switch (r) { case 1: return function (r) { return t.call(e, r) }; case 2: return function (r, n) { return t.call(e, r, n) }; case 3: return function (r, n, i) { return t.call(e, r, n, i) } }return function () { return t.apply(e, arguments) } }, j = function (t) { return "object" == typeof t ? null !== t : "function" == typeof t }, L = function (t) { if (!j(t)) throw TypeError(t + " is not an object!"); return t }, A = function (t) { try { return !!t() } catch (t) { return !0 } }, I = !A(function () { return 7 != Object.defineProperty({}, "a", { get: function () { return 7 } }).a }), C = m.document, M = j(C) && j(C.createElement), R = function (t) { return M ? C.createElement(t) : {} }, F = !I && !A(function () { return 7 != Object.defineProperty(R("div"), "a", { get: function () { return 7 } }).a }), D = Object.defineProperty, B = { f: I ? Object.defineProperty : function (t, e, r) { if (L(t), e = function (t, e) { if (!j(t)) return t; var r, n; if (e && "function" == typeof (r = t.toString) && !j(n = r.call(t))) return n; if ("function" == typeof (r = t.valueOf) && !j(n = r.call(t))) return n; if (!e && "function" == typeof (r = t.toString) && !j(n = r.call(t))) return n; throw TypeError("Can't convert object to primitive value") }(e, !0), L(r), F) try { return D(t, e, r) } catch (t) { } if ("get" in r || "set" in r) throw TypeError("Accessors not supported!"); return "value" in r && (t[e] = r.value), t } }, $ = function (t, e) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: e } }, H = I ? function (t, e, r) { return B.f(t, e, $(1, r)) } : function (t, e, r) { return t[e] = r, t }, V = function (t, e, r) { var n, o, a, c = t & V.F, l = t & V.G, u = t & V.S, s = t & V.P, d = t & V.B, f = t & V.W, p = l ? y : y[e] || (y[e] = {}), h = p.prototype, g = l ? m : u ? m[e] : (m[e] || {}).prototype; for (n in l && (r = e), r) (o = !c && g && void 0 !== g[n]) && i(p, n) || (a = o ? g[n] : r[n], p[n] = l && "function" != typeof g[n] ? r[n] : d && o ? k(a, m) : f && g[n] == a ? function (t) { var e = function (e, r, n) { if (this instanceof t) { switch (arguments.length) { case 0: return new t; case 1: return new t(e); case 2: return new t(e, r) }return new t(e, r, n) } return t.apply(this, arguments) }; return e.prototype = t.prototype, e }(a) : s && "function" == typeof a ? k(Function.call, a) : a, s && ((p.virtual || (p.virtual = {}))[n] = a, t & V.R && h && !h[n] && H(h, n, a))) }; V.F = 1, V.G = 2, V.S = 4, V.P = 8, V.B = 16, V.W = 32, V.U = 64, V.R = 128; var G = V; !function (t, e) { var r = (y.Object || {})[t] || Object[t], n = {}; n[t] = e(r), G(G.S + G.F * A(function () { r(1) }), "Object", n) }("keys", function () { return function (t) { return P(r(t)) } }); var W = y.Object.keys, q = g(function (t) { var e = t.exports = { version: "2.6.1" }; "number" == typeof __e && (__e = e) }), Y = (q.version, g(function (t) { var e = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = e) })), U = g(function (t) { var e = Y["__core-js_shared__"] || (Y["__core-js_shared__"] = {}); (t.exports = function (t, r) { return e[t] || (e[t] = void 0 !== r ? r : {}) })("versions", []).push({ version: q.version, mode: "global", copyright: "© 2018 Denis Pushkarev (zloirock.ru)" }) }), z = 0, X = Math.random(), J = function (t) { return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++z + X).toString(36)) }, K = g(function (t) { var e = U("wks"), r = Y.Symbol, n = "function" == typeof r; (t.exports = function (t) { return e[t] || (e[t] = n && r[t] || (n ? r : J)("Symbol." + t)) }).store = e }), Q = function (t) { return "object" == typeof t ? null !== t : "function" == typeof t }, Z = function (t) { if (!Q(t)) throw TypeError(t + " is not an object!"); return t }, tt = function (t) { try { return !!t() } catch (t) { return !0 } }, et = !tt(function () { return 7 != Object.defineProperty({}, "a", { get: function () { return 7 } }).a }), rt = Y.document, nt = Q(rt) && Q(rt.createElement), it = function (t) { return nt ? rt.createElement(t) : {} }, ot = !et && !tt(function () { return 7 != Object.defineProperty(it("div"), "a", { get: function () { return 7 } }).a }), at = function (t, e) { if (!Q(t)) return t; var r, n; if (e && "function" == typeof (r = t.toString) && !Q(n = r.call(t))) return n; if ("function" == typeof (r = t.valueOf) && !Q(n = r.call(t))) return n; if (!e && "function" == typeof (r = t.toString) && !Q(n = r.call(t))) return n; throw TypeError("Can't convert object to primitive value") }, ct = Object.defineProperty, lt = { f: et ? Object.defineProperty : function (t, e, r) { if (Z(t), e = at(e, !0), Z(r), ot) try { return ct(t, e, r) } catch (t) { } if ("get" in r || "set" in r) throw TypeError("Accessors not supported!"); return "value" in r && (t[e] = r.value), t } }, ut = function (t, e) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: e } }, st = et ? function (t, e, r) { return lt.f(t, e, ut(1, r)) } : function (t, e, r) { return t[e] = r, t }, dt = K("unscopables"), ft = Array.prototype; null == ft[dt] && st(ft, dt, {}); var pt = function (t) { ft[dt][t] = !0 }, ht = function (t, e) { return { value: e, done: !!t } }, gt = {}, vt = {}.toString, yt = function (t) { return vt.call(t).slice(8, -1) }, mt = Object("z").propertyIsEnumerable(0) ? Object : function (t) { return "String" == yt(t) ? t.split("") : Object(t) }, bt = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t }, _t = function (t) { return mt(bt(t)) }, Nt = {}.hasOwnProperty, St = function (t, e) { return Nt.call(t, e) }, Ot = g(function (t) { var e = J("src"), r = Function.toString, n = ("" + r).split("toString"); q.inspectSource = function (t) { return r.call(t) }, (t.exports = function (t, r, i, o) { var a = "function" == typeof i; a && (St(i, "name") || st(i, "name", r)), t[r] !== i && (a && (St(i, e) || st(i, e, t[r] ? "" + t[r] : n.join(String(r)))), t === Y ? t[r] = i : o ? t[r] ? t[r] = i : st(t, r, i) : (delete t[r], st(t, r, i))) })(Function.prototype, "toString", function () { return "function" == typeof this && this[e] || r.call(this) }) }), xt = function (t, e, r) { if (function (t) { if ("function" != typeof t) throw TypeError(t + " is not a function!") }(t), void 0 === e) return t; switch (r) { case 1: return function (r) { return t.call(e, r) }; case 2: return function (r, n) { return t.call(e, r, n) }; case 3: return function (r, n, i) { return t.call(e, r, n, i) } }return function () { return t.apply(e, arguments) } }, Tt = function (t, e, r) { var n, i, o, a, c = t & Tt.F, l = t & Tt.G, u = t & Tt.S, s = t & Tt.P, d = t & Tt.B, f = l ? Y : u ? Y[e] || (Y[e] = {}) : (Y[e] || {}).prototype, p = l ? q : q[e] || (q[e] = {}), h = p.prototype || (p.prototype = {}); for (n in l && (r = e), r) o = ((i = !c && f && void 0 !== f[n]) ? f : r)[n], a = d && i ? xt(o, Y) : s && "function" == typeof o ? xt(Function.call, o) : o, f && Ot(f, n, o, t & Tt.U), p[n] != o && st(p, n, a), s && h[n] != o && (h[n] = o) }; Y.core = q, Tt.F = 1, Tt.G = 2, Tt.S = 4, Tt.P = 8, Tt.B = 16, Tt.W = 32, Tt.U = 64, Tt.R = 128; var Et = Tt, wt = Math.ceil, Pt = Math.floor, kt = function (t) { return isNaN(t = +t) ? 0 : (t > 0 ? Pt : wt)(t) }, jt = Math.min, Lt = function (t) { return t > 0 ? jt(kt(t), 9007199254740991) : 0 }, At = Math.max, It = Math.min, Ct = U("keys"), Mt = function (t) { return Ct[t] || (Ct[t] = J(t)) }, Rt = function (t) { return function (e, r, n) { var i, o = _t(e), a = Lt(o.length), c = function (t, e) { return (t = kt(t)) < 0 ? At(t + e, 0) : It(t, e) }(n, a); if (t && r != r) { for (; a > c;)if ((i = o[c++]) != i) return !0 } else for (; a > c; c++)if ((t || c in o) && o[c] === r) return t || c || 0; return !t && -1 } }(!1), Ft = Mt("IE_PROTO"), Dt = function (t, e) { var r, n = _t(t), i = 0, o = []; for (r in n) r != Ft && St(n, r) && o.push(r); for (; e.length > i;)St(n, r = e[i++]) && (~Rt(o, r) || o.push(r)); return o }, Bt = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), $t = Object.keys || function (t) { return Dt(t, Bt) }, Ht = et ? Object.defineProperties : function (t, e) { Z(t); for (var r, n = $t(e), i = n.length, o = 0; i > o;)lt.f(t, r = n[o++], e[r]); return t }, Vt = Y.document, Gt = Vt && Vt.documentElement, Wt = Mt("IE_PROTO"), qt = function () { }, Yt = function () { var t, e = it("iframe"), r = Bt.length; for (e.style.display = "none", Gt.appendChild(e), e.src = "javascript:", (t = e.contentWindow.document).open(), t.write("<script>document.F=Object<\/script>"), t.close(), Yt = t.F; r--;)delete Yt.prototype[Bt[r]]; return Yt() }, Ut = Object.create || function (t, e) { var r; return null !== t ? (qt.prototype = Z(t), r = new qt, qt.prototype = null, r[Wt] = t) : r = Yt(), void 0 === e ? r : Ht(r, e) }, zt = lt.f, Xt = K("toStringTag"), Jt = function (t, e, r) { t && !St(t = r ? t : t.prototype, Xt) && zt(t, Xt, { configurable: !0, value: e }) }, Kt = {}; st(Kt, K("iterator"), function () { return this }); var Qt = function (t, e, r) { t.prototype = Ut(Kt, { next: ut(1, r) }), Jt(t, e + " Iterator") }, Zt = function (t) { return Object(bt(t)) }, te = Mt("IE_PROTO"), ee = Object.prototype, re = Object.getPrototypeOf || function (t) { return t = Zt(t), St(t, te) ? t[te] : "function" == typeof t.constructor && t instanceof t.constructor ? t.constructor.prototype : t instanceof Object ? ee : null }, ne = K("iterator"), ie = !([].keys && "next" in [].keys()), oe = function () { return this }, ae = function (t, e, r, n, i, o, a) { Qt(r, e, n); var c, l, u, s = function (t) { if (!ie && t in h) return h[t]; switch (t) { case "keys": case "values": return function () { return new r(this, t) } }return function () { return new r(this, t) } }, d = e + " Iterator", f = "values" == i, p = !1, h = t.prototype, g = h[ne] || h["@@iterator"] || i && h[i], v = g || s(i), y = i ? f ? s("entries") : v : void 0, m = "Array" == e && h.entries || g; if (m && (u = re(m.call(new t))) !== Object.prototype && u.next && (Jt(u, d, !0), "function" != typeof u[ne] && st(u, ne, oe)), f && g && "values" !== g.name && (p = !0, v = function () { return g.call(this) }), (ie || p || !h[ne]) && st(h, ne, v), gt[e] = v, gt[d] = oe, i) if (c = { values: f ? v : s("values"), keys: o ? v : s("keys"), entries: y }, a) for (l in c) l in h || Ot(h, l, c[l]); else Et(Et.P + Et.F * (ie || p), e, c); return c }(Array, "Array", function (t, e) { this._t = _t(t), this._i = 0, this._k = e }, function () { var t = this._t, e = this._k, r = this._i++; return !t || r >= t.length ? (this._t = void 0, ht(1)) : ht(0, "keys" == e ? r : "values" == e ? t[r] : [r, t[r]]) }, "values"); gt.Arguments = gt.Array, pt("keys"), pt("values"), pt("entries"); for (var ce = K("iterator"), le = K("toStringTag"), ue = gt.Array, se = { CSSRuleList: !0, CSSStyleDeclaration: !1, CSSValueList: !1, ClientRectList: !1, DOMRectList: !1, DOMStringList: !1, DOMTokenList: !0, DataTransferItemList: !1, FileList: !1, HTMLAllCollection: !1, HTMLCollection: !1, HTMLFormElement: !1, HTMLSelectElement: !1, MediaList: !0, MimeTypeArray: !1, NamedNodeMap: !1, NodeList: !0, PaintRequestList: !1, Plugin: !1, PluginArray: !1, SVGLengthList: !1, SVGNumberList: !1, SVGPathSegList: !1, SVGPointList: !1, SVGStringList: !1, SVGTransformList: !1, SourceBufferList: !1, StyleSheetList: !0, TextTrackCueList: !1, TextTrackList: !1, TouchList: !1 }, de = $t(se), fe = 0; fe < de.length; fe++) { var pe, he = de[fe], ge = se[he], ve = Y[he], ye = ve && ve.prototype; if (ye && (ye[ce] || st(ye, ce, ue), ye[le] || st(ye, le, he), gt[he] = ue, ge)) for (pe in ae) ye[pe] || Ot(ye, pe, ae[pe], !0) } var me = { f: Object.getOwnPropertySymbols }, be = { f: {}.propertyIsEnumerable }, _e = Object.assign, Ne = !_e || A(function () { var t = {}, e = {}, r = Symbol(), n = "abcdefghijklmnopqrst"; return t[r] = 7, n.split("").forEach(function (t) { e[t] = t }), 7 != _e({}, t)[r] || Object.keys(_e({}, e)).join("") != n }) ? function (t, e) { for (var n = r(t), i = arguments.length, o = 1, a = me.f, l = be.f; i > o;)for (var u, s = c(arguments[o++]), d = a ? P(s).concat(a(s)) : P(s), f = d.length, p = 0; f > p;)l.call(s, u = d[p++]) && (n[u] = s[u]); return n } : _e; G(G.S + G.F, "Object", { assign: Ne }); var Se = y.Object.assign, Oe = { f: {}.propertyIsEnumerable }, xe = Object.getOwnPropertyDescriptor, Te = { f: et ? xe : function (t, e) { if (t = _t(t), e = at(e, !0), ot) try { return xe(t, e) } catch (t) { } if (St(t, e)) return ut(!Oe.f.call(t, e), t[e]) } }, Ee = function (t, e) { if (Z(t), !Q(e) && null !== e) throw TypeError(e + ": can't set as prototype!") }, we = { set: Object.setPrototypeOf || ("__proto__" in {} ? function (t, e, r) { try { (r = xt(Function.call, Te.f(Object.prototype, "__proto__").set, 2))(t, []), e = !(t instanceof Array) } catch (t) { e = !0 } return function (t, n) { return Ee(t, n), e ? t.__proto__ = n : r(t, n), t } }({}, !1) : void 0), check: Ee }.set, Pe = Bt.concat("length", "prototype"), ke = { f: Object.getOwnPropertyNames || function (t) { return Dt(t, Pe) } }, je = "\t\n\v\f\r \u2028\u2029\ufeff", Le = "[" + je + "]", Ae = RegExp("^" + Le + Le + "*"), Ie = RegExp(Le + Le + "*$"), Ce = function (t, e, r) { var n = {}, i = tt(function () { return !!je[t]() || "
" != "
"[t]() }), o = n[t] = i ? e(Me) : je[t]; r && (n[r] = o), Et(Et.P + Et.F * i, "String", n) }, Me = Ce.trim = function (t, e) { return t = String(bt(t)), 1 & e && (t = t.replace(Ae, "")), 2 & e && (t = t.replace(Ie, "")), t }, Re = Ce, Fe = ke.f, De = Te.f, Be = lt.f, $e = Re.trim, He = Y.Number, Ve = He, Ge = He.prototype, We = "Number" == yt(Ut(Ge)), qe = "trim" in String.prototype, Ye = function (t) { var e = at(t, !1); if ("string" == typeof e && e.length > 2) { var r, n, i, o = (e = qe ? e.trim() : $e(e, 3)).charCodeAt(0); if (43 === o || 45 === o) { if (88 === (r = e.charCodeAt(2)) || 120 === r) return NaN } else if (48 === o) { switch (e.charCodeAt(1)) { case 66: case 98: n = 2, i = 49; break; case 79: case 111: n = 8, i = 55; break; default: return +e }for (var a, c = e.slice(2), l = 0, u = c.length; l < u; l++)if ((a = c.charCodeAt(l)) < 48 || a > i) return NaN; return parseInt(c, n) } } return +e }; if (!He(" 0o1") || !He("0b1") || He("+0x1")) { He = function (t) { var e = arguments.length < 1 ? 0 : t, r = this; return r instanceof He && (We ? tt(function () { Ge.valueOf.call(r) }) : "Number" != yt(r)) ? function (t, e, r) { var n, i = e.constructor; return i !== r && "function" == typeof i && (n = i.prototype) !== r.prototype && Q(n) && we && we(t, n), t }(new Ve(Ye(e)), r, He) : Ye(e) }; for (var Ue, ze = et ? Fe(Ve) : "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","), Xe = 0; ze.length > Xe; Xe++)St(Ve, Ue = ze[Xe]) && !St(He, Ue) && Be(He, Ue, De(Ve, Ue)); He.prototype = Ge, Ge.constructor = He, Ot(Y, "Number", He) } function Je(t, e) { return 1 === arguments.length && (e = t, t = 0), Math.floor(Math.random() * (e - t + 1) + t) } function Ke(t, e) { for (var r, n = 0; (r = t.indexOf(e)) > -1;)t.splice(r, 1), n++; return n } function Qe(t) { var e = t.getBoundingClientRect(), r = function () { if ("undefined" != typeof pageYOffset) return { top: pageYOffset, left: pageXOffset }; var t = document.body, e = document.documentElement; return { top: (e = e.clientHeight ? e : t).scrollTop, left: e.scrollLeft } }(); return { x: e.left + r.left, y: e.top + r.top } } function Ze(t) { for (var e = function (t) { var e = t.offsetParent; return (!e || e === document.body && "static" === getComputedStyle(document.body).position) && (e = document.body.parentElement), e }(t), r = { x: t.offsetLeft, y: t.offsetTop }, n = t; (n = n.parentElement) !== e && n;)r.x -= n.scrollLeft, r.y -= n.scrollTop; return r } function tr(t, e) { t["original_".concat(e)] = t.getAttribute(e) } function er(t, e) { var r = "original_".concat(e); t.setAttribute(e, t[r]) } function rr(t, e) { return t.classList ? t.classList.contains(e) : new RegExp("(^| )" + e + "( |$)", "gi").test(t.className) } function nr(t, e, r) { for (var n = arguments.length, i = new Array(n > 3 ? n - 3 : 0), o = 3; o < n; o++)i[o - 3] = arguments[o]; t.addEventListener ? t.addEventListener.apply(t, [e, r].concat(i)) : t.attachEvent && t.attachEvent.apply(t, ["on".concat(e), r].concat(i)) } function ir(t, e, r) { for (var n = arguments.length, i = new Array(n > 3 ? n - 3 : 0), o = 3; o < n; o++)i[o - 3] = arguments[o]; t.removeEventListener ? t.removeEventListener.apply(t, [e, r].concat(i)) : t.detachEvent && t.detachEvent.apply(t, ["on".concat(e), r].concat(i)) } function or(t, e, r, n, i) { var o, a, c = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 1e3; null == r && (r = 0, n = t.length - 1); for (var l, u = 0; r >= 0 && r <= n;) { if (u >= c) throw Error("binarySearch: loop times is over ".concat(c, ", you can increase the limit.")); if ((l = e(a = t[o = Math.floor((n - r) / 2 + r)], u)) > 0) n = o - 1; else { if (!(l < 0)) return { index: o, value: a, count: u + 1, hit: !0 }; r = o + 1 } u++ } return i ? { index: o, value: a, count: u + 1, hit: !1, bigger: l > 0 } : null } var ar = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }; function cr(t, e) { var r, n = arguments[3], i = (r = t, "[object Array]" === Object.prototype.toString.call(r) ? t : [t]).map(function (t, e) { return { item: t, index: e } }); n && i.reverse(); for (var o = function () { var t = i.shift(), r = t.item, o = t.index, a = t.parent, c = e(r, o, a); if (!1 === c) return { v: void 0 }; if ("skip children" === c) return "continue"; if ("skip siblings" === c && (i = i.filter(function (t) { return t.parent !== a })), r.children) { var l, u = r.children; n && (u = u.slice()).reverse(); var s = u.map(function (t, e) { return { item: t, index: e, parent: r } }); (l = i).push.apply(l, function (t) { if (Array.isArray(t)) { for (var e = 0, r = Array(t.length); e < t.length; e++)r[e] = t[e]; return r } return Array.from(t) }(s)) } }; i.length;) { var a = o(); switch (a) { case "continue": continue; default: if ("object" === (void 0 === a ? "undefined" : ar(a))) return a.v } } } function lr(t, e) { var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "children", n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "parent"; t[n] && Ke(t[n][r], t), t[n] = e } function ur(t, e) { var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "children", n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "parent"; if (t !== e) { var i = e[n][r], o = i.indexOf(e); i[o + 1] !== t && (t[n] === e[n] ? (Ke(i, t), o = i.indexOf(e)) : lr(t, e[n]), i.splice(o + 1, 0, t)) } } function sr(t, e) { var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "children"; if (t === e) throw "can't append to self"; var n = e[r]; n[n.length - 1] !== t && (lr(t, e), n.push(t)) } var dr = function (t, e, r, n, i, o, a, c) { const l = ("function" == typeof r ? r.options : r) || {}; return l.__file = "TreeNode.vue", l.render || (l.render = t.render, l.staticRenderFns = t.staticRenderFns, l._compiled = !0, i && (l.functional = !0)), l._scopeId = n, l }({ render: function () { var t = this, e = t.$createElement, r = t._self._c || e; return r("div", { staticClass: "tree-node", class: [t.data.active ? t.store.activatedClass : "", t.data.open ? t.store.openedClass : "", t.data.class], style: t.data.style, attrs: { id: t.data._id } }, [t.isRoot ? t._e() : t._t("node-inner-back", [r("div", { staticClass: "tree-node-inner-back", class: [t.data.innerBackClass], style: [t.innerBackStyle, t.data.innerBackStyle] }, [r("div", { staticClass: "tree-node-inner", class: [t.data.innerClass], style: [t.data.innerStyle] }, [t._t("default", null, { data: t.data, store: t.store, vm: t.vm })], 2)])], { styleObj: t.innerBackStyle, data: t.data, store: t.store, vm: t.vm }), r("transition", { attrs: { name: t.store.childrenTransitionName } }, [t.childrenVisible ? r("div", { staticClass: "tree-node-children" }, t._l(t.data.children, function (e) { return r("TreeNode", { key: e._id, attrs: { data: e, store: t.store, level: t.childrenLevel }, scopedSlots: t._u([{ key: "default", fn: function (e) { return [t._t("default", null, { data: e.data, store: e.store, vm: e.vm })] } }, { key: "node-inner-back", fn: function (e) { return t.store.customInnerBack ? [t._t("node-inner-back", null, { styleObj: e.styleObj, data: e.data, store: e.store, vm: e.vm })] : void 0 } }]) }) }), 1) : t._e()])], 2) }, staticRenderFns: [] }, 0, { name: "TreeNode", props: { data: {}, store: {}, level: { default: 0 } }, data: function () { return { vm: this } }, computed: { childrenLevel: function () { return this.level + 1 }, isRoot: function () { return this.data && this.data.isRoot }, childrenVisible: function () { var t = this.data; return this.isRoot || t && t.children && t.children.length && t.open }, innerBackStyle: function () { var t = { marginBottom: this.store.space + "px" }; return !this.isRoot && this.level > 1 && ("rtl" === this.store.dir ? t.paddingRight = (this.level - 1) * this.store.indent + "px" : t.paddingLeft = (this.level - 1) * this.store.indent + "px"), t } }, watch: { data: { immediate: !0, handler: function (t) { t && (t._vm = this, t._treeNodePropertiesCompleted || t.isRoot || this.store.compeleteNode(t, this.$parent.data)) } } } }, void 0, !1); var fr, pr, hr, gr = function (t, e, r, n, i, o, a, c) { const l = ("function" == typeof r ? r.options : r) || {}; return l.__file = "Tree.vue", l.render || (l.render = t.render, l.staticRenderFns = t.staticRenderFns, l._compiled = !0, i && (l.functional = !0)), l._scopeId = n, l }({ render: function () { var t = this, e = t.$createElement, r = t._self._c || e; return r("div", { staticClass: "he-tree tree" }, [r("TreeNode", { attrs: { data: t.rootData, store: t.store }, scopedSlots: t._u([{ key: "default", fn: function (e) { return [t._t("default", null, { data: e.data, store: t.store, vm: e.vm })] } }, { key: "node-inner-back", fn: function (e) { return t.customInnerBack ? [t._t("node-inner-back", null, { styleObj: e.styleObj, data: e.data, store: e.store, vm: e.vm })] : void 0 } }]) })], 1) }, staticRenderFns: [] }, 0, { props: { data: {}, idLength: { type: Number, default: 5 }, indent: { type: Number, default: 16 }, activatedClass: { default: "active" }, openedClass: { default: "open" }, space: { type: Number, default: 10 }, childrenTransitionName: {}, customInnerBack: {} }, components: { TreeNode: dr }, data: function () { return { store: this, rootData: null } }, watch: { data: { immediate: !0, handler: function (t, e) { var r = this; t !== e && (this.rootData = this.rootData || { isRoot: !0, _id: "tree_".concat(this._uid, "_node_root"), children: [] }, cr(t, function (t, e, n) { r.compeleteNode(t, n) }), this.rootData.children = t) } } }, methods: { compeleteNode: function (t, e) { var r = { open: !0, children: [], active: !1, style: {}, class: "", innerStyle: {}, innerClass: "", innerBackStyle: {}, innerBackClass: {} }; for (var n in r) t.hasOwnProperty(n) || this.$set(t, n, r[n]); this.$set(t, "parent", e || this.rootData), t.hasOwnProperty("_id") || (t._id = "tree_".concat(this._uid, "_node_").concat(function () { for (var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 8, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", r = "", n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", i = 0; i < t; i++)r += n[Je(n.length - 1)]; return e + r }(this.idLength))), t._treeNodePropertiesCompleted = !0 }, pure: function (t, e, r) { var n = this, i = Se({}, t); delete i._id, delete i.parent, delete i.children, delete i.open, delete i.active, delete i.style, delete i.class, delete i.innerStyle, delete i.innerClass, delete i.innerBackStyle, delete i.innerBackClass; for (var o = W(i), a = 0; a < o.length; a++) { var c = o[a]; "_" === c[0] && delete i[c] } return e && t.children && (i.children = t.children.slice(), i.children.forEach(function (t, r) { i.children[r] = n.pure(t, e) })), r && r(i, t) || i }, getNodeById: function (t) { var e; return cr(this.rootData.children, function (r) { if (r._id === t) return e = r, !1 }), e }, getActivated: function () { var t = []; return cr(this.rootData.children, function (e) { e.active && t.push(e) }), t }, getOpened: function () { var t = []; return cr(this.rootData.children, function (e) { e.open && t.push(e) }), t }, activeNode: function (t, e) { this.activated; e && this.getActivated().forEach(function (t) { t.active = !1 }), t.active = !0 }, toggleActive: function (t, e) { t.active ? t.active = !1 : this.activeNode(t, e) }, openNode: function (t, e) { var r = this; this.opened; e && this.getOpened().forEach(function (t) { t.open = !1, r.$emit("nodeOpenChanged", t) }), t.open = !0, this.$emit("nodeOpenChanged", t) }, toggleOpen: function (t, e) { t.open ? (t.open = !1, this.$emit("nodeOpenChanged", t)) : this.openNode(t, e) }, getPureData: function (t) { return this.pure(this.rootData, !0, t).children }, deleteNode: function (t) { return Ke(t.parent.children, t) } } }, void 0, !1), vr = (fr = !0, function (t, e) { var r, n, i = String(bt(t)), o = kt(e), a = i.length; return o < 0 || o >= a ? fr ? "" : void 0 : (r = i.charCodeAt(o)) < 55296 || r > 56319 || o + 1 === a || (n = i.charCodeAt(o + 1)) < 56320 || n > 57343 ? fr ? i.charAt(o) : r : fr ? i.slice(o, o + 2) : n - 56320 + (r - 55296 << 10) + 65536 }), yr = function (t, e, r) { return e + (r ? vr(t, e).length : 1) }, mr = K("toStringTag"), br = "Arguments" == yt(function () { return arguments }()), _r = RegExp.prototype.exec, Nr = function (t, e) { var r, n, i, o, a = t.exec; if ("function" == typeof a) { var c = a.call(t, e); if ("object" != typeof c) throw new TypeError("RegExp exec method returned something other than an Object or null"); return c } if ("RegExp" !== (void 0 === (r = t) ? "Undefined" : null === r ? "Null" : "string" == typeof (i = function (t, e) { try { return t[e] } catch (t) { } }(n = Object(r), mr)) ? i : br ? yt(n) : "Object" == (o = yt(n)) && "function" == typeof n.callee ? "Arguments" : o)) throw new TypeError("RegExp#exec called on incompatible receiver"); return _r.call(t, e) }, Sr = RegExp.prototype.exec, Or = String.prototype.replace, xr = Sr, Tr = (pr = /a/, hr = /b*/g, Sr.call(pr, "a"), Sr.call(hr, "a"), 0 !== pr.lastIndex || 0 !== hr.lastIndex), Er = void 0 !== /()??/.exec("")[1]; (Tr || Er) && (xr = function (t) { var e, r, n, i, o = this; return Er && (r = new RegExp("^" + o.source + "$(?!\\s)", function () { var t = Z(this), e = ""; return t.global && (e += "g"), t.ignoreCase && (e += "i"), t.multiline && (e += "m"), t.unicode && (e += "u"), t.sticky && (e += "y"), e }.call(o))), Tr && (e = o.lastIndex), n = Sr.call(o, t), Tr && n && (o.lastIndex = o.global ? n.index + n[0].length : e), Er && n && n.length > 1 && Or.call(n[0], r, function () { for (i = 1; i < arguments.length - 2; i++)void 0 === arguments[i] && (n[i] = void 0) }), n }); var wr = xr; Et({ target: "RegExp", proto: !0, forced: wr !== /./.exec }, { exec: wr }); var Pr = K("species"), kr = !tt(function () { var t = /./; return t.exec = function () { var t = []; return t.groups = { a: "7" }, t }, "7" !== "".replace(t, "$<a>") }), jr = function () { var t = /(?:)/, e = t.exec; t.exec = function () { return e.apply(this, arguments) }; var r = "ab".split(t); return 2 === r.length && "a" === r[0] && "b" === r[1] }(), Lr = Math.max, Ar = Math.min, Ir = Math.floor, Cr = /\$([$&`']|\d\d?|<[^>]*>)/g, Mr = /\$([$&`']|\d\d?)/g; !function (t, e, r) { var n = K(t), i = !tt(function () { var e = {}; return e[n] = function () { return 7 }, 7 != ""[t](e) }), o = i ? !tt(function () { var e = !1, r = /a/; return r.exec = function () { return e = !0, null }, "split" === t && (r.constructor = {}, r.constructor[Pr] = function () { return r }), r[n](""), !e }) : void 0; if (!i || !o || "replace" === t && !kr || "split" === t && !jr) { var a = /./[n], c = r(bt, n, ""[t], function (t, e, r, n, o) { return e.exec === wr ? i && !o ? { done: !0, value: a.call(e, r, n) } : { done: !0, value: t.call(r, e, n) } : { done: !1 } }), l = c[0], u = c[1]; Ot(String.prototype, t, l), st(RegExp.prototype, n, 2 == e ? function (t, e) { return u.call(t, this, e) } : function (t) { return u.call(t, this) }) } }("replace", 2, function (t, e, r, n) { return [function (n, i) { var o = t(this), a = null == n ? void 0 : n[e]; return void 0 !== a ? a.call(n, o, i) : r.call(String(o), n, i) }, function (t, e) { var o = n(r, t, this, e); if (o.done) return o.value; var a = Z(t), c = String(this), l = "function" == typeof e; l || (e = String(e)); var u = a.global; if (u) { var s = a.unicode; a.lastIndex = 0 } for (var d = []; ;) { var f = Nr(a, c); if (null === f) break; if (d.push(f), !u) break; "" === String(f[0]) && (a.lastIndex = yr(c, Lt(a.lastIndex), s)) } for (var p, h = "", g = 0, v = 0; v < d.length; v++) { f = d[v]; for (var y = String(f[0]), m = Lr(Ar(kt(f.index), c.length), 0), b = [], _ = 1; _ < f.length; _++)b.push(void 0 === (p = f[_]) ? p : String(p)); var N = f.groups; if (l) { var S = [y].concat(b, m, c); void 0 !== N && S.push(N); var O = String(e.apply(void 0, S)) } else O = i(y, c, m, b, N, e); m >= g && (h += c.slice(g, m) + O, g = m + y.length) } return h + c.slice(g) }]; function i(t, e, n, i, o, a) { var c = n + t.length, l = i.length, u = Mr; return void 0 !== o && (o = Zt(o), u = Cr), r.call(a, u, function (r, a) { var u; switch (a.charAt(0)) { case "$": return "$"; case "&": return t; case "`": return e.slice(0, n); case "'": return e.slice(c); case "<": u = o[a.slice(1, -1)]; break; default: var s = +a; if (0 === s) return a; if (s > l) { var d = Ir(s / 10); return 0 === d ? a : d <= l ? void 0 === i[d - 1] ? a.charAt(1) : i[d - 1] + a.charAt(1) : a } u = i[s - 1] }return void 0 === u ? "" : u }) } }); var Rr = { start: ["mousedown", "touchstart"], move: ["mousemove", "touchmove"], end: ["mouseup", "touchend"] }, Fr = { isTouch: function (t) { return t.type && t.type.startsWith("touch") }, _getStore: function (t) { return t._wrapperStore || (t._wrapperStore = []), t._wrapperStore }, on: function (t, e, r) { var n, i, o = this._getStore(t), a = this, c = function (t) { var n; if (a.isTouch(t)) n = { x: t.changedTouches[0].pageX, y: t.changedTouches[0].pageY }; else if (n = { x: t.pageX, y: t.pageY }, "start" === e && 1 !== t.which) return; return r.call(this, t, n) }; o.push({ handler: r, wrapper: c }); for (var l = arguments.length, u = new Array(l > 3 ? l - 3 : 0), s = 3; s < l; s++)u[s - 3] = arguments[s]; (n = nr).call.apply(n, [null, t, Rr[e][0], c].concat(u)), (i = nr).call.apply(i, [null, t, Rr[e][1], c].concat(u)) }, off: function (t, e, r) { for (var n = this._getStore(t), i = arguments.length, o = new Array(i > 3 ? i - 3 : 0), a = 3; a < i; a++)o[a - 3] = arguments[a]; for (var c = n.length - 1; c >= 0; c--) { var l, u, s = n[c], d = s.handler, f = s.wrapper; if (r === d) (l = ir).call.apply(l, [null, t, Rr[e][0], f].concat(o)), (u = ir).call.apply(u, [null, t, Rr[e][1], f].concat(o)), n.splice(c, 1) } } }; function Dr(t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; null == e.minTranslate && (e.minTranslate = 10); var r = { movedCount: 0 }, n = function () { Fr.off(t, "end", t._draggbleEventHandler), ir(t, "selectstart", c), delete t._draggbleEventHandler }; return t._draggbleEventHandler && n(), t._draggbleEventHandler = function (t, e) { r.mouse = { x: e.x, y: e.y }, r.initialMouse = Object.assign({}, r.mouse), Fr.on(document, "move", o, { passive: !1 }), Fr.on(window, "end", a) }, Fr.on(t, "start", t._draggbleEventHandler), nr(t, "selectstart", c), n; function i(n) { var i = function () { var n = e.getEl ? e.getEl(t, e) : t, i = n; e.clone && (r.triggerEl = n, i = n.cloneNode(!0), n.parentElement.appendChild(i)); return { position: Ze(i), el: i } }(), o = i.el, a = i.position; if (r.el = o, r.initialPosition = Object.assign({}, a), !1 === (e.drag && e.drag(n, e, r))) return !1; var c = function (t) { var e = t.style.display; t.style.display = "block"; var r = { width: t.offsetWidth, height: t.offsetHeight }; return t.style.display = e, r }(o), l = Object.assign({ width: "".concat(c.width, "px"), height: "".concat(c.height, "px"), zIndex: 9999, opacity: .6, position: "absolute", left: a.x + "px", top: a.y + "px" }, e.style || e.getStyle && e.getStyle(e) || {}); for (var u in tr(o, "style"), l) o.style[u] = l[u]; tr(o, "class"), function (t, e) { rr(t, e) || (t.classList ? t.classList.add(e) : t.className += " " + e) }(o, e.draggingClass) } function o(t, n) { r.mouse = { x: n.x, y: n.y }; var o = r.move = { x: r.mouse.x - r.initialMouse.x, y: r.mouse.y - r.initialMouse.y }; if (0 === r.movedCount && e.minTranslate) { var a = Math.pow(r.move.x, 2), c = Math.pow(r.move.y, 2); if (Math.pow(a + c, .5) < e.minTranslate) return } var l = !0; if (0 === r.movedCount && !1 === i(t) && (l = !1), t.preventDefault(), l && e.moving && !1 === e.moving(t, e, r) && (l = !1), l) { if (!r || !r.el) return; Object.assign(r.el.style, { left: r.initialPosition.x + o.x + "px", top: r.initialPosition.y + o.y + "px" }), r.movedCount++ } } function a(t) { if (Fr.off(document, "move", o, { passive: !1 }), Fr.off(window, "end", a), r.movedCount > 0) { r.movedCount = 0; var n = r.el; e.clone ? n.parentElement.removeChild(n) : (er(n, "style"), er(n, "class")), e.drop && e.drop(t, e, r) } r = { movedCount: 0 } } function c(t) { t.preventDefault() } } G(G.S + G.F * !I, "Object", { defineProperty: B.f }); var Br = y.Object, $r = function (t, e, r) { return Br.defineProperty(t, e, r) }, Hr = lt.f, Vr = Function.prototype, Gr = /^\s*function ([^ (]*)/; function Wr(t, e) { for (var r = 0; r < e.length; r++) { var n = e[r]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), $r(t, n.key, n) } } "name" in Vr || et && Hr(Vr, "name", { configurable: !0, get: function () { try { return ("" + this).match(Gr)[1] } catch (t) { return "" } } }); var qr = function () { function t() { var e, r, n; !function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, t), n = {}, (r = "store") in (e = this) ? $r(e, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = n } var e, r, n; return e = t, (r = [{ key: "has", value: function (t) { return this.store.hasOwnProperty(t) } }, { key: "remember", value: function (t, e) { return this.has(t) || (this.store[t] = { value: e() }), this.store[t].value } }, { key: "forget", value: function (t) { t ? this.has(t) && delete this.store[t] : this.store = {} } }]) && Wr(e.prototype, r), n && Wr(e, n), t }(); function Yr(t) { return "" === t || t } var Ur = function (t, e) { return { value: e, done: !!t } }, zr = {}, Xr = H, Jr = I ? Object.defineProperties : function (t, e) { L(t); for (var r, n = P(e), i = n.length, o = 0; i > o;)B.f(t, r = n[o++], e[r]); return t }, Kr = m.document, Qr = Kr && Kr.documentElement, Zr = x("IE_PROTO"), tn = function () { }, en = function () { var t, e = R("iframe"), r = w.length; for (e.style.display = "none", Qr.appendChild(e), e.src = "javascript:", (t = e.contentWindow.document).open(), t.write("<script>document.F=Object<\/script>"), t.close(), en = t.F; r--;)delete en.prototype[w[r]]; return en() }, rn = Object.create || function (t, e) { var r; return null !== t ? (tn.prototype = L(t), r = new tn, tn.prototype = null, r[Zr] = t) : r = en(), void 0 === e ? r : Jr(r, e) }, nn = g(function (t) { var e = b("wks"), r = m.Symbol, n = "function" == typeof r; (t.exports = function (t) { return e[t] || (e[t] = n && r[t] || (n ? r : S)("Symbol." + t)) }).store = e }), on = B.f, an = nn("toStringTag"), cn = function (t, e, r) { t && !i(t = r ? t : t.prototype, an) && on(t, an, { configurable: !0, value: e }) }, ln = {}; H(ln, nn("iterator"), function () { return this }); var un = x("IE_PROTO"), sn = Object.prototype, dn = Object.getPrototypeOf || function (t) { return t = r(t), i(t, un) ? t[un] : "function" == typeof t.constructor && t instanceof t.constructor ? t.constructor.prototype : t instanceof Object ? sn : null }, fn = nn("iterator"), pn = !([].keys && "next" in [].keys()), hn = function () { return this }, gn = function (t, e, r, n, i, o, a) { !function (t, e, r) { t.prototype = rn(ln, { next: $(1, r) }), cn(t, e + " Iterator") }(r, e, n); var c, l, u, s = function (t) { if (!pn && t in h) return h[t]; switch (t) { case "keys": case "values": return function () { return new r(this, t) } }return function () { return new r(this, t) } }, d = e + " Iterator", f = "values" == i, p = !1, h = t.prototype, g = h[fn] || h["@@iterator"] || i && h[i], v = g || s(i), y = i ? f ? s("entries") : v : void 0, m = "Array" == e && h.entries || g; if (m && (u = dn(m.call(new t))) !== Object.prototype && u.next && cn(u, d, !0), f && g && "values" !== g.name && (p = !0, v = function () { return g.call(this) }), a && (pn || p || !h[fn]) && H(h, fn, v), zr[e] = v, zr[d] = hn, i) if (c = { values: f ? v : s("values"), keys: o ? v : s("keys"), entries: y }, a) for (l in c) l in h || Xr(h, l, c[l]); else G(G.P + G.F * (pn || p), e, c); return c }; gn(Array, "Array", function (t, e) { this._t = l(t), this._i = 0, this._k = e }, function () { var t = this._t, e = this._k, r = this._i++; return !t || r >= t.length ? (this._t = void 0, Ur(1)) : Ur(0, "keys" == e ? r : "values" == e ? t[r] : [r, t[r]]) }, "values"); zr.Arguments = zr.Array; for (var vn = nn("toStringTag"), yn = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","), mn = 0; mn < yn.length; mn++) { var bn = yn[mn], _n = m[bn], Nn = _n && _n.prototype; Nn && !Nn[vn] && H(Nn, vn, bn), zr[bn] = zr.Array } var Sn = function (t) { return function (r, n) { var i, o, a = String(e(r)), c = d(n), l = a.length; return c < 0 || c >= l ? t ? "" : void 0 : (i = a.charCodeAt(c)) < 55296 || i > 56319 || c + 1 === l || (o = a.charCodeAt(c + 1)) < 56320 || o > 57343 ? t ? a.charAt(c) : i : t ? a.slice(c, c + 2) : o - 56320 + (i - 55296 << 10) + 65536 } }(!0); gn(String, "String", function (t) { this._t = String(t), this._i = 0 }, function () { var t, e = this._t, r = this._i; return r >= e.length ? { value: void 0, done: !0 } : (t = Sn(e, r), this._i += t.length, { value: t, done: !1 }) }); var On, xn, Tn, En, wn, Pn, kn, jn, Ln, An = nn("toStringTag"), In = "Arguments" == a(function () { return arguments }()), Cn = nn("iterator"), Mn = y.getIteratorMethod = function (t) { if (null != t) return t[Cn] || t["@@iterator"] || zr[function (t) { var e, r, n; return void 0 === t ? "Undefined" : null === t ? "Null" : "string" == typeof (r = function (t, e) { try { return t[e] } catch (t) { } }(e = Object(t), An)) ? r : In ? a(e) : "Object" == (n = a(e)) && "function" == typeof e.callee ? "Arguments" : n }(t)] }, Rn = y.getIterator = function (t) { var e = Mn(t); if ("function" != typeof e) throw TypeError(t + " is not iterable!"); return L(e.call(t)) }, Fn = Array.isArray || function (t) { return "Array" == yt(t) }, Dn = K("species"), Bn = (Tn = 1 == (On = 5), En = 2 == On, wn = 3 == On, Pn = 4 == On, kn = 6 == On, jn = 5 == On || kn, Ln = xn || function (t, e) { return new (function (t) { var e; return Fn(t) && ("function" != typeof (e = t.constructor) || e !== Array && !Fn(e.prototype) || (e = void 0), Q(e) && null === (e = e[Dn]) && (e = void 0)), void 0 === e ? Array : e }(t))(e) }, function (t, e, r) { for (var n, i, o = Zt(t), a = mt(o), c = xt(e, r, 3), l = Lt(a.length), u = 0, s = Tn ? Ln(t, l) : En ? Ln(t, 0) : void 0; l > u; u++)if ((jn || u in a) && (i = c(n = a[u], u, o), On)) if (Tn) s[u] = i; else if (i) switch (On) { case 3: return !0; case 5: return n; case 6: return u; case 2: s.push(n) } else if (Pn) return !1; return kn ? -1 : wn || Pn ? Pn : s }), $n = !0; function Hn(t, e) { for (var r = t; r;)if ((r = r.parentNode) === e) return !0 } "find" in [] && Array(1).find(function () { $n = !1 }), Et(Et.P + Et.F * $n, "Array", { find: function (t) { return Bn(this, t, arguments.length > 1 ? arguments[1] : void 0) } }), pt("find"), document.elementsFromPoint || (document.elementsFromPoint = function (t, e) { var r = [], n = void 0; do { n !== document.elementFromPoint(t, e) ? (n = document.elementFromPoint(t, e), r.push(n), n.style.pointerEvents = "none") : n = !1 } while (n); return r.forEach(function (t) { return t.style.pointerEvents = "all" }), r }); var Vn = { nothing: function (t) { }, after: function (t) { Gn(t.dplh, t.targetNode, t) }, before: function (t) { qn(t.targetNode.parent) ? function (t, e) { var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "children", n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "parent"; if (t !== e) { var i = e[n][r], o = i.indexOf(e); i[o - 1] !== t && (t[n] === e[n] ? (Ke(i, t), o = i.indexOf(e)) : lr(t, e[n]), i.splice(o, 0, t)) } }(t.dplh, t.targetNode) : Gn(t.dplh, t.targetNode.parent, t) }, append: function (t) { qn(t.targetNode) ? (sr(t.dplh, t.targetNode), t.targetNode.open || t.store.toggleOpen(t.targetNode)) : Gn(t.dplh, t.targetNode, t) }, prepend: function (t) { qn(t.targetNode) ? (!function (t, e) { var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "children"; if (t === e) throw "can't prepend to self"; var n = e[r]; n[0] !== t && (lr(t, e), n.splice(0, 0, t)) }(t.dplh, t.targetNode), t.targetNode.open || t.store.toggleOpen(t.targetNode)) : Gn(t.dplh, t.targetNode, t) }, "after target parent": function (t) { Gn(t.dplh, t.targetNode.parent, t) }, "append prev": function (t) { qn(t.targetPrev) ? (sr(t.dplh, t.targetPrev), t.targetPrev.open || t.store.toggleOpen(t.targetPrev)) : Gn(t.dplh, t.targetPrev, t) }, "append current tree": function (t) { qn(t.currentTree.rootData) && sr(t.dplh, t.currentTree.rootData) } }; function Gn(t, e, r) { if (!e) return !1; var n = function (t, e) { var r = t; for (; r;) { if (e(r)) return r; r = r.parent } }(e, function (t) { return t.parent && qn(t.parent) }); return !!n && (ur(t, n), !0) } function Wn(t) { var e; Zn.hasOwnProperty(t._id) || (e = t.hasOwnProperty("draggable") ? t.draggable : !t.parent || Wn(t.parent), Zn[t._id] = e); return Zn[t._id] } function qn(t) { var e; Qn.hasOwnProperty(t._id) || (e = t.hasOwnProperty("droppable") ? t.droppable : !t.parent || qn(t.parent), Qn[t._id] = e); return Qn[t._id] } function Yn(t, e, r, n) { var i = e.length; if (n) for (var o = i - 1; o >= 0; o--) { var a = e[o]; if (a !== t.node && r(a, o)) return a } else for (var c = 0; c < i; c++) { var l = e[c]; if (l !== t.node && r(l, c)) return l } } for (var Un, zn = { "targetNode existed": function (t) { return t.targetNode }, "targetNode is placeholder": function (t) { return t.targetNode.isDragPlaceHolder }, "targetNode at top": function (t) { return t.targetAtTop }, "targetNode at bottom": function (t) { return t.targetAtBottom }, "targetNode is the second child of root": function (t) { return t.currentTreeRootSecondChildExcludingDragging === t.targetNode }, "currentTree existed": function (t) { return t.currentTree }, "currentTree empty": function (t) { return !Yn(t, t.currentTree.rootData.children, function (t) { return t }) }, "placeholder existed": function (t) { return t.dplhEl }, "placeholder in currentTree": function (t) { return t.dplhElInCurrentTree }, "placeholder at top": function (t) { return t.dplhAtTop }, "targetNode is open": function (t) { return t.targetNode.open }, "targetNode has children excluding placeholder": function (t) { return Yn(t, t.targetNode.children, function (e) { return e !== t.dplh }) }, "targetNode is 1st child": function (t) { return Yn(t, t.targetNode.parent.children, function (t) { return t }) === t.targetNode }, "targetNode is last child": function (t) { return Yn(t, t.targetNode.parent.children, function (t) { return t }, !0) === t.targetNode }, "on targetNode middle": function (t) { return t.offset.y <= t.tiMiddleY }, "at left": function (t) { return t.offset.x < t.tiOffset.x }, "at right": function (t) { return t.offset.x > t.tiOffset.x }, "at indent right": function (t) { return t.offset.x > t.tiOffset.x + t.currentTree.indent }, "at indent left": function (t) { return t.offset.x < t.tiOffset.x + t.currentTree.indent } }, Xn = W(zn), Jn = function () { var t = Xn[Kn], e = zn[t]; zn[t] = function () { return Boolean(e.apply(void 0, arguments)) } }, Kn = 0; Kn < Xn.length; Kn++)Jn(); var Qn = {}, Zn = {}; function ti(t) { var e = this.store.trees, r = t.store, n = { event: t.event, el: r.el, vm: this, node: this.data, store: this.store, dplh: this.store.dplh, draggableHelperData: { opt: t.options, store: r } }; !function (t, e, r) { var n = function (n) { $r(t, n, { get: function () { var t = this; return e.remember(n, function () { return r[n].call(t) }) } }) }; for (var i in r) n(i) }(n, new qr, { nodeInnerEl: function () { return this.el.querySelector(".tree-node-inner") }, offset: function () { return Qe(this.nodeInnerEl) }, offset2: function () { return { x: this.offset.x + this.nodeInnerEl.offsetWidth, y: this.offset.y + this.nodeInnerEl.offsetHeight } }, offsetToViewPort: function () { var t = this.nodeInnerEl.getBoundingClientRect(); return t.x = "rtl" === this.store.dir ? t.right : t.left, t.y = t.top, t }, currentTree: function () { var t = function (t, e, r) { var n, i, o = document.elementsFromPoint(t, e), a = [], c = !0, l = !1, u = void 0; try { for (var s, d = Rn(o); !(c = (s = d.next()).done); c = !0) { var f = s.value; if (i) { if (rr(f, "tree")) { n = f; break } a.push(f) } else rr(f, "tree-node") && (i = f) } } catch (t) { l = !0, u = t } finally { try { c || null == d.return || d.return() } finally { if (l) throw u } } if (n) { var p = !1; if (!Hn(i, n)) for (var h = 0; h < a.length; h++)if (!Hn(a[h], n)) { p = !0; break } if (!p) return r.find(function (t) { return t.$el === n }) } }(this.offsetToViewPort.x, this.offsetToViewPort.y, e); if (t) { var r = this.store; if (null == Un && (Un = r), Un !== t) { if (!Yr(r.crossTree) || !Yr(t.crossTree)) return; Un = t } if (!Yr(t.droppable)) return; return t } }, currentTreeRootEl: function () { return document.getElementById(this.currentTree.rootData._id) }, currentTreeRootOf4: function () { return ei(this.currentTreeRootEl, this.currentTree.space) }, currentTreeRootSecondChildExcludingDragging: function () { var t = this; return this.currentTree.rootData.children.slice(0, 3).filter(function (e) { return e !== t.node })[1] }, dplhEl: function () { return document.getElementById(this.dplh._id) }, dplhElInCurrentTree: function () { return Boolean(this.currentTree.$el.querySelector("#".concat(this.dplh._id))) }, dplhOf4: function () { return ei(this.dplhEl, this.currentTree.space) }, dplhAtTop: function () { return Math.abs(this.dplhOf4.y - this.currentTreeRootOf4.y) < 5 }, targetAtTop: function () { return Math.abs(this.tiOf4.y - this.currentTreeRootOf4.y) < 5 }, targetAtBottom: function () { return Math.abs(this.tiOf4.y2 - this.currentTreeRootOf4.y2) < 5 }, targetNode: function () { var t = this.currentTree; if (!t) throw "no currentTree"; for (var e = this.offset, r = (e.x, e.y), n = t.rootData; ;) { var i = n.children; if (!i) break; if (this.node.parent === n && (i = i.slice()).splice(i.indexOf(this.node), 1), 0 === i.length) break; var o = or(i, function (e) { var n = document.getElementById(e._id), i = Qe(n).y; return i + n.offsetHeight + t.space < r ? -1 : i <= r ? 0 : 1 }, null, null, !0); if (!(n = o.hit ? o.value : o.bigger ? i[o.index - 1] : o.value)) { n = i[0]; break } if (!n) break; var a = ei(document.getElementById(n._id).querySelector(".tree-node-inner"), t.space); if (a.y <= r && r <= a.y2) break } return n }, targetNodeEl: function () { return document.getElementById(this.targetNode._id) }, tiInnerEl: function () { return this.targetNodeEl.querySelector(".tree-node-inner") }, tiOffset: function () { return Qe(this.tiInnerEl) }, tiOf4: function () { return ei(this.tiInnerEl, this.currentTree.space) }, tiMiddleY: function () { return this.tiOffset.y + this.tiInnerEl.offsetHeight / 2 }, targetPrevEl: function () { var t = this.targetNodeEl.previousSibling; return rr(t, "dragging") && (t = t.previousSibling), t }, targetPrev: function () { var t = this.targetPrevEl.getAttribute("id"); return this.currentTree.getNodeById(t) } }); var i = {}, o = function (t) { if (!i.hasOwnProperty(t)) { var e; try { e = zn[t](n) } catch (r) { e = r; try { process.env.DEVELOPE_SELF && console.warn("failed to execute rule '".concat(t, "'"), r) } catch (t) { } } i[t] = e } return i[t] }; !0 === o("currentTree existed") ? !1 === o("targetNode is placeholder") ? !0 === o("targetNode is the second child of root") ? !1 === o("targetNode has children excluding placeholder") ? !0 === o("on targetNode middle") ? Vn.before(n) : !1 === o("on targetNode middle") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn.append(n) : !1 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") && Vn.after(n)) : !0 === o("targetNode has children excluding placeholder") && Vn.prepend(n) : !1 === o("targetNode is the second child of root") && (!1 === o("currentTree empty") ? !0 === o("targetNode at top") ? !0 === o("placeholder in currentTree") ? !1 === o("targetNode has children excluding placeholder") ? !1 === o("on targetNode middle") ? !1 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn.after(n) : !0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") && Vn.append(n) : !0 === o("on targetNode middle") && Vn.before(n) : !0 === o("targetNode has children excluding placeholder") && (!1 === o("on targetNode middle") ? Vn.prepend(n) : !0 === o("on targetNode middle") && Vn.before(n)) : !1 === o("placeholder in currentTree") && Vn.before(n) : !1 === o("targetNode at top") && (!1 === o("targetNode at bottom") ? !0 === o("placeholder at top") ? Vn.prepend(n) : !1 === o("placeholder at top") && (!0 === o("targetNode has children excluding placeholder") ? Vn.prepend(n) : !1 === o("targetNode has children excluding placeholder") && (!1 === o("targetNode is 1st child") ? !1 === o("targetNode is last child") ? !0 === o("on targetNode middle") ? !0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn.append(n) : !1 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") && Vn.after(n) : !1 === o("on targetNode middle") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn.append(n) : !1 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") && Vn.after(n)) : !0 === o("targetNode is last child") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn.append(n) : !1 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") && Vn.after(n)) : !0 === o("targetNode is 1st child") && (!0 === o("targetNode is last child") ? Vn.append(n) : !1 === o("targetNode is last child") && (!1 === o("on targetNode middle") ? !1 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn.after(n) : !0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") && Vn.append(n) : !0 === o("on targetNode middle") && (!1 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn.after(n) : !0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") && Vn.append(n)))))) : !0 === o("targetNode at bottom") && (!0 === o("placeholder in currentTree") ? !1 === o("on targetNode middle") ? !0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn.append(n) : !1 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") && Vn.after(n) : !0 === o("on targetNode middle") && Vn.append(n) : !1 === o("placeholder in currentTree") && Vn.append(n))) : !0 === o("currentTree empty") && Vn["append current tree"](n)) : !0 === o("targetNode is placeholder") && (!1 === o("targetNode at bottom") ? !1 === o("targetNode is the second child of root") ? !0 === o("targetNode is 1st child") ? !1 === o("targetNode is last child") || !0 === o("targetNode is last child") && (!1 === o("on targetNode middle") ? !0 === o("rtl" === this.store.dir ? "at right" : "at left") ? Vn["after target parent"](n) : o("rtl" === this.store.dir ? "at right" : "at left") : !0 === o("on targetNode middle") && (!0 === o("rtl" === this.store.dir ? "at right" : "at left") ? Vn["after target parent"](n) : o("rtl" === this.store.dir ? "at right" : "at left"))) : !1 === o("targetNode is 1st child") && (!0 === o("targetNode is last child") ? !0 === o("on targetNode middle") ? !0 === o("rtl" === this.store.dir ? "at right" : "at left") ? Vn["after target parent"](n) : !1 === o("rtl" === this.store.dir ? "at right" : "at left") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn["append prev"](n) : o("rtl" === this.store.dir ? "at indent left" : "at indent right")) : !1 === o("on targetNode middle") && (!0 === o("rtl" === this.store.dir ? "at right" : "at left") ? Vn["after target parent"](n) : !1 === o("rtl" === this.store.dir ? "at right" : "at left") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn["append prev"](n) : o("rtl" === this.store.dir ? "at indent left" : "at indent right"))) : !1 === o("targetNode is last child") && (!0 === o("on targetNode middle") ? !0 === o("rtl" === this.store.dir ? "at right" : "at left") || !1 === o("rtl" === this.store.dir ? "at right" : "at left") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn["append prev"](n) : o("rtl" === this.store.dir ? "at indent left" : "at indent right")) : !1 === o("on targetNode middle") && (!0 === o("rtl" === this.store.dir ? "at right" : "at left") || !1 === o("rtl" === this.store.dir ? "at right" : "at left") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn["append prev"](n) : o("rtl" === this.store.dir ? "at indent left" : "at indent right"))))) : !0 === o("targetNode is the second child of root") && (!0 === o("on targetNode middle") ? !0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn["append prev"](n) : o("rtl" === this.store.dir ? "at indent left" : "at indent right") : !1 === o("on targetNode middle") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn["append prev"](n) : o("rtl" === this.store.dir ? "at indent left" : "at indent right"))) : !0 === o("targetNode at bottom") && (!0 === o("targetNode is 1st child") ? !1 === o("on targetNode middle") ? !0 === o("rtl" === this.store.dir ? "at right" : "at left") ? Vn["after target parent"](n) : o("rtl" === this.store.dir ? "at right" : "at left") : !0 === o("on targetNode middle") && (!1 === o("rtl" === this.store.dir ? "at right" : "at left") || !0 === o("rtl" === this.store.dir ? "at right" : "at left") && Vn["after target parent"](n)) : !1 === o("targetNode is 1st child") && (!1 === o("on targetNode middle") ? !0 === o("rtl" === this.store.dir ? "at right" : "at left") ? Vn["after target parent"](n) : !1 === o("rtl" === this.store.dir ? "at right" : "at left") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn["append prev"](n) : o("rtl" === this.store.dir ? "at indent left" : "at indent right")) : !0 === o("on targetNode middle") && (!0 === o("rtl" === this.store.dir ? "at right" : "at left") ? Vn["after target parent"](n) : !1 === o("rtl" === this.store.dir ? "at right" : "at left") && (!0 === o("rtl" === this.store.dir ? "at indent left" : "at indent right") ? Vn["append prev"](n) : o("rtl" === this.store.dir ? "at indent left" : "at indent right")))))) : o("currentTree existed") } function ei(t, e) { var r = Qe(t); return r.x2 = r.x + t.offsetWidth, r.y2 = r.y + t.offsetHeight + e, r } ti.dragStart = function () { }, ti.dragEnd = function () { Un = null, Qn = {}, Zn = {} }; var ri = function (t, e, r, n, i, o, a, c) { const l = ("function" == typeof r ? r.options : r) || {}; return l.__file = "DraggableTreeNode.vue", l.render || (l.render = t.render, l.staticRenderFns = t.staticRenderFns, l._compiled = !0, i && (l.functional = !0)), l._scopeId = n, l }({}, 0, { extends: dr, name: "TreeNode", mounted: function () { var t = this; if (this.store.isNodeDraggable = Wn, this.store.isNodeDroppable = qn, !this.isRoot && !this.data.isDragPlaceHolder) { var e = this.store.dplh; this.$watch("store.draggable", function (r) { if (Yr(r)) { var n = t.store.getTriggerEl ? t.store.getTriggerEl(t) : t.$el.querySelector(".tree-node-inner"); t._draggableDestroy = Dr(n, { preventSelect: Yr(t.store.preventSelect), getEl: function () { return t.$el }, minTranslate: 10, drag: function (r, n, i) { ti.dragStart(); var o = { event: r, options: n, store: i }; if (t.store.ondragstart && !1 === t.store.ondragstart(t.data, o)) return !1; if (!Wn(t.data)) return !1; t.store.$emit("drag", t.data); var a = t.data.parent.children; t.startPosition = { siblings: a, index: a.indexOf(t.data) }, e.innerStyle.height = i.el.offsetHeight + "px", ur(e, t.data), t.data.class += " dragging" }, moving: function (e, r, n) { if (0 !== n.movedCount) { var i = { event: e, options: r, store: n }; return ti.call(t, i) } }, drop: function (r, n, i) { ti.dragEnd(); var o = { event: r, options: n, store: i }; if (t.store.ondragend && !1 === t.store.ondragend(t.data, o)) Ke(e.parent.children, e); else { var a = e._vm.store, c = a !== t.store ? t.store : null; ur(t.data, e), Ke(e.parent.children, e), t.data.class = t.data.class.replace(/(^| )dragging( |$)/g, " "), a.$emit("drop", t.data, a, c), c && c.$emit("drop", t.data, a, c); var l = t.data.parent.children; l === t.startPosition.siblings && l.indexOf(t.data) === t.startPosition.index || (t.store.$emit("change", t.data, a, c), c && c.$emit("change", t.data, a, c)), t.startPosition = null } } }) } else t._draggableDestroy && (t._draggableDestroy(), t._draggableDestroy = null) }, { immediate: !0 }) } } }, void 0, void 0), ni = [], ii = { _id: "draggable_tree_drag_placeHolder", level: null, droppable: !1, isDragPlaceHolder: !0, class: "draggable-placeholder", style: {}, innerStyle: {}, innerClass: "draggable-placeholder-inner", innerBackStyle: {}, innerBackClass: "draggable-placeholder-inner-back" }; var oi = function (t, e, r, n, i, o, a, c) { const l = ("function" == typeof r ? r.options : r) || {}; return l.__file = "DraggableTree.vue", l.render || (l.render = t.render, l.staticRenderFns = t.staticRenderFns, l._compiled = !0, i && (l.functional = !0)), l._scopeId = n, l }({}, 0, { extends: gr, props: { getTriggerEl: { type: Function }, draggable: {}, droppable: { default: !0 }, crossTree: {}, ondragstart: { type: Function }, ondragend: { type: Function }, preventSelect: { default: !0 }, dir: { type: String, default: "ltr" } }, components: { TreeNode: ri }, data: function () { return { dplh: ii, trees: ni } }, created: function () { ni.push(this) }, mounted: function () { }, beforeDestroy: function () { Ke(ni, this) } }, void 0, void 0); t.Tree = gr, t.TreeNode = dr, t.DraggableTree = oi, t.DraggableTreeNode = ri, Object.defineProperty(t, "__esModule", { value: !0 }) });
//# sourceMappingURL=vue-draggable-nested-tree.min.js.map