@trintel/zooy 1.0.8 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{button-J_l629CJ.js → button-By7aRhFi.js} +4 -4
- package/dist/chunks/{button-C0ysaw92.js → button-CRxkguK3.js} +1 -1
- package/dist/chunks/{button-skeleton-C6DFZmZH.js → button-skeleton-CZmGLr_c.js} +1 -1
- package/dist/chunks/{button-skeleton-B_Sgp5GT.js → button-skeleton-DlCzuT6h.js} +4 -4
- package/dist/chunks/{checkbox-zD4SZkfz.js → checkbox-BMZ3_jkv.js} +5 -5
- package/dist/chunks/{checkbox-CgRvu8uo.js → checkbox-GUazWfM6.js} +1 -1
- package/dist/chunks/{class-map-CZy_lapI.js → class-map-Bpavh3zd.js} +1 -1
- package/dist/chunks/{class-map-C3HqAjJs.js → class-map-CewEiUeS.js} +1 -1
- package/dist/chunks/{content-switcher-item-D7my36A_.js → content-switcher-item-BzWtaEk8.js} +4 -4
- package/dist/chunks/{content-switcher-item-BwGyOcvG.js → content-switcher-item-DBiwY_5f.js} +1 -1
- package/dist/chunks/{dropdown-item-B4aGGhUu.js → dropdown-item-B8fOInIi.js} +1 -1
- package/dist/chunks/{dropdown-item-sj9_Q-2Y.js → dropdown-item-C1hnXvNw.js} +6 -6
- package/dist/chunks/{icon-loader-ChdGfSmj.js → icon-loader-BX6j0QV9.js} +1 -1
- package/dist/chunks/{icon-loader-pWXWFpAd.js → icon-loader-Cv5XYGqj.js} +1 -1
- package/dist/chunks/{icon-loader-utils-CD3l842s.js → icon-loader-utils-C_72Dnig.js} +1 -1
- package/dist/chunks/{icon-loader-utils-DdfPalr5.js → icon-loader-utils-CjBhA13V.js} +1 -1
- package/dist/chunks/{if-defined-C0WXUd0n.js → if-defined-B-VZmIag.js} +1 -1
- package/dist/chunks/{if-defined-h0V4oPE0.js → if-defined-Zq_Rpirs.js} +1 -1
- package/dist/chunks/{if-non-empty-DsNNfSW1.js → if-non-empty-CaK_h1Vn.js} +1 -1
- package/dist/chunks/if-non-empty-Dy-cc4QJ.js +1 -0
- package/dist/chunks/{index-CZIkoNzI.js → index-1OOPg4-d.js} +1 -1
- package/dist/chunks/{index-pE6aTBiZ.js → index-1eFOI8oe.js} +5 -5
- package/dist/chunks/{index-DPfXz4s4.js → index-B-OulI8n.js} +1 -1
- package/dist/chunks/{index-Q_jttfI5.js → index-B4L1iU-L.js} +7 -7
- package/dist/chunks/{index-ClkBeEyN.js → index-B4O0_8IT.js} +1 -1
- package/dist/chunks/{index-CIhGaNHB.js → index-B7CvW1Hr.js} +9 -9
- package/dist/chunks/{index-BGh5ukZB.js → index-BATw38c7.js} +3 -3
- package/dist/chunks/{index-DD8IhgVt.js → index-BERUsrwS.js} +1 -1
- package/dist/chunks/{index-Eo0QL5BD.js → index-BIWPmvxN.js} +6 -6
- package/dist/chunks/{index-BUX_B_Go.js → index-BJ0SBIwX.js} +6 -6
- package/dist/chunks/{index-BOOSwnW2.js → index-BX1au7I9.js} +1 -1
- package/dist/chunks/{index-BVNauB67.js → index-BXPG0d_k.js} +2 -2
- package/dist/chunks/{index-_YrjxtQS.js → index-B_Lmpm35.js} +8 -8
- package/dist/chunks/{index-BIz0BjjL.js → index-Bb8PCTuf.js} +1 -1
- package/dist/chunks/{index-hsgeVwtf.js → index-BeQ7ZTCw.js} +5 -5
- package/dist/chunks/{index-B_-ytvrp.js → index-BfiLUJJ3.js} +1 -1
- package/dist/chunks/{index-DRnD7wpG.js → index-BftJaPKS.js} +1 -1
- package/dist/chunks/{index-BNR5ONEM.js → index-BlfAhx-m.js} +1 -1
- package/dist/chunks/{index-DV4mpy_b.js → index-BmMr-B9I.js} +1 -1
- package/dist/chunks/{index-qCBuo7Dj.js → index-BoIS4S70.js} +3 -3
- package/dist/chunks/{index-BN42k7S9.js → index-BpfNVIsW.js} +1 -1
- package/dist/chunks/{index-DxZy3oU4.js → index-BsVpu7Ej.js} +1 -1
- package/dist/chunks/{index-B80vAz9U.js → index-BugJTHwJ.js} +1 -1
- package/dist/chunks/{index-DE9QLbNF.js → index-Bv0Kq6vx.js} +1 -1
- package/dist/chunks/{index-C8Epo2Nt.js → index-BwpbR54Z.js} +4 -4
- package/dist/chunks/{index-ze2WZhYO.js → index-Bx5tyF27.js} +3 -3
- package/dist/chunks/{index-BuuxULtA.js → index-ByxUjlpc.js} +1 -1
- package/dist/chunks/{index-CANkW4Or.js → index-Bz-sh-N4.js} +1 -1
- package/dist/chunks/{index-tyzdclid.js → index-C0JKLTdV.js} +1 -1
- package/dist/chunks/{index-poW5zIu0.js → index-C2Q5YPz1.js} +1 -1
- package/dist/chunks/{index-KHZmzPoF.js → index-C6YhnCuw.js} +1 -1
- package/dist/chunks/{index-DtKsNvQ_.js → index-C6nmbFvI.js} +1 -1
- package/dist/chunks/{index-Ss_rpifk.js → index-C7bz1V4O.js} +3 -3
- package/dist/chunks/{index-Dp1sKeLf.js → index-C9adbF3V.js} +1 -1
- package/dist/chunks/{index-g_0TpuQy.js → index-CCOIDxIB.js} +1 -1
- package/dist/chunks/{index-5HiyK8z_.js → index-CDpK5GU3.js} +1 -1
- package/dist/chunks/index-CNQHUhaQ.js +1 -0
- package/dist/chunks/{index-BVuFwiy8.js → index-CQY3cMqQ.js} +1 -1
- package/dist/chunks/{index-CI4IDokw.js → index-CRvczclO.js} +6 -6
- package/dist/chunks/{index-BM6jRp79.js → index-CVH7Hv6v.js} +5 -5
- package/dist/chunks/{index-TZUVB-W3.js → index-CVqAaFaO.js} +5 -5
- package/dist/chunks/{index-ChqgnI6f.js → index-CW3NpEbP.js} +1 -1
- package/dist/chunks/{index-jwYklbEt.js → index-CYLJDFiF.js} +5 -5
- package/dist/chunks/{index-CTt-WSM-.js → index-CZi-f4G4.js} +1 -1
- package/dist/chunks/{index-C-y2nrc1.js → index-CbKeQETj.js} +3 -3
- package/dist/chunks/{index-BOdoMpSP.js → index-Cdk8HqBZ.js} +1 -1
- package/dist/chunks/{index-D64233nd.js → index-ChbKcl-Z.js} +5 -5
- package/dist/chunks/{index-Bg1BBBMy.js → index-Cit60IYk.js} +1 -1
- package/dist/chunks/{index-CuqzTZu2.js → index-Cm3Uqia6.js} +6 -6
- package/dist/chunks/{index-Dy_V6Qce.js → index-CuZwN_ME.js} +3 -3
- package/dist/chunks/{index-BdCneYBx.js → index-CuuD-d5b.js} +2 -2
- package/dist/chunks/{index-BhdW2QbN.js → index-CvnLooVH.js} +1 -1
- package/dist/chunks/{index-C4MmJOdJ.js → index-CwXwz8dA.js} +1 -1
- package/dist/chunks/{index-v9RmWFs_.js → index-Cy5Gs96d.js} +1 -1
- package/dist/chunks/{index-90TKvaQz.js → index-CyHAdAxX.js} +7 -7
- package/dist/chunks/{index-dygVIOMF.js → index-CyeWQ9VJ.js} +1 -1
- package/dist/chunks/{index-Cy2K76Ai.js → index-D-20UbuG.js} +1 -1
- package/dist/chunks/{index-LoWfGWWA.js → index-D1xYcspc.js} +1 -1
- package/dist/chunks/{index-CKplFFc-.js → index-D2B2bs5k.js} +2 -2
- package/dist/chunks/{index-Di4YY_Ua.js → index-D2Z_PWuf.js} +1 -1
- package/dist/chunks/{index-By_1f8e1.js → index-D5_-tX11.js} +1 -1
- package/dist/chunks/{index-Bzp_dDt9.js → index-DD3tbFs9.js} +4 -4
- package/dist/chunks/{index-Dt-eWAJs.js → index-DEH3Oujh.js} +5 -5
- package/dist/chunks/{index-C1BCLU9c.js → index-DFzKxIGc.js} +7 -7
- package/dist/chunks/{index-DoczycjW.js → index-DKJCj-0F.js} +1 -1
- package/dist/chunks/{index-BXCZNGbC.js → index-DKOcsQER.js} +1 -1
- package/dist/chunks/{index-DTy7Kl9T.js → index-DLt6oTR3.js} +1 -1
- package/dist/chunks/{index-Oa3v3_7X.js → index-DQhfyFM4.js} +4 -4
- package/dist/chunks/{index-vVzSlOxh.js → index-DRYB8Q2c.js} +1 -1
- package/dist/chunks/{index-u-6uWe_o.js → index-DRsjyMRL.js} +4 -4
- package/dist/chunks/{index-BfyiB6r5.js → index-DScZj-56.js} +1 -1
- package/dist/chunks/{index-BRUV1CNi.js → index-DU7E0qo4.js} +7 -7
- package/dist/chunks/{index-BGWhDeBi.js → index-DVTOmcgu.js} +2 -2
- package/dist/chunks/{index-BqYoAbjK.js → index-DW24dyDr.js} +1 -1
- package/dist/chunks/{index--nPiAPdI.js → index-DW9xYANG.js} +3 -3
- package/dist/chunks/{index-BTM514kF.js → index-DYmmXHAT.js} +5 -5
- package/dist/chunks/{index-DNP3ng82.js → index-DYtqDqPL.js} +1 -1
- package/dist/chunks/{index-B9WY40Mg.js → index-DayFRhmw.js} +8 -8
- package/dist/chunks/{index-D0qgF0lD.js → index-DbT4fJLV.js} +7 -7
- package/dist/chunks/{index-BCd5o-O6.js → index-Dcs-4ouA.js} +4 -4
- package/dist/chunks/{index-Coav7Owj.js → index-DdzuoIsX.js} +6 -6
- package/dist/chunks/{index-D6_et4O5.js → index-DhwMNjJj.js} +4 -4
- package/dist/chunks/index-DjLSW4tB.js +2 -0
- package/dist/chunks/{index-sP0n4M3S.js → index-Do0fzNBP.js} +4 -4
- package/dist/chunks/{index-Bo68CzXB.js → index-DqWolj0i.js} +1 -1
- package/dist/chunks/{index-Cvvea2-F.js → index-DrRc4GOh.js} +5 -5
- package/dist/chunks/{index-Co8vob2d.js → index-DvbDUmZp.js} +7 -7
- package/dist/chunks/{index-DNQ1-jUj.js → index-DxlTsgQ8.js} +5 -5
- package/dist/chunks/{index-aMr7w_kx.js → index-LSL0pD4U.js} +1 -1
- package/dist/chunks/{index-BLJaTPjJ.js → index-ScGZvs71.js} +10 -10
- package/dist/chunks/{index-DgkK15bX.js → index-Smwc4F8-.js} +1 -1
- package/dist/chunks/{index-CQxC5gdy.js → index-TelAKDy3.js} +5 -5
- package/dist/chunks/{index-FyLcWuoP.js → index-UDUbB14y.js} +1 -1
- package/dist/chunks/{index-Bm7ePd1P.js → index-UfSJPzl_.js} +5 -5
- package/dist/chunks/{index-eTqONZnk.js → index-XY3TWQ_7.js} +1 -1
- package/dist/chunks/{index-DMtD0b_3.js → index-ZmTVduMY.js} +4 -4
- package/dist/chunks/{index-C8sCBvHj.js → index-ePccMpcM.js} +1 -1
- package/dist/chunks/{index-DtqsUG21.js → index-f2QnoTe2.js} +3 -3
- package/dist/chunks/{index-DuePdA69.js → index-jRYYdv4C.js} +5 -5
- package/dist/chunks/{index-BoxMbYX3.js → index-m978pani.js} +3 -3
- package/dist/chunks/{index-CmPWJUnL.js → index-o7Ly8WNV.js} +1 -1
- package/dist/chunks/{index-DBcWalCu.js → index-pT9YwIX-.js} +1 -1
- package/dist/chunks/{index-GgCbc4A-.js → index-s53NHb2d.js} +8 -8
- package/dist/chunks/{index-M2ihC48l.js → index-yIVEgAA_.js} +1 -1
- package/dist/chunks/{loading-icon-BLLYUpvs.js → loading-icon-Co-jn71c.js} +1 -1
- package/dist/chunks/{loading-icon-Cp8xIAZy.js → loading-icon-Dx2ktHir.js} +1 -1
- package/dist/chunks/{main-CPeOiLq5.js → main-BqOledN0.js} +813 -689
- package/dist/chunks/main-DHy75dVb.js +87 -0
- package/dist/chunks/{property-Cti8Pknb.js → property-B0b41oBL.js} +1 -1
- package/dist/chunks/{property-CpWqCPHX.js → property-Dg6D0XVD.js} +1 -1
- package/dist/chunks/register-BH6NpHIA.js +1 -0
- package/dist/chunks/{register-D01rr_6V.js → register-DgYdd65A.js} +353 -351
- package/dist/chunks/{register-BZYvuwHN.js → register-bMHOSpvM.js} +1 -1
- package/dist/chunks/{register-BDgKT87m.js → register-h6ZQPYju.js} +1 -1
- package/dist/chunks/{search-BoFbUjIa.js → search-CdbmNKGt.js} +6 -6
- package/dist/chunks/{search-B-sFlTAG.js → search-hgh8azYe.js} +1 -1
- package/dist/chunks/{select-item-BdZ5OqWH.js → select-item-B7Nispm3.js} +7 -7
- package/dist/chunks/{select-item-Uyiqlm7Q.js → select-item-bxxL-G6O.js} +1 -1
- package/dist/chunks/{state-D3hzHQXM.js → state-8K5PPQVS.js} +1 -1
- package/dist/chunks/{state-Czcme0IZ.js → state-C1eYNc3M.js} +1 -1
- package/dist/chunks/{text-input-iJP2nFN5.js → text-input-BFGnBN6w.js} +1 -1
- package/dist/chunks/{text-input-R3AwYWSw.js → text-input-Cax4HzgZ.js} +5 -5
- package/dist/chunks/{tooltip-content-Brl7yv5K.js → tooltip-content-CF2lm8EZ.js} +1 -1
- package/dist/chunks/{tooltip-content-Bug744xy.js → tooltip-content-l8Mg7xk8.js} +3 -3
- package/dist/chunks/{unsafe-html-NpLKNGt_.js → unsafe-html-Dw4MFH2g.js} +1 -1
- package/dist/chunks/{unsafe-html-BKdKIEJy.js → unsafe-html-Hoj8nqTC.js} +1 -1
- package/dist/zooy.cjs.js +1 -1
- package/dist/zooy.es.js +1 -1
- package/package.json +2 -3
- package/src/sass/_zoo.scss +20 -0
- package/src/sass/main.scss +1 -0
- package/dist/chunks/if-non-empty-4oodvODv.js +0 -1
- package/dist/chunks/index-DjW0vKON.js +0 -2
- package/dist/chunks/index-DwZ-6zgN.js +0 -1
- package/dist/chunks/main-AZkvXZM1.js +0 -65
- package/dist/chunks/register-BT1eatec.js +0 -1
|
@@ -3,35 +3,35 @@ const numericString = "0123456789".split("");
|
|
|
3
3
|
const alphaLower = "abcdefghijklmnopqrstuvwxyz".split(""), alphaUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
|
|
4
4
|
[...alphaLower, ...alphaUpper, ...numericString];
|
|
5
5
|
(/* @__PURE__ */ new Map()).set("true", !0).set("false", !1);
|
|
6
|
-
const compose = (...
|
|
6
|
+
const compose = (...U) => (...w) => U.reduce((D, O) => (F) => D(O(F)))(...w), identity = (U) => U, whatType = (U) => typeof U, isDef = (U) => U !== void 0, isUndefined = (U) => U === void 0, isDefAndNotNull = (U) => U != null, isString = (U) => whatType(U) === "string", isNumber = (U) => whatType(U) === "number" && !Number.isNaN(
|
|
7
7
|
/** @type number */
|
|
8
|
-
|
|
9
|
-
), isObject = (
|
|
8
|
+
U
|
|
9
|
+
), isObject = (U) => (U && typeof U == "object" && !(U instanceof Array) && !(U instanceof Set) && !(U instanceof Map) && !(U instanceof Date)) === !0, isArray = (U) => U instanceof Array, reverse = (U) => Array.from(U).reduce((w, D) => [D, ...w], []), toLowerCase = (U) => U.toLowerCase(), toString$1 = (U) => U + "", toNumber = (U) => +U;
|
|
10
10
|
compose(toLowerCase, toString$1);
|
|
11
11
|
const makeRandomString = () => {
|
|
12
|
-
let
|
|
13
|
-
return Math.floor(Math.random() *
|
|
14
|
-
}, stripLeadingChar = (
|
|
12
|
+
let U = 2147483648;
|
|
13
|
+
return Math.floor(Math.random() * U).toString(36) + Math.abs(Math.floor(Math.random() * U) ^ Date.now()).toString(36);
|
|
14
|
+
}, stripLeadingChar = (U) => (w) => w.startsWith(U) ? w.slice(U.length) : w, join = (U) => (w) => w.join(U);
|
|
15
15
|
compose(join(""), reverse);
|
|
16
|
-
const pathOr = (
|
|
17
|
-
const
|
|
16
|
+
const pathOr = (U, w) => (D) => {
|
|
17
|
+
const O = w.reduce((F, q) => {
|
|
18
18
|
try {
|
|
19
19
|
return F[maybeNumber(q)];
|
|
20
20
|
} catch {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
}, D);
|
|
24
|
-
return
|
|
25
|
-
}, objToPaths = (
|
|
26
|
-
isObject(F) ? objToPaths(F, [...w,
|
|
27
|
-
}), D), randomId = (
|
|
24
|
+
return O === void 0 ? U : O;
|
|
25
|
+
}, objToPaths = (U, w = [], D = []) => (Object.entries(U).forEach(([O, F]) => {
|
|
26
|
+
isObject(F) ? objToPaths(F, [...w, O], D) : D.push([[...w, O], F]);
|
|
27
|
+
}), D), randomId = (U) => {
|
|
28
28
|
const w = makeRandomString();
|
|
29
|
-
return
|
|
30
|
-
}, maybeNumber = (
|
|
31
|
-
if (
|
|
32
|
-
return
|
|
33
|
-
const w = 1 *
|
|
34
|
-
return w > Number.MAX_SAFE_INTEGER || Number.isNaN(w) ?
|
|
29
|
+
return U ? w.substr(0, U) : w;
|
|
30
|
+
}, maybeNumber = (U) => {
|
|
31
|
+
if (U === null || whatType(U) === "string" && U.length > 1 && U.startsWith("0") && !U.startsWith("0."))
|
|
32
|
+
return U;
|
|
33
|
+
const w = 1 * U;
|
|
34
|
+
return w > Number.MAX_SAFE_INTEGER || Number.isNaN(w) ? U : w;
|
|
35
35
|
};
|
|
36
36
|
compose(toNumber, join(""), reverse, toString$1);
|
|
37
37
|
class Evt extends EventTarget {
|
|
@@ -139,10 +139,10 @@ class Evt extends EventTarget {
|
|
|
139
139
|
* @param {!Function} action
|
|
140
140
|
* @param {boolean|!Object} options
|
|
141
141
|
*/
|
|
142
|
-
listen(w, D,
|
|
143
|
-
w.addEventListener(D,
|
|
142
|
+
listen(w, D, O, F = !1) {
|
|
143
|
+
w.addEventListener(D, O, F);
|
|
144
144
|
const q = this.listeningTo.get(w) || {};
|
|
145
|
-
q[D] = () => w.removeEventListener(D,
|
|
145
|
+
q[D] = () => w.removeEventListener(D, O, F), this.listeningTo.set(w, q), isDef(w.isListenedToBy) && w.isListenedToBy(this);
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Remove self from all components tt are listening to me.
|
|
@@ -157,9 +157,9 @@ class Evt extends EventTarget {
|
|
|
157
157
|
* @param {string=} opt_event
|
|
158
158
|
*/
|
|
159
159
|
stopListeningTo(w, D) {
|
|
160
|
-
w && this.listeningTo.has(w) && (isDef(w.isObservedBy) && w.isObservedBy.delete(this), isDef(D) ? (Object.entries(this.listeningTo.get(w)).forEach(([
|
|
161
|
-
|
|
162
|
-
}), Object.keys(this.listeningTo.get(w)).length || this.listeningTo.delete(w)) : (Object.values(this.listeningTo.get(w)).forEach((
|
|
160
|
+
w && this.listeningTo.has(w) && (isDef(w.isObservedBy) && w.isObservedBy.delete(this), isDef(D) ? (Object.entries(this.listeningTo.get(w)).forEach(([O, F]) => {
|
|
161
|
+
O === D && F();
|
|
162
|
+
}), Object.keys(this.listeningTo.get(w)).length || this.listeningTo.delete(w)) : (Object.values(this.listeningTo.get(w)).forEach((O) => O()), this.listeningTo.delete(w)));
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Removes all the event listeners that is managed by this
|
|
@@ -184,8 +184,8 @@ class Evt extends EventTarget {
|
|
|
184
184
|
* @param {number} interval The interval in milliseconds
|
|
185
185
|
*/
|
|
186
186
|
doOnBeat(w, D) {
|
|
187
|
-
const
|
|
188
|
-
this.activeIntervals.add(
|
|
187
|
+
const O = setInterval(w, D);
|
|
188
|
+
this.activeIntervals.add(O);
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
191
191
|
* Disposes of the component. Calls `exitDocument`, which is expected to
|
|
@@ -237,128 +237,106 @@ const UiEventType = {
|
|
|
237
237
|
READY: randomId(),
|
|
238
238
|
PANEL_MINIMIZE: randomId(),
|
|
239
239
|
FORM_SUBMIT_SUCCESS: randomId()
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
function toDate(O) {
|
|
268
|
-
return O instanceof Date ? O : !isNaN(O) || /^\d+$/.test(O) ? new Date(parseInt(O)) : (O = (O || "").trim().replace(/\.\d+/, "").replace(/-/, "/").replace(/-/, "/").replace(/(\d)T(\d)/, "$1 $2").replace(/Z/, " UTC").replace(/([+-]\d\d):?(\d\d)/, " $1$2"), new Date(O));
|
|
269
|
-
}
|
|
270
|
-
function formatDiff(O, w) {
|
|
271
|
-
var D = O < 0 ? 1 : 0;
|
|
272
|
-
O = Math.abs(O);
|
|
273
|
-
for (var U = O, F = 0; O >= SEC_ARRAY[F] && F < SEC_ARRAY.length; F++)
|
|
274
|
-
O /= SEC_ARRAY[F];
|
|
275
|
-
return O = Math.floor(O), F *= 2, O > (F === 0 ? 9 : 1) && (F += 1), w(O, F, U)[D].replace("%s", O.toString());
|
|
276
|
-
}
|
|
277
|
-
function diffSec(O, w) {
|
|
278
|
-
var D = /* @__PURE__ */ new Date();
|
|
279
|
-
return (+D - +toDate(O)) / 1e3;
|
|
280
|
-
}
|
|
281
|
-
var format = function(O, w, D) {
|
|
282
|
-
var U = diffSec(O);
|
|
283
|
-
return formatDiff(U, getLocale(w));
|
|
284
|
-
};
|
|
285
|
-
register("en_US", en_US);
|
|
286
|
-
register("zh_CN", zh_CN);
|
|
287
|
-
const getInputChecked_ = function(O) {
|
|
288
|
-
return O.checked ? (
|
|
240
|
+
}, format = (U) => {
|
|
241
|
+
const D = Math.floor((/* @__PURE__ */ new Date() - U) / 1e3), O = [
|
|
242
|
+
{ name: "year", seconds: 31536e3 },
|
|
243
|
+
{ name: "month", seconds: 2592e3 },
|
|
244
|
+
{ name: "week", seconds: 604800 },
|
|
245
|
+
{ name: "day", seconds: 86400 },
|
|
246
|
+
{ name: "hour", seconds: 3600 },
|
|
247
|
+
{ name: "minute", seconds: 60 },
|
|
248
|
+
{ name: "second", seconds: 1 }
|
|
249
|
+
];
|
|
250
|
+
if (D < 0) {
|
|
251
|
+
const F = Math.abs(D);
|
|
252
|
+
for (const q of O) {
|
|
253
|
+
const W = Math.floor(F / q.seconds);
|
|
254
|
+
if (W >= 1)
|
|
255
|
+
return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(W, q.name);
|
|
256
|
+
}
|
|
257
|
+
return "just now";
|
|
258
|
+
}
|
|
259
|
+
for (const F of O) {
|
|
260
|
+
const q = Math.floor(D / F.seconds);
|
|
261
|
+
if (q >= 1)
|
|
262
|
+
return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-q, F.name);
|
|
263
|
+
}
|
|
264
|
+
return "just now";
|
|
265
|
+
}, getInputChecked_ = function(U) {
|
|
266
|
+
return U.checked ? (
|
|
289
267
|
/** @type {?} */
|
|
290
|
-
|
|
268
|
+
U.value
|
|
291
269
|
) : null;
|
|
292
|
-
}, getSelectSingle_ = function(
|
|
270
|
+
}, getSelectSingle_ = function(U) {
|
|
293
271
|
const w = (
|
|
294
272
|
/** @type {!HTMLSelectElement} */
|
|
295
|
-
|
|
273
|
+
U.selectedIndex
|
|
296
274
|
);
|
|
297
275
|
return w >= 0 ? (
|
|
298
276
|
/** @type {!HTMLSelectElement} */
|
|
299
|
-
|
|
277
|
+
U.options[w].value
|
|
300
278
|
) : null;
|
|
301
|
-
}, getSelectMultiple_ = function(
|
|
279
|
+
}, getSelectMultiple_ = function(U) {
|
|
302
280
|
const w = [];
|
|
303
|
-
for (let D,
|
|
304
|
-
|
|
281
|
+
for (let D, O = 0; D = /** @type {!HTMLSelectElement} */
|
|
282
|
+
U.options[O]; O++)
|
|
305
283
|
D.selected && w.push(D.value);
|
|
306
284
|
return w.length ? w : null;
|
|
307
|
-
}, getValue = function(
|
|
285
|
+
}, getValue = function(U) {
|
|
308
286
|
const w = (
|
|
309
287
|
/** @type {!HTMLInputElement} */
|
|
310
|
-
|
|
288
|
+
U.type
|
|
311
289
|
);
|
|
312
290
|
switch (isString(w) && w.toLowerCase()) {
|
|
313
291
|
case "checkbox":
|
|
314
292
|
case "radio":
|
|
315
|
-
return getInputChecked_(
|
|
293
|
+
return getInputChecked_(U);
|
|
316
294
|
case "select-one":
|
|
317
|
-
return getSelectSingle_(
|
|
295
|
+
return getSelectSingle_(U);
|
|
318
296
|
case "select-multiple":
|
|
319
|
-
return getSelectMultiple_(
|
|
297
|
+
return getSelectMultiple_(U);
|
|
320
298
|
default:
|
|
321
|
-
return
|
|
299
|
+
return U.value !== null && U.value !== void 0 ? U.value : null;
|
|
322
300
|
}
|
|
323
|
-
}, formToJSON = (
|
|
301
|
+
}, formToJSON = (U) => [...U].reduce((w, D) => (w[D.name] = D.value, w), {}), replaceNode = (U, w) => {
|
|
324
302
|
const D = w.parentNode;
|
|
325
|
-
D && D.replaceChild(
|
|
326
|
-
}, removeNode = (
|
|
327
|
-
w.parentNode && w.parentNode.insertBefore(
|
|
328
|
-
}, isInPage = (
|
|
329
|
-
const w = window.getComputedStyle(
|
|
330
|
-
return D +
|
|
331
|
-
}, totalHeight = (
|
|
332
|
-
const w = window.getComputedStyle(
|
|
333
|
-
return D +
|
|
303
|
+
D && D.replaceChild(U, w);
|
|
304
|
+
}, removeNode = (U) => U && U.parentNode ? U.parentNode.removeChild(U) : null, insertSiblingAfter = (U, w) => {
|
|
305
|
+
w.parentNode && w.parentNode.insertBefore(U, w.nextSibling);
|
|
306
|
+
}, isInPage = (U) => U === document.body ? !1 : document.body.contains(U), getPos = (U) => [U.offsetLeft, U.offsetTop], randomColour = (U) => [1, 2, 3].map(() => Math.floor(Math.random() * 256) + 1).reduce((w, D) => `${w}${D},`, "rgba(") + `${U || 0.5}`, totalWidth = (U) => {
|
|
307
|
+
const w = window.getComputedStyle(U), D = U.offsetWidth, O = parseFloat(w.marginLeft) + parseFloat(w.marginRight), F = parseFloat(w.paddingLeft) + parseFloat(w.paddingRight), q = parseFloat(w.borderLeftWidth) + parseFloat(w.borderRightWidth);
|
|
308
|
+
return D + O - F + q;
|
|
309
|
+
}, totalHeight = (U) => {
|
|
310
|
+
const w = window.getComputedStyle(U), D = U.offsetHeight, O = parseFloat(w.marginTop) + parseFloat(w.marginBottom), F = parseFloat(w.paddingTop) + parseFloat(w.paddingBottom), q = parseFloat(w.borderTopWidth) + parseFloat(w.borderBottomWidth);
|
|
311
|
+
return D + O - F + q;
|
|
334
312
|
}, evalScripts = (comp) => (arr) => {
|
|
335
313
|
arr && Array.from(arr).forEach((s) => {
|
|
336
314
|
(function() {
|
|
337
315
|
eval(s.text);
|
|
338
316
|
}).bind(comp)();
|
|
339
317
|
});
|
|
340
|
-
}, evalModules = (
|
|
318
|
+
}, evalModules = (U) => (w) => {
|
|
341
319
|
w && Array.from(w).forEach((D) => {
|
|
342
320
|
(function() {
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
const F =
|
|
346
|
-
q && (F.zvComponent =
|
|
347
|
-
}).bind(
|
|
321
|
+
const O = document.createElement("script");
|
|
322
|
+
O.type = "module", O.textContent = D.textContent;
|
|
323
|
+
const F = U.getElement(), q = getElDataMap(D).zv_comp_access;
|
|
324
|
+
q && (F.zvComponent = U, F.classList.add(q)), F.appendChild(O);
|
|
325
|
+
}).bind(U)();
|
|
348
326
|
});
|
|
349
|
-
}, splitScripts = (
|
|
350
|
-
const D = new DOMParser().parseFromString(
|
|
327
|
+
}, splitScripts = (U) => {
|
|
328
|
+
const D = new DOMParser().parseFromString(U, "text/html");
|
|
351
329
|
return {
|
|
352
330
|
html: D.body.firstElementChild,
|
|
353
331
|
scripts: D.querySelectorAll('script:not([type="module"])'),
|
|
354
332
|
modules: D.querySelectorAll('script[type="module"]')
|
|
355
333
|
};
|
|
356
|
-
}, handleTemplateProm = (
|
|
357
|
-
D ?
|
|
358
|
-
}, toggleClass = (
|
|
359
|
-
const D = !Array.from(
|
|
360
|
-
return enableClass(
|
|
361
|
-
}, getElDataMap = (
|
|
334
|
+
}, handleTemplateProm = (U) => Promise.resolve(splitScripts(U)), enableClass = (U, w, D) => {
|
|
335
|
+
D ? U.classList.add(w) : U.classList.remove(w);
|
|
336
|
+
}, toggleClass = (U, w) => {
|
|
337
|
+
const D = !Array.from(U.classList).includes(w);
|
|
338
|
+
return enableClass(U, w, D), D;
|
|
339
|
+
}, getElDataMap = (U) => U ? Object.assign({}, U.dataset || {}) : {}, dtFormatter = {
|
|
362
340
|
year: "numeric",
|
|
363
341
|
month: "short",
|
|
364
342
|
day: "numeric",
|
|
@@ -378,13 +356,13 @@ const getInputChecked_ = function(O) {
|
|
|
378
356
|
second: "2-digit",
|
|
379
357
|
// hour12: false
|
|
380
358
|
hourCycle: "h23"
|
|
381
|
-
}), dateToZooyStdTimeString = (
|
|
382
|
-
const [{ value: w }, , { value: D }, , { value:
|
|
383
|
-
return `${D} ${w} ${
|
|
384
|
-
}, parseMomentAgo = (
|
|
385
|
-
let
|
|
386
|
-
isNumber(
|
|
387
|
-
const F = new Date(
|
|
359
|
+
}), dateToZooyStdTimeString = (U) => {
|
|
360
|
+
const [{ value: w }, , { value: D }, , { value: O }, , { value: F }, , { value: q }, , { value: W }, ,] = dtf.formatToParts(U);
|
|
361
|
+
return `${D} ${w} ${O} ${F}:${q}:${W}`;
|
|
362
|
+
}, parseMomentAgo = (U, w = "both", D = void 0) => {
|
|
363
|
+
let O = U;
|
|
364
|
+
isNumber(O) && O < 9466848e5 ? O = O * 1e3 : D && (O = O + D);
|
|
365
|
+
const F = new Date(O), q = format(F), W = dateToZooyStdTimeString(F);
|
|
388
366
|
switch (w) {
|
|
389
367
|
case "time|ago":
|
|
390
368
|
return `${W}|${q}`;
|
|
@@ -398,30 +376,30 @@ const getInputChecked_ = function(O) {
|
|
|
398
376
|
default:
|
|
399
377
|
return `${q} (${W})`;
|
|
400
378
|
}
|
|
401
|
-
}, parseObfuscated = (
|
|
402
|
-
const D = ((F) => (q) => q < F.length - 4)(
|
|
403
|
-
return ((F) => F.split("").map((q, W) => D(W) ? "*" : q).join(""))(
|
|
404
|
-
}, parseMap = (/* @__PURE__ */ new Map()).set(void 0, (
|
|
405
|
-
const
|
|
406
|
-
return
|
|
407
|
-
}), parseDataPropKvDef = (
|
|
408
|
-
const [F, q] =
|
|
379
|
+
}, parseObfuscated = (U) => {
|
|
380
|
+
const D = ((F) => (q) => q < F.length - 4)(U);
|
|
381
|
+
return ((F) => F.split("").map((q, W) => D(W) ? "*" : q).join(""))(U);
|
|
382
|
+
}, parseMap = (/* @__PURE__ */ new Map()).set(void 0, (U, w, D) => identity(U)).set("", (U, w, D) => identity(U)).set("class_update_only", (U, w, D) => identity(U)).set("frac_100", (U, w, D) => Math.round(U * 100 * 100) / 100).set("date_and_time", (U, w, D) => new Date(U).toLocaleString(void 0, dtFormatter)).set("date", (U, w, D) => new Date(U).toLocaleString(void 0, dFormatter)).set("moment_ago", (U, w, D) => parseMomentAgo(U, "both", D.zdd_date_tz || void 0)).set("moment_ago_only", (U, w, D) => parseMomentAgo(U, "ago", D.zdd_date_tz || void 0)).set("moment_ago_datetime", (U, w, D) => parseMomentAgo(U, "datetime", D.zdd_date_tz || void 0)).set("pretty-json", (U, w, D) => JSON.stringify(U, null, 4)).set("obfuscated", (U, w, D) => parseObfuscated(U)).set("linear-progress", (U, w, D) => {
|
|
383
|
+
const O = toNumber(D.zpmax), F = w.linProg;
|
|
384
|
+
return O && F && (F.progress = U / O, U = void 0), U;
|
|
385
|
+
}), parseDataPropKvDef = (U) => U.trim().split(",").map((O) => O.trim()).map((O) => {
|
|
386
|
+
const [F, q] = O.split(":").map((W) => W.trim());
|
|
409
387
|
return [F, q];
|
|
410
|
-
}).filter(([
|
|
411
|
-
const D = getElDataMap(
|
|
412
|
-
delete
|
|
413
|
-
const
|
|
414
|
-
return parseDataPropKvDef(
|
|
415
|
-
|
|
416
|
-
}),
|
|
417
|
-
}, mapDataToEls = (
|
|
388
|
+
}).filter(([O, F]) => O !== "" && F !== ""), parseDataProps = (U, w) => {
|
|
389
|
+
const D = getElDataMap(U);
|
|
390
|
+
delete U.dataset.zoodatapropkv;
|
|
391
|
+
const O = D.zoodatapropkv || "";
|
|
392
|
+
return parseDataPropKvDef(O).forEach(([q, W]) => {
|
|
393
|
+
U.dataset[q] = pathOr(void 0, W.split("."))(w);
|
|
394
|
+
}), U;
|
|
395
|
+
}, mapDataToEls = (U, w, D = /* @__PURE__ */ new Map(), O = void 0) => {
|
|
418
396
|
if (!w)
|
|
419
397
|
return;
|
|
420
398
|
const F = new Map([...parseMap, ...D]);
|
|
421
|
-
[...
|
|
422
|
-
const W = getElDataMap(q),
|
|
423
|
-
let
|
|
424
|
-
if (isDefAndNotNull(
|
|
399
|
+
[...U.querySelectorAll("[data-zdd],[data-zdd_class_update],[data-zdd_template_loop_index]")].forEach((q) => {
|
|
400
|
+
const W = getElDataMap(q), Y = W.zdd || "", G = W.zdd_parse_as, K = W.zdd_render_effect || "", Q = W.zdd_class_update, tt = W.zdd_template_loop_index, J = W.zdd_units || "";
|
|
401
|
+
let X = pathOr(void 0, Y.split("."))(w);
|
|
402
|
+
if (isDefAndNotNull(X) && (X = F.has(G) ? F.get(G)(X, q, W) : X), tt && isNumber(O) && (console.log("loopIndex: ", tt, " opt_loopIndex: ", O), tt === "zero_indexed" ? q.innerHTML = O : tt === "one_indexed" ? q.innerHTML = O + 1 : q.innerHTML = O), Q) {
|
|
425
403
|
const [Z, et, st] = Q.split(":"), rt = pathOr(void 0, Z.split("."))(w);
|
|
426
404
|
if (isDefAndNotNull(rt))
|
|
427
405
|
switch (et) {
|
|
@@ -441,26 +419,26 @@ const getInputChecked_ = function(O) {
|
|
|
441
419
|
break;
|
|
442
420
|
}
|
|
443
421
|
}
|
|
444
|
-
if (G === "templated-array" && isArray(
|
|
445
|
-
if (
|
|
422
|
+
if (G === "templated-array" && isArray(X))
|
|
423
|
+
if (X.length === 0)
|
|
446
424
|
q.classList.add("display__none");
|
|
447
425
|
else {
|
|
448
|
-
q.classList.remove("display__none"),
|
|
426
|
+
q.classList.remove("display__none"), X = X || [];
|
|
449
427
|
const Z = q.firstElementChild;
|
|
450
|
-
Z.classList.remove("display__none"), q.replaceChildren(...
|
|
428
|
+
Z.classList.remove("display__none"), q.replaceChildren(...X.map((et, st) => {
|
|
451
429
|
const rt = Z.cloneNode(!0), nt = parseDataProps(rt, et);
|
|
452
430
|
return mapDataToEls(nt, et, void 0, st), nt;
|
|
453
431
|
}));
|
|
454
432
|
}
|
|
455
|
-
else if (isDefAndNotNull(
|
|
433
|
+
else if (isDefAndNotNull(X))
|
|
456
434
|
if (K === "typewriter") {
|
|
457
435
|
let Z = 0;
|
|
458
|
-
const et =
|
|
436
|
+
const et = X + J, st = 5, rt = () => {
|
|
459
437
|
Z < et.length && (q.innerHTML += et.charAt(Z), Z++, setTimeout(rt, st));
|
|
460
438
|
};
|
|
461
439
|
q.innerHTML = "", rt();
|
|
462
440
|
} else
|
|
463
|
-
q.innerHTML =
|
|
441
|
+
q.innerHTML = X + J;
|
|
464
442
|
});
|
|
465
443
|
}, domUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
466
444
|
__proto__: null,
|
|
@@ -571,10 +549,10 @@ class ComponentLibraryRegistry {
|
|
|
571
549
|
*/
|
|
572
550
|
static getCacheStats() {
|
|
573
551
|
const w = {};
|
|
574
|
-
for (const [D,
|
|
552
|
+
for (const [D, O] of this.#t.entries())
|
|
575
553
|
w[D] = {
|
|
576
|
-
cacheSize:
|
|
577
|
-
config:
|
|
554
|
+
cacheSize: O.cache.size,
|
|
555
|
+
config: O.config
|
|
578
556
|
};
|
|
579
557
|
return w;
|
|
580
558
|
}
|
|
@@ -896,10 +874,10 @@ class Component extends Evt {
|
|
|
896
874
|
if (w)
|
|
897
875
|
for (const D of ComponentLibraryRegistry.getRegisteredLibraries())
|
|
898
876
|
try {
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
} catch (
|
|
902
|
-
console.debug(`[${D}] Cleanup error during component disposal (non-critical):`,
|
|
877
|
+
const O = ComponentLibraryRegistry.get(D);
|
|
878
|
+
O.dispose && O.dispose(w);
|
|
879
|
+
} catch (O) {
|
|
880
|
+
console.debug(`[${D}] Cleanup error during component disposal (non-critical):`, O);
|
|
903
881
|
}
|
|
904
882
|
super.dispose();
|
|
905
883
|
}
|
|
@@ -921,7 +899,7 @@ class Component extends Evt {
|
|
|
921
899
|
* if any of the handlers returns false this will also return false.
|
|
922
900
|
*/
|
|
923
901
|
dispatchCompEvent(w, D) {
|
|
924
|
-
const
|
|
902
|
+
const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.COMP, O);
|
|
925
903
|
return this.dispatchEvent(F);
|
|
926
904
|
}
|
|
927
905
|
}
|
|
@@ -953,14 +931,14 @@ const EV = {
|
|
|
953
931
|
DROP: "drop",
|
|
954
932
|
// Transitions
|
|
955
933
|
TRANSITIONEND: "transitionend"
|
|
956
|
-
}, touchEvents = [EV.TOUCHMOVE, EV.TOUCHSTART, EV.TOUCHEND], isTouchEvent = (
|
|
934
|
+
}, touchEvents = [EV.TOUCHMOVE, EV.TOUCHSTART, EV.TOUCHEND], isTouchEvent = (U) => touchEvents.includes(U.type), normalizeEvent = (U) => (isTouchEvent(U) && (U.clientX = U.targetTouches[0].clientX, U.clientY = U.targetTouches[0].clientY), U), dragStartListener = (U, w, D, O) => (F) => {
|
|
957
935
|
F.preventDefault();
|
|
958
936
|
const q = normalizeEvent(F), W = (
|
|
959
937
|
/** @type {!HTMLElement} */
|
|
960
938
|
q.currentTarget
|
|
961
|
-
), [
|
|
962
|
-
let Z = freeMoveListener(
|
|
963
|
-
["x", "ew"].includes(
|
|
939
|
+
), [Y, G] = getPos(W), K = q.clientX - Y, Q = q.clientY - G, tt = U(Y, G, K, Q, W), J = D(Y, G, K, Q, W), X = w(Y, G, K, Q, W);
|
|
940
|
+
let Z = freeMoveListener(X, W, K, Q);
|
|
941
|
+
["x", "ew"].includes(O) ? Z = xMoveOnlyListener(X, W, K) : ["y", "ns"].includes(O) && (Z = yMoveOnlyListener(X, W, K, Q));
|
|
964
942
|
let et = !1;
|
|
965
943
|
const st = (nt) => {
|
|
966
944
|
et = !0, Z(nt);
|
|
@@ -968,30 +946,30 @@ const EV = {
|
|
|
968
946
|
document.removeEventListener(EV.MOUSEMOVE, st, !0), document.removeEventListener(EV.TOUCHMOVE, st, !0), document.removeEventListener(EV.MOUSEUP, rt, !0), document.removeEventListener(EV.TOUCHEND, rt, !0), et && J(nt);
|
|
969
947
|
};
|
|
970
948
|
return document.addEventListener(EV.MOUSEUP, rt, !0), document.addEventListener(EV.TOUCHEND, rt, !0), document.addEventListener(EV.MOUSEMOVE, st, !0), document.addEventListener(EV.TOUCHMOVE, st, !0), tt(F), rt;
|
|
971
|
-
}, freeMoveListener = (
|
|
949
|
+
}, freeMoveListener = (U, w, D, O) => (F) => {
|
|
972
950
|
F.preventDefault();
|
|
973
951
|
const q = normalizeEvent(F);
|
|
974
|
-
w.style.left = `${q.clientX - D}px`, w.style.top = `${q.clientY -
|
|
975
|
-
}, xMoveOnlyListener = (
|
|
952
|
+
w.style.left = `${q.clientX - D}px`, w.style.top = `${q.clientY - O}px`, U(q);
|
|
953
|
+
}, xMoveOnlyListener = (U, w, D, O) => (F) => {
|
|
976
954
|
F.preventDefault();
|
|
977
955
|
const q = normalizeEvent(F);
|
|
978
|
-
w.style.left = `${q.clientX - D}px`,
|
|
979
|
-
}, yMoveOnlyListener = (
|
|
956
|
+
w.style.left = `${q.clientX - D}px`, U(q);
|
|
957
|
+
}, yMoveOnlyListener = (U, w, D, O) => (F) => {
|
|
980
958
|
F.preventDefault();
|
|
981
959
|
const q = normalizeEvent(F);
|
|
982
|
-
w.style.top = `${q.clientY -
|
|
983
|
-
}, makeEmitter = (
|
|
984
|
-
|
|
985
|
-
component:
|
|
986
|
-
browserEvent:
|
|
960
|
+
w.style.top = `${q.clientY - O}px`, U(q);
|
|
961
|
+
}, makeEmitter = (U, w) => (D, O, F, q, W) => (Y) => {
|
|
962
|
+
U.dispatchCompEvent(w, {
|
|
963
|
+
component: U,
|
|
964
|
+
browserEvent: Y,
|
|
987
965
|
left: D,
|
|
988
|
-
top:
|
|
989
|
-
clientX:
|
|
990
|
-
clientY:
|
|
966
|
+
top: O,
|
|
967
|
+
clientX: Y.clientX,
|
|
968
|
+
clientY: Y.clientY,
|
|
991
969
|
xOrg: F,
|
|
992
970
|
yOrg: q,
|
|
993
|
-
deltaX:
|
|
994
|
-
deltaY:
|
|
971
|
+
deltaX: Y.clientX - F - D,
|
|
972
|
+
deltaY: Y.clientY - q - O,
|
|
995
973
|
target: W
|
|
996
974
|
});
|
|
997
975
|
};
|
|
@@ -1043,12 +1021,12 @@ class Dragger extends Component {
|
|
|
1043
1021
|
* Make the component draggable
|
|
1044
1022
|
*/
|
|
1045
1023
|
unlock() {
|
|
1046
|
-
const w = (D) => (
|
|
1047
|
-
this.#r = D(
|
|
1024
|
+
const w = (D) => (O) => {
|
|
1025
|
+
this.#r = D(O);
|
|
1048
1026
|
};
|
|
1049
1027
|
if (this.isInDocument && this.#s) {
|
|
1050
|
-
const D = makeEmitter(this, UiEventType.COMP_DRAG_MOVE),
|
|
1051
|
-
|
|
1028
|
+
const D = makeEmitter(this, UiEventType.COMP_DRAG_MOVE), O = makeEmitter(this, UiEventType.COMP_DRAG_START), F = makeEmitter(this, UiEventType.COMP_DRAG_END), q = dragStartListener(
|
|
1029
|
+
O,
|
|
1052
1030
|
D,
|
|
1053
1031
|
F,
|
|
1054
1032
|
this.#t
|
|
@@ -1070,41 +1048,41 @@ const splitRe_ = new RegExp(
|
|
|
1070
1048
|
), ComponentIndex = {
|
|
1071
1049
|
PATH: 5,
|
|
1072
1050
|
QUERY_DATA: 6
|
|
1073
|
-
}, split = (
|
|
1051
|
+
}, split = (U) => (
|
|
1074
1052
|
/** @type {!Array<string|undefined>} */
|
|
1075
|
-
|
|
1076
|
-
), decodeOrEmpty_ = (
|
|
1053
|
+
U.match(splitRe_)
|
|
1054
|
+
), decodeOrEmpty_ = (U, w) => U ? decodeURI(U.replace(/%25/g, "%2525")) : "", getPath = (U) => decodeOrEmpty_(split(U)[ComponentIndex.PATH]), getQueryData = (U) => decodeOrEmpty_(split(U)[ComponentIndex.QUERY_DATA]), objectToUrlParms = (U) => [...Object.entries(U)].map(
|
|
1077
1055
|
(w) => `${w[0]}=${w[1]}`
|
|
1078
|
-
).join("&"), isValidValue = (
|
|
1079
|
-
const [
|
|
1080
|
-
return isValidValue(
|
|
1056
|
+
).join("&"), isValidValue = (U) => U != null && U !== "", queryDataToMap = (U) => U.split("&").reduce((w, D) => {
|
|
1057
|
+
const [O, F] = D.split("=");
|
|
1058
|
+
return isValidValue(O) && isValidValue(F) && w.set(O, F), w;
|
|
1081
1059
|
}, /* @__PURE__ */ new Map()), uriUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1082
1060
|
__proto__: null,
|
|
1083
1061
|
getPath,
|
|
1084
1062
|
getQueryData,
|
|
1085
1063
|
objectToUrlParms,
|
|
1086
1064
|
queryDataToMap
|
|
1087
|
-
}, Symbol.toStringTag, { value: "Module" })), stripLeadingSpace = stripLeadingChar(" "), stripLeadingSlash = stripLeadingChar("/"), getCookieByName = (
|
|
1065
|
+
}, Symbol.toStringTag, { value: "Module" })), stripLeadingSpace = stripLeadingChar(" "), stripLeadingSlash = stripLeadingChar("/"), getCookieByName = (U) => document.cookie.split(";").map((w) => w.split("=")).reduce((w, D) => w.set(stripLeadingSpace(D[0]), D[1]), /* @__PURE__ */ new Map()).get(U), spinner = (U) => {
|
|
1088
1066
|
let w = 0, D;
|
|
1089
|
-
const
|
|
1067
|
+
const O = (F) => {
|
|
1090
1068
|
const q = F > 0;
|
|
1091
1069
|
return q ? w += 1 : w -= 1, q ? w === 1 : w === 0;
|
|
1092
1070
|
};
|
|
1093
1071
|
return (F) => {
|
|
1094
|
-
D = D || document.getElementById(
|
|
1072
|
+
D = D || document.getElementById(U), D && O(F) && D.classList.toggle("viz", w > 0);
|
|
1095
1073
|
};
|
|
1096
|
-
}, spin = spinner("the_loader"), startSpin = () => Promise.resolve(spin(1)), stopSpin = (
|
|
1074
|
+
}, spin = spinner("the_loader"), startSpin = () => Promise.resolve(spin(1)), stopSpin = (U) => (spin(0), Promise.resolve(U)), checkStatus = (U) => U.ok ? Promise.resolve(U) : Promise.reject(new Error(`${U.url} ${U.status} (${U.statusText})`)), checkStatusTwo = (U) => (w) => {
|
|
1097
1075
|
if (w.type === "opaqueredirect" || w.redirected) {
|
|
1098
1076
|
const D = stripLeadingSlash(getPath(w.url));
|
|
1099
|
-
|
|
1077
|
+
U.setIsRedirected(!0, D), console.log("Redirect detected", D);
|
|
1100
1078
|
}
|
|
1101
1079
|
return checkStatus(w);
|
|
1102
|
-
}, getJson = (
|
|
1080
|
+
}, getJson = (U) => U.json(), getText = (U) => U.text().then(
|
|
1103
1081
|
(w) => Promise.resolve(w),
|
|
1104
1082
|
(w) => Promise.reject(new Error(`Could not get text from response: ${w}`))
|
|
1105
|
-
), getTextOrJson = (
|
|
1083
|
+
), getTextOrJson = (U) => U.headers.get("Content-Type") === "application/json" ? getJson(U) : getText(U), jsonInit = (U, w, D = "POST", O = void 0) => {
|
|
1106
1084
|
const F = new Headers();
|
|
1107
|
-
F.append("Content-type", "application/json"), F.append("X-Requested-With", "XMLHttpRequest"),
|
|
1085
|
+
F.append("Content-type", "application/json"), F.append("X-Requested-With", "XMLHttpRequest"), U && U !== "" && F.append("Authorization", `Bearer ${U}`);
|
|
1108
1086
|
const q = {
|
|
1109
1087
|
cache: "no-cache",
|
|
1110
1088
|
method: D,
|
|
@@ -1112,8 +1090,8 @@ const splitRe_ = new RegExp(
|
|
|
1112
1090
|
credentials: "include",
|
|
1113
1091
|
body: JSON.stringify(w)
|
|
1114
1092
|
};
|
|
1115
|
-
return
|
|
1116
|
-
}, basicPutPostPatchInit = (
|
|
1093
|
+
return O && (q.signal = O), q;
|
|
1094
|
+
}, basicPutPostPatchInit = (U, w, D = !1, O = void 0) => {
|
|
1117
1095
|
const F = new Headers();
|
|
1118
1096
|
if (w && w !== "" && F.append("Authorization", `Bearer ${w}`), F.append("X-Requested-With", "XMLHttpRequest"), D) {
|
|
1119
1097
|
const W = getCookieByName("csrftoken");
|
|
@@ -1121,29 +1099,29 @@ const splitRe_ = new RegExp(
|
|
|
1121
1099
|
}
|
|
1122
1100
|
const q = {
|
|
1123
1101
|
cache: "no-cache",
|
|
1124
|
-
method:
|
|
1102
|
+
method: U,
|
|
1125
1103
|
headers: F,
|
|
1126
1104
|
redirect: "follow",
|
|
1127
1105
|
// This is anyway the default.
|
|
1128
1106
|
credentials: "include"
|
|
1129
1107
|
};
|
|
1130
|
-
return
|
|
1131
|
-
}, formPostInit = (
|
|
1132
|
-
const F = basicPutPostPatchInit("POST",
|
|
1108
|
+
return O && (q.signal = O), q;
|
|
1109
|
+
}, formPostInit = (U, w, D = void 0) => {
|
|
1110
|
+
const F = basicPutPostPatchInit("POST", U, !1, D);
|
|
1133
1111
|
return F.body = new FormData(w.formEl), F;
|
|
1134
|
-
}, basicGetInit = (
|
|
1112
|
+
}, basicGetInit = (U, w = void 0) => {
|
|
1135
1113
|
const D = new Headers();
|
|
1136
|
-
D.append("Authorization", `Bearer ${
|
|
1137
|
-
const
|
|
1114
|
+
D.append("Authorization", `Bearer ${U}`), D.append("X-Requested-With", "XMLHttpRequest");
|
|
1115
|
+
const O = {
|
|
1138
1116
|
cache: "no-cache",
|
|
1139
1117
|
headers: D,
|
|
1140
1118
|
credentials: "include"
|
|
1141
1119
|
};
|
|
1142
|
-
return w && (
|
|
1143
|
-
}, putPostPatchNobody = (
|
|
1144
|
-
const D = new Request(
|
|
1120
|
+
return w && (O.signal = w), O;
|
|
1121
|
+
}, putPostPatchNobody = (U, w) => {
|
|
1122
|
+
const D = new Request(U);
|
|
1145
1123
|
return fetch(D, w).then(checkStatus).then(getText);
|
|
1146
|
-
}, genCatchClause = (
|
|
1124
|
+
}, genCatchClause = (U, w = void 0) => (D) => (stopSpin("").then(identity), D.name === "AbortError" ? console.info(U, "ABORTED!") : console.error(U, D), w);
|
|
1147
1125
|
class UserManager {
|
|
1148
1126
|
/**
|
|
1149
1127
|
* @param {!Object=} opt_data
|
|
@@ -1204,12 +1182,12 @@ class UserManager {
|
|
|
1204
1182
|
* @return {Promise}
|
|
1205
1183
|
*/
|
|
1206
1184
|
formSubmit(w) {
|
|
1207
|
-
const D = new Request(w.uri.toString()),
|
|
1185
|
+
const D = new Request(w.uri.toString()), O = w.processSubmitReply.bind(w), F = genCatchClause("Form submit error");
|
|
1208
1186
|
return startSpin().then(() => fetch(D, formPostInit(
|
|
1209
1187
|
this.jwt,
|
|
1210
1188
|
w,
|
|
1211
1189
|
w.abortController.signal
|
|
1212
|
-
))).then(checkStatusTwo(w)).then(stopSpin).then(getTextOrJson).then(
|
|
1190
|
+
))).then(checkStatusTwo(w)).then(stopSpin).then(getTextOrJson).then(O).catch(F);
|
|
1213
1191
|
}
|
|
1214
1192
|
/**
|
|
1215
1193
|
* @param {string} uri
|
|
@@ -1217,11 +1195,11 @@ class UserManager {
|
|
|
1217
1195
|
* @param {AbortSignal|undefined} signal
|
|
1218
1196
|
* @return {Promise}
|
|
1219
1197
|
*/
|
|
1220
|
-
putNoBody(w, D = void 0,
|
|
1198
|
+
putNoBody(w, D = void 0, O = !1) {
|
|
1221
1199
|
const F = genCatchClause("putNobody error"), q = basicPutPostPatchInit(
|
|
1222
1200
|
"PUT",
|
|
1223
1201
|
this.jwt,
|
|
1224
|
-
|
|
1202
|
+
O,
|
|
1225
1203
|
D
|
|
1226
1204
|
);
|
|
1227
1205
|
return putPostPatchNobody(w, q).catch(F);
|
|
@@ -1232,8 +1210,8 @@ class UserManager {
|
|
|
1232
1210
|
* @return {Promise}
|
|
1233
1211
|
*/
|
|
1234
1212
|
fetch(w, D = void 0) {
|
|
1235
|
-
const
|
|
1236
|
-
return startSpin().then(() => fetch(
|
|
1213
|
+
const O = new Request(w.toString()), F = genCatchClause(`UMan Text GET Fetch: ${w}`);
|
|
1214
|
+
return startSpin().then(() => fetch(O, basicGetInit(this.jwt, D))).then(checkStatus).then(stopSpin).then(getText).catch(F);
|
|
1237
1215
|
}
|
|
1238
1216
|
/**
|
|
1239
1217
|
* Use this if you want to directly get a parsed template that does not go
|
|
@@ -1243,8 +1221,8 @@ class UserManager {
|
|
|
1243
1221
|
* @return {Promise}
|
|
1244
1222
|
*/
|
|
1245
1223
|
fetchAndSplit(w, D = void 0) {
|
|
1246
|
-
const
|
|
1247
|
-
return this.fetch(w, D).then(handleTemplateProm).catch(
|
|
1224
|
+
const O = genCatchClause(`fetchAndSplit: ${w}`);
|
|
1225
|
+
return this.fetch(w, D).then(handleTemplateProm).catch(O);
|
|
1248
1226
|
}
|
|
1249
1227
|
/**
|
|
1250
1228
|
* @param {string} uri
|
|
@@ -1252,13 +1230,13 @@ class UserManager {
|
|
|
1252
1230
|
* @return {Promise}
|
|
1253
1231
|
*/
|
|
1254
1232
|
async fetchJson(w, D = void 0) {
|
|
1255
|
-
const
|
|
1233
|
+
const O = new Request(w.toString()), F = genCatchClause(`fetchJson: ${w}`, {}), q = basicGetInit(this.jwt, D);
|
|
1256
1234
|
await startSpin();
|
|
1257
1235
|
let W = {};
|
|
1258
1236
|
try {
|
|
1259
|
-
W = await (await fetch(
|
|
1260
|
-
} catch (
|
|
1261
|
-
return F(
|
|
1237
|
+
W = await (await fetch(O, q)).json();
|
|
1238
|
+
} catch (Y) {
|
|
1239
|
+
return F(Y);
|
|
1262
1240
|
}
|
|
1263
1241
|
return await stopSpin(), W;
|
|
1264
1242
|
}
|
|
@@ -1268,8 +1246,8 @@ class UserManager {
|
|
|
1268
1246
|
* @param {AbortSignal|undefined} signal
|
|
1269
1247
|
* @return {Promise}
|
|
1270
1248
|
*/
|
|
1271
|
-
patchJson(w, D,
|
|
1272
|
-
const F = new Request(w.toString()), q = genCatchClause(`patchJson: ${w}`), W = jsonInit(this.jwt, D, "PATCH",
|
|
1249
|
+
patchJson(w, D, O = void 0) {
|
|
1250
|
+
const F = new Request(w.toString()), q = genCatchClause(`patchJson: ${w}`), W = jsonInit(this.jwt, D, "PATCH", O);
|
|
1273
1251
|
return fetch(F, W).then(checkStatus).then(getJson).catch(q);
|
|
1274
1252
|
}
|
|
1275
1253
|
/**
|
|
@@ -1278,8 +1256,8 @@ class UserManager {
|
|
|
1278
1256
|
* @param {AbortSignal|undefined} signal
|
|
1279
1257
|
* @return {Promise}
|
|
1280
1258
|
*/
|
|
1281
|
-
postJson(w, D,
|
|
1282
|
-
const F = new Request(w.toString()), q = genCatchClause(`postJson: ${w}`), W = jsonInit(this.jwt, D, "POST",
|
|
1259
|
+
postJson(w, D, O = void 0) {
|
|
1260
|
+
const F = new Request(w.toString()), q = genCatchClause(`postJson: ${w}`), W = jsonInit(this.jwt, D, "POST", O);
|
|
1283
1261
|
return fetch(F, W).then(checkStatus).then(getJson).catch(q);
|
|
1284
1262
|
}
|
|
1285
1263
|
/**
|
|
@@ -1288,8 +1266,8 @@ class UserManager {
|
|
|
1288
1266
|
* @param {AbortSignal|undefined} signal
|
|
1289
1267
|
* @return {Promise}
|
|
1290
1268
|
*/
|
|
1291
|
-
putJson(w, D,
|
|
1292
|
-
const F = new Request(w.toString()), q = genCatchClause(`putJson: ${w}`), W = jsonInit(this.jwt, D, "PUT",
|
|
1269
|
+
putJson(w, D, O = void 0) {
|
|
1270
|
+
const F = new Request(w.toString()), q = genCatchClause(`putJson: ${w}`), W = jsonInit(this.jwt, D, "PUT", O);
|
|
1293
1271
|
return fetch(F, W).then(checkStatus).then(getJson).catch(q);
|
|
1294
1272
|
}
|
|
1295
1273
|
/**
|
|
@@ -1298,8 +1276,8 @@ class UserManager {
|
|
|
1298
1276
|
* @param {AbortSignal|undefined} signal
|
|
1299
1277
|
* @return {Promise}
|
|
1300
1278
|
*/
|
|
1301
|
-
delJson(w, D,
|
|
1302
|
-
const F = new Request(w.toString()), q = genCatchClause(`delJson: ${w}`), W = jsonInit(this.jwt, D, "DELETE",
|
|
1279
|
+
delJson(w, D, O = void 0) {
|
|
1280
|
+
const F = new Request(w.toString()), q = genCatchClause(`delJson: ${w}`), W = jsonInit(this.jwt, D, "DELETE", O);
|
|
1303
1281
|
return fetch(F, W).then(checkStatus).then(getJson).catch(q);
|
|
1304
1282
|
}
|
|
1305
1283
|
}
|
|
@@ -1399,9 +1377,9 @@ class Panel extends Component {
|
|
|
1399
1377
|
getCarbonComponentById(w) {
|
|
1400
1378
|
if (this.carbonComponents)
|
|
1401
1379
|
for (const D of this.carbonComponents.values()) {
|
|
1402
|
-
const
|
|
1403
|
-
if (
|
|
1404
|
-
return
|
|
1380
|
+
const O = D.find((F) => F.id === w);
|
|
1381
|
+
if (O)
|
|
1382
|
+
return O;
|
|
1405
1383
|
}
|
|
1406
1384
|
}
|
|
1407
1385
|
//--[ Template Render ]-----
|
|
@@ -1422,10 +1400,10 @@ class Panel extends Component {
|
|
|
1422
1400
|
*/
|
|
1423
1401
|
renderWithTemplate(w) {
|
|
1424
1402
|
const D = this.user;
|
|
1425
|
-
return D ? D.fetch(this.uri, this.abortController.signal).then((
|
|
1403
|
+
return D ? D.fetch(this.uri, this.abortController.signal).then((O) => (this.assertCanRenderAsync(), w && w(this), this.onRenderWithTemplateReply(O).catch((F) => {
|
|
1426
1404
|
F.message !== Component.compErrors().ALREADY_DISPOSED && console.error("RenderWithTemplate Err:", F);
|
|
1427
|
-
}), this)).catch((
|
|
1428
|
-
throw console.error("Panel.renderWithTemplate fetch failed:",
|
|
1405
|
+
}), this)).catch((O) => {
|
|
1406
|
+
throw console.error("Panel.renderWithTemplate fetch failed:", O), O;
|
|
1429
1407
|
}) : Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"));
|
|
1430
1408
|
}
|
|
1431
1409
|
/**
|
|
@@ -1457,16 +1435,16 @@ class Panel extends Component {
|
|
|
1457
1435
|
* @param qs
|
|
1458
1436
|
*/
|
|
1459
1437
|
onReplacePartialDom(w, D) {
|
|
1460
|
-
const
|
|
1461
|
-
if (isUndefined(
|
|
1438
|
+
const O = this.getElement();
|
|
1439
|
+
if (isUndefined(O))
|
|
1462
1440
|
return;
|
|
1463
1441
|
const F = w.html;
|
|
1464
1442
|
if (D.startsWith("."))
|
|
1465
|
-
[...
|
|
1443
|
+
[...O.querySelectorAll(D)].filter((q) => isDefAndNotNull(q.id)).map((q) => [q, F.querySelector(`#${q.id}`)]).filter(([q, W]) => isDefAndNotNull(W)).forEach(([q, W]) => {
|
|
1466
1444
|
q.parentNode.replaceChild(W, q), this.parseContent(W);
|
|
1467
1445
|
});
|
|
1468
1446
|
else if (D.startsWith("#")) {
|
|
1469
|
-
const q = F.querySelector(D), W =
|
|
1447
|
+
const q = F.querySelector(D), W = O.querySelector(D);
|
|
1470
1448
|
W.parentNode.replaceChild(q, W), this.parseContent(q);
|
|
1471
1449
|
}
|
|
1472
1450
|
this.evalScripts(w.scripts), this.evalModules(w.modules);
|
|
@@ -1479,10 +1457,10 @@ class Panel extends Component {
|
|
|
1479
1457
|
* that will receive the reply event.
|
|
1480
1458
|
*/
|
|
1481
1459
|
renderWithJSON(w) {
|
|
1482
|
-
return this.user ? this.user.fetchJson(this.uri_, this.abortController.signal).then((
|
|
1483
|
-
this.assertCanRenderAsync(), w && w(
|
|
1484
|
-
}).catch((
|
|
1485
|
-
throw console.error("Panel.renderWithJSON fetch failed:",
|
|
1460
|
+
return this.user ? this.user.fetchJson(this.uri_, this.abortController.signal).then((O) => {
|
|
1461
|
+
this.assertCanRenderAsync(), w && w(O, this), this.onRenderWithJSON(O).then(identity);
|
|
1462
|
+
}).catch((O) => {
|
|
1463
|
+
throw console.error("Panel.renderWithJSON fetch failed:", O), O;
|
|
1486
1464
|
}) : Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"));
|
|
1487
1465
|
}
|
|
1488
1466
|
/**
|
|
@@ -1499,7 +1477,7 @@ class Panel extends Component {
|
|
|
1499
1477
|
* @param {Object} _elDataMap
|
|
1500
1478
|
* @param {Object} _json
|
|
1501
1479
|
*/
|
|
1502
|
-
onAsyncJsonReply(w, D,
|
|
1480
|
+
onAsyncJsonReply(w, D, O) {
|
|
1503
1481
|
}
|
|
1504
1482
|
/**
|
|
1505
1483
|
* Called on each async HTML response, after the content is in the DOM
|
|
@@ -1523,7 +1501,7 @@ class Panel extends Component {
|
|
|
1523
1501
|
parseContent(w) {
|
|
1524
1502
|
if (this.debugMe("Enable interactions. Panel:", w), typeof window.customElements < "u" && ComponentLibraryRegistry.has("carbon")) {
|
|
1525
1503
|
const J = ComponentLibraryRegistry.get("carbon");
|
|
1526
|
-
J.render.call(this, w, J.cache).catch((
|
|
1504
|
+
J.render.call(this, w, J.cache).catch((X) => console.error("[Zooy] Carbon initialization failed:", X));
|
|
1527
1505
|
}
|
|
1528
1506
|
if (ComponentLibraryRegistry.has("mdc")) {
|
|
1529
1507
|
const J = ComponentLibraryRegistry.get("mdc");
|
|
@@ -1534,80 +1512,80 @@ class Panel extends Component {
|
|
|
1534
1512
|
}), [...w.querySelectorAll(
|
|
1535
1513
|
".zoo__button:not(.external):not(.mdc-data-table__row)"
|
|
1536
1514
|
)].forEach((J) => {
|
|
1537
|
-
this.listen(J, EV.CLICK, (
|
|
1538
|
-
|
|
1539
|
-
const Z =
|
|
1515
|
+
this.listen(J, EV.CLICK, (X) => {
|
|
1516
|
+
X.stopPropagation();
|
|
1517
|
+
const Z = X.currentTarget, et = getElDataMap(Z);
|
|
1540
1518
|
this.dispatchPanelEvent(et.zv, Object.assign({
|
|
1541
|
-
orgEvt:
|
|
1519
|
+
orgEvt: X,
|
|
1542
1520
|
trigger: Z,
|
|
1543
1521
|
href: Z.href || et.href
|
|
1544
1522
|
}, et));
|
|
1545
1523
|
});
|
|
1546
1524
|
}), [...w.querySelectorAll("[href]:not(.external)")].forEach((J) => {
|
|
1547
|
-
this.listen(J, EV.CLICK, (
|
|
1548
|
-
const Z =
|
|
1549
|
-
|
|
1525
|
+
this.listen(J, EV.CLICK, (X) => {
|
|
1526
|
+
const Z = X.currentTarget;
|
|
1527
|
+
X.preventDefault(), X.stopPropagation();
|
|
1550
1528
|
const et = getElDataMap(Z), st = et.zv || "href";
|
|
1551
1529
|
this.dispatchPanelEvent(st, Object.assign({
|
|
1552
|
-
orgEvt:
|
|
1553
|
-
trigger:
|
|
1530
|
+
orgEvt: X,
|
|
1531
|
+
trigger: X.target,
|
|
1554
1532
|
href: Z.href || et.href
|
|
1555
1533
|
}, et));
|
|
1556
1534
|
});
|
|
1557
1535
|
}), [...w.querySelectorAll("form.intercept_submit")].forEach((J) => {
|
|
1558
|
-
J.noValidate = !0, this.listen(J, EV.SUBMIT, (
|
|
1559
|
-
|
|
1536
|
+
J.noValidate = !0, this.listen(J, EV.SUBMIT, (X) => {
|
|
1537
|
+
X.preventDefault(), X.stopPropagation();
|
|
1560
1538
|
const Z = getElDataMap(J), et = formToJSON(J.elements);
|
|
1561
1539
|
this.dispatchPanelEvent(Z.zv, Object.assign({
|
|
1562
|
-
orgEvt:
|
|
1563
|
-
trigger:
|
|
1540
|
+
orgEvt: X,
|
|
1541
|
+
trigger: X.target,
|
|
1564
1542
|
formData: et,
|
|
1565
1543
|
href: Z.href
|
|
1566
1544
|
}, Z));
|
|
1567
1545
|
});
|
|
1568
1546
|
}), [...w.querySelectorAll(".zoo__toggle_class_driver")].forEach(
|
|
1569
1547
|
(J) => {
|
|
1570
|
-
const
|
|
1548
|
+
const X = getElDataMap(J), Z = X.toggle_class_target_id, et = X.toggle_class, st = w.querySelector(`#${Z}`);
|
|
1571
1549
|
st && et && J.addEventListener(EV.CLICK, (rt) => {
|
|
1572
1550
|
rt.stopPropagation(), st.classList.toggle(et);
|
|
1573
1551
|
});
|
|
1574
1552
|
}
|
|
1575
1553
|
);
|
|
1576
|
-
const D = Array.from(w.querySelectorAll(".folder_drop_zone")),
|
|
1554
|
+
const D = Array.from(w.querySelectorAll(".folder_drop_zone")), O = Array.from(w.querySelectorAll("[draggable]")), F = (J) => {
|
|
1577
1555
|
J.preventDefault(), J.target.classList.add("drag_over");
|
|
1578
1556
|
}, q = (J) => {
|
|
1579
1557
|
J.preventDefault();
|
|
1580
1558
|
}, W = (J) => {
|
|
1581
1559
|
J.preventDefault(), J.target.classList.remove("drag_over");
|
|
1582
|
-
},
|
|
1560
|
+
}, Y = (J) => {
|
|
1583
1561
|
J.preventDefault(), J.target.classList.remove("drag_over");
|
|
1584
1562
|
}, G = (J) => {
|
|
1585
1563
|
J.preventDefault(), J.target.classList.remove("drag_over");
|
|
1586
1564
|
}, K = (J) => {
|
|
1587
1565
|
J.dataTransfer.dropEffect = "move";
|
|
1588
|
-
const
|
|
1589
|
-
J.dataTransfer.setData("text/plain", JSON.stringify(
|
|
1566
|
+
const X = getElDataMap(J.target);
|
|
1567
|
+
J.dataTransfer.setData("text/plain", JSON.stringify(X)), J.target.classList.add("drag_in_progress");
|
|
1590
1568
|
}, Q = (J) => {
|
|
1591
1569
|
J.target.classList.remove("drag_in_progress");
|
|
1592
1570
|
}, tt = (J) => {
|
|
1593
1571
|
G(J), J.stopPropagation();
|
|
1594
|
-
const
|
|
1572
|
+
const X = JSON.parse(J.dataTransfer.getData("text/plain")), Z = getElDataMap(J.target);
|
|
1595
1573
|
return this.dispatchPanelEvent("drop_on", {
|
|
1596
|
-
custom: { on: Z, from:
|
|
1574
|
+
custom: { on: Z, from: X }
|
|
1597
1575
|
}), !1;
|
|
1598
1576
|
};
|
|
1599
1577
|
D.forEach((J) => {
|
|
1600
|
-
this.listen(J, EV.DRAGOVER, q), this.listen(J, EV.DRAGENTER, F), this.listen(J, EV.DRAGEXIT,
|
|
1601
|
-
}),
|
|
1578
|
+
this.listen(J, EV.DRAGOVER, q), this.listen(J, EV.DRAGENTER, F), this.listen(J, EV.DRAGEXIT, Y), this.listen(J, EV.DRAGLEAVE, W), this.listen(J, EV.DROP, tt);
|
|
1579
|
+
}), O.forEach((J) => {
|
|
1602
1580
|
this.listen(J, EV.DRAGSTART, K), this.listen(J, EV.DRAGEND, Q);
|
|
1603
1581
|
}), [...w.querySelectorAll(".zoo_async_json")].forEach((J) => {
|
|
1604
|
-
const
|
|
1582
|
+
const X = getElDataMap(J), Z = X.href, et = this.onAsyncJsonReply.bind(this, J, X);
|
|
1605
1583
|
this.user.fetchJson(Z, this.abortController.signal).then(et);
|
|
1606
|
-
const st =
|
|
1584
|
+
const st = X.z_json_reusable;
|
|
1607
1585
|
st && (this.jsonCallFuncs = this.jsonCallFuncs || {}, this.jsonCallFuncs[st] = () => {
|
|
1608
1586
|
this.user.fetchJson(Z, this.abortController.signal).then(et);
|
|
1609
1587
|
});
|
|
1610
|
-
const rt = toNumber(
|
|
1588
|
+
const rt = toNumber(X.z_interval);
|
|
1611
1589
|
isNumber(rt) && this.doOnBeat(() => {
|
|
1612
1590
|
this.user.fetchJson(Z, this.abortController.signal).then(et);
|
|
1613
1591
|
}, rt * 60 * 1e3);
|
|
@@ -1616,11 +1594,11 @@ class Panel extends Component {
|
|
|
1616
1594
|
* @param {Element} el
|
|
1617
1595
|
*/
|
|
1618
1596
|
(J) => {
|
|
1619
|
-
const
|
|
1597
|
+
const X = getElDataMap(J), Z = X.href;
|
|
1620
1598
|
this.user.fetchAndSplit(Z, this.abortController.signal).then((st) => {
|
|
1621
|
-
J.appendChild(st.html), this.parseContent(J), this.evalScripts(st.scripts), this.evalModules(st.modules), this.onAsyncHtmlReply(J,
|
|
1599
|
+
J.appendChild(st.html), this.parseContent(J), this.evalScripts(st.scripts), this.evalModules(st.modules), this.onAsyncHtmlReply(J, X);
|
|
1622
1600
|
});
|
|
1623
|
-
const et = toNumber(
|
|
1601
|
+
const et = toNumber(X.z_interval);
|
|
1624
1602
|
isNumber(et) && this.doOnBeat(() => {
|
|
1625
1603
|
this.user.fetchAndSplit(Z, this.abortController.signal).then((st) => {
|
|
1626
1604
|
J.replaceChildren(st.html), this.parseContent(J), this.evalScripts(st.scripts), this.evalModules(st.modules);
|
|
@@ -1672,7 +1650,7 @@ class Panel extends Component {
|
|
|
1672
1650
|
* or if any of the handlers returns false this will also return false.
|
|
1673
1651
|
*/
|
|
1674
1652
|
dispatchPanelEvent(w, D) {
|
|
1675
|
-
const
|
|
1653
|
+
const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.PANEL, O);
|
|
1676
1654
|
return this.debugMe(`PANEL EVENT FIRED:
|
|
1677
1655
|
value:${w}
|
|
1678
1656
|
data:${D}`), this.dispatchEvent(F);
|
|
@@ -1697,7 +1675,7 @@ class FormPanel extends Panel {
|
|
|
1697
1675
|
* @param {boolean} intercept If false, we do not try and intercept the forms
|
|
1698
1676
|
*/
|
|
1699
1677
|
constructor(w, D = !0) {
|
|
1700
|
-
super(w), this.#s = D, this.onSubmitSucFunc = (
|
|
1678
|
+
super(w), this.#s = D, this.onSubmitSucFunc = (O, F) => null;
|
|
1701
1679
|
}
|
|
1702
1680
|
/**
|
|
1703
1681
|
* Gets the form element managed by this panel.
|
|
@@ -1726,12 +1704,12 @@ class FormPanel extends Panel {
|
|
|
1726
1704
|
* @return {?HTMLFormElement}
|
|
1727
1705
|
*/
|
|
1728
1706
|
getFormFromId(w) {
|
|
1729
|
-
let D = null,
|
|
1730
|
-
return w && (
|
|
1707
|
+
let D = null, O = this.getElement().querySelector("form");
|
|
1708
|
+
return w && (O = document.getElementById(
|
|
1731
1709
|
/** @type {string} */
|
|
1732
1710
|
w
|
|
1733
|
-
) ||
|
|
1734
|
-
|
|
1711
|
+
) || O), O && O.tagName.toLowerCase() === "form" && (D = /** @type {HTMLFormElement} */
|
|
1712
|
+
O), D;
|
|
1735
1713
|
}
|
|
1736
1714
|
//--[ Field Validation Methods ]--
|
|
1737
1715
|
/**
|
|
@@ -1766,7 +1744,7 @@ class FormPanel extends Panel {
|
|
|
1766
1744
|
* Clear all existing validation errors
|
|
1767
1745
|
*/
|
|
1768
1746
|
clearAllValidationErrors() {
|
|
1769
|
-
[...this.#t ? this.#t.elements : []].forEach((
|
|
1747
|
+
[...this.#t ? this.#t.elements : []].forEach((O) => this.#i(O)), [...this.#t.querySelectorAll(".non-field-errors")].forEach((O) => O.classList.remove("alert-error"));
|
|
1770
1748
|
}
|
|
1771
1749
|
/**
|
|
1772
1750
|
* Format the message dom object and insert it into the DOM
|
|
@@ -1775,7 +1753,7 @@ class FormPanel extends Panel {
|
|
|
1775
1753
|
* @param {string} _css A CSS class name to add to the alert div.
|
|
1776
1754
|
* @private
|
|
1777
1755
|
*/
|
|
1778
|
-
displayAlert_(w, D,
|
|
1756
|
+
displayAlert_(w, D, O) {
|
|
1779
1757
|
const F = document.getElementById(`${w.id}-helper-text`) || document.createElement("p");
|
|
1780
1758
|
F.textContent = D, this.#e.set(w, F);
|
|
1781
1759
|
}
|
|
@@ -1804,8 +1782,8 @@ class FormPanel extends Panel {
|
|
|
1804
1782
|
* @param {string=} opt_msg
|
|
1805
1783
|
*/
|
|
1806
1784
|
displayFieldError(w, D) {
|
|
1807
|
-
const
|
|
1808
|
-
w.classList.add("error"), this.displayAlert_(w,
|
|
1785
|
+
const O = D || w.validationMessage;
|
|
1786
|
+
w.classList.add("error"), this.displayAlert_(w, O, "alert-error");
|
|
1809
1787
|
}
|
|
1810
1788
|
/**
|
|
1811
1789
|
* Display the given success message on the given form field.
|
|
@@ -1849,8 +1827,8 @@ class FormPanel extends Panel {
|
|
|
1849
1827
|
if (w && this.#s) {
|
|
1850
1828
|
w.noValidate = !0;
|
|
1851
1829
|
const D = this.user;
|
|
1852
|
-
this.listen(w, EV.SUBMIT, (
|
|
1853
|
-
|
|
1830
|
+
this.listen(w, EV.SUBMIT, (O) => {
|
|
1831
|
+
O.preventDefault(), this.debugMe("Intercepted from SUBMIT"), this.checkAllFields() && D && D.formSubmit(this);
|
|
1854
1832
|
});
|
|
1855
1833
|
}
|
|
1856
1834
|
return w;
|
|
@@ -1872,22 +1850,22 @@ class FormPanel extends Panel {
|
|
|
1872
1850
|
if (this.responseObject = splitScripts(w), this.responseObject.html) {
|
|
1873
1851
|
if (this.redirected) {
|
|
1874
1852
|
this.removeAllListener();
|
|
1875
|
-
const D = this.getElement(),
|
|
1876
|
-
this.setElementInternal_(this.responseObject.html),
|
|
1853
|
+
const D = this.getElement(), O = D.parentNode;
|
|
1854
|
+
this.setElementInternal_(this.responseObject.html), O.replaceChild(this.getElement(), D);
|
|
1877
1855
|
} else {
|
|
1878
1856
|
const D = (
|
|
1879
1857
|
/** @type {!Element} */
|
|
1880
1858
|
this.responseObject.html.querySelector("form")
|
|
1881
1859
|
);
|
|
1882
1860
|
D && replaceNode(D, this.#t);
|
|
1883
|
-
const
|
|
1861
|
+
const O = (
|
|
1884
1862
|
/** @type {!Element} */
|
|
1885
1863
|
this.responseObject.html.querySelector('button[type="submit"]')
|
|
1886
1864
|
), F = (
|
|
1887
1865
|
/** @type {!Element} */
|
|
1888
1866
|
this.getElement().querySelector('button[type="submit"]')
|
|
1889
1867
|
);
|
|
1890
|
-
|
|
1868
|
+
O && F && replaceNode(O, F);
|
|
1891
1869
|
}
|
|
1892
1870
|
this.enterDocument();
|
|
1893
1871
|
}
|
|
@@ -1899,7 +1877,7 @@ class FormPanel extends Panel {
|
|
|
1899
1877
|
refreshFromFromServer() {
|
|
1900
1878
|
const w = this.user, D = this.uri;
|
|
1901
1879
|
return w ? w.fetch(D, this.abortController.signal).then(
|
|
1902
|
-
(
|
|
1880
|
+
(O) => this.replaceForm(O)
|
|
1903
1881
|
) : Promise.reject(new Error("No UserManager instance available for FormPanel.refreshFromFromServer()"));
|
|
1904
1882
|
}
|
|
1905
1883
|
/**
|
|
@@ -1978,7 +1956,7 @@ class Split extends Component {
|
|
|
1978
1956
|
* @param {boolean=} opt_skipAni If true, skips animation
|
|
1979
1957
|
*/
|
|
1980
1958
|
closeAndLockAll(w = identity, D = !1) {
|
|
1981
|
-
this.nestNames.forEach((
|
|
1959
|
+
this.nestNames.forEach((O) => this.closeAndLock(O, w, D));
|
|
1982
1960
|
}
|
|
1983
1961
|
/**
|
|
1984
1962
|
* Opens and unlocks all nests in this split component.
|
|
@@ -1986,7 +1964,7 @@ class Split extends Component {
|
|
|
1986
1964
|
* @param {boolean=} opt_skipAni If true, skips animation
|
|
1987
1965
|
*/
|
|
1988
1966
|
openAndUnlockAll(w = identity, D = !1) {
|
|
1989
|
-
this.nestNames.forEach((
|
|
1967
|
+
this.nestNames.forEach((O) => this.openAndUnlock(O, w, D));
|
|
1990
1968
|
}
|
|
1991
1969
|
// ---------------------------------------------------------------------------
|
|
1992
1970
|
/**
|
|
@@ -2021,10 +1999,10 @@ class Split extends Component {
|
|
|
2021
1999
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2022
2000
|
* simply affected directly.
|
|
2023
2001
|
*/
|
|
2024
|
-
resize(w, D,
|
|
2025
|
-
const { sizeNow: q, nestEl: W, canResize:
|
|
2026
|
-
|
|
2027
|
-
W.classList.remove("animated"), this.nestMap_.get(w).sizeNow = D,
|
|
2002
|
+
resize(w, D, O = identity, F = !1) {
|
|
2003
|
+
const { sizeNow: q, nestEl: W, canResize: Y } = this.nestMap_.get(w);
|
|
2004
|
+
Y && (F || q === D ? (W.classList.remove("animated"), W.style.flexBasis = `${D}px`, this.nestMap_.get(w).sizeNow = D, O()) : (W.classList.add("animated"), this.nestCallbackMap_.set(w, () => {
|
|
2005
|
+
W.classList.remove("animated"), this.nestMap_.get(w).sizeNow = D, O();
|
|
2028
2006
|
}), W.style.flexBasis = `${D}px`));
|
|
2029
2007
|
}
|
|
2030
2008
|
/**
|
|
@@ -2035,23 +2013,23 @@ class Split extends Component {
|
|
|
2035
2013
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2036
2014
|
* simply affected directly.
|
|
2037
2015
|
*/
|
|
2038
|
-
closeAndLock(w, D = identity,
|
|
2016
|
+
closeAndLock(w, D = identity, O = !1) {
|
|
2039
2017
|
const { nestEl: F, dragEl: q, canResize: W } = this.nestMap_.get(w);
|
|
2040
2018
|
if (!W)
|
|
2041
2019
|
return;
|
|
2042
|
-
const
|
|
2020
|
+
const Y = () => {
|
|
2043
2021
|
q.classList.add("locked", "closed"), F.classList.add("closed"), D();
|
|
2044
2022
|
};
|
|
2045
|
-
this.resize(w, 0,
|
|
2023
|
+
this.resize(w, 0, Y, O);
|
|
2046
2024
|
}
|
|
2047
|
-
closeAndUnlock(w, D = identity,
|
|
2025
|
+
closeAndUnlock(w, D = identity, O = !1) {
|
|
2048
2026
|
const { nestEl: F, dragEl: q, canResize: W } = this.nestMap_.get(w);
|
|
2049
2027
|
if (!W)
|
|
2050
2028
|
return;
|
|
2051
|
-
const
|
|
2029
|
+
const Y = () => {
|
|
2052
2030
|
F.classList.remove("closed"), q.classList.remove("closed", "locked"), q.classList.add("collapsed"), D();
|
|
2053
2031
|
};
|
|
2054
|
-
this.resize(w, 0,
|
|
2032
|
+
this.resize(w, 0, Y, O);
|
|
2055
2033
|
}
|
|
2056
2034
|
/**
|
|
2057
2035
|
* Open a closed and locked nest. Simply a convenience method to combine
|
|
@@ -2063,19 +2041,19 @@ class Split extends Component {
|
|
|
2063
2041
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2064
2042
|
* simply affected directly.
|
|
2065
2043
|
*/
|
|
2066
|
-
openAndUnlock(w, D,
|
|
2044
|
+
openAndUnlock(w, D, O, F = !1) {
|
|
2067
2045
|
const {
|
|
2068
2046
|
nestEl: q,
|
|
2069
2047
|
dragEl: W,
|
|
2070
|
-
defSize:
|
|
2048
|
+
defSize: Y,
|
|
2071
2049
|
lastSize: G,
|
|
2072
2050
|
canResize: K
|
|
2073
2051
|
} = this.nestMap_.get(w);
|
|
2074
2052
|
if (!K)
|
|
2075
2053
|
return;
|
|
2076
|
-
const Q = D || G ||
|
|
2054
|
+
const Q = D || G || Y;
|
|
2077
2055
|
q.classList.remove("closed"), W.classList.remove("closed", "locked", "collapsed"), setTimeout(() => {
|
|
2078
|
-
this.resize(w, Q,
|
|
2056
|
+
this.resize(w, Q, O, F);
|
|
2079
2057
|
}, 50);
|
|
2080
2058
|
}
|
|
2081
2059
|
/**
|
|
@@ -2087,19 +2065,19 @@ class Split extends Component {
|
|
|
2087
2065
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2088
2066
|
* simply affected directly.
|
|
2089
2067
|
*/
|
|
2090
|
-
openAndLock(w, D,
|
|
2068
|
+
openAndLock(w, D, O, F = !1) {
|
|
2091
2069
|
const {
|
|
2092
2070
|
nestEl: q,
|
|
2093
2071
|
dragEl: W,
|
|
2094
|
-
defSize:
|
|
2072
|
+
defSize: Y,
|
|
2095
2073
|
lastSize: G,
|
|
2096
2074
|
canResize: K
|
|
2097
2075
|
} = this.nestMap_.get(w);
|
|
2098
2076
|
if (!K)
|
|
2099
2077
|
return;
|
|
2100
|
-
const Q = D || G ||
|
|
2078
|
+
const Q = D || G || Y;
|
|
2101
2079
|
q.classList.remove("closed"), W.classList.remove("closed", "collapsed"), setTimeout(() => {
|
|
2102
|
-
this.resize(w, Q,
|
|
2080
|
+
this.resize(w, Q, O, F);
|
|
2103
2081
|
}, 50);
|
|
2104
2082
|
}
|
|
2105
2083
|
/**
|
|
@@ -2111,15 +2089,15 @@ class Split extends Component {
|
|
|
2111
2089
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2112
2090
|
* simply affected directly.
|
|
2113
2091
|
*/
|
|
2114
|
-
close(w, D = identity,
|
|
2092
|
+
close(w, D = identity, O = !1) {
|
|
2115
2093
|
const { dragEl: F, canResize: q, nestEl: W } = this.nestMap_.get(w);
|
|
2116
2094
|
if (!q)
|
|
2117
2095
|
return;
|
|
2118
2096
|
this.dispatchSplitEvent(UiEventType.SPLIT_WILL_CLOSE, { nestName: w, nestEl: W });
|
|
2119
|
-
const
|
|
2097
|
+
const Y = () => {
|
|
2120
2098
|
F.classList.add("collapsed"), this.dispatchSplitEvent(UiEventType.SPLIT_DID_CLOSE, { nestName: w, nestEl: W }), D();
|
|
2121
2099
|
};
|
|
2122
|
-
this.resize(w, 0,
|
|
2100
|
+
this.resize(w, 0, Y, O);
|
|
2123
2101
|
}
|
|
2124
2102
|
/**
|
|
2125
2103
|
* Open the nest ignoring its current locked state.
|
|
@@ -2129,15 +2107,15 @@ class Split extends Component {
|
|
|
2129
2107
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2130
2108
|
* simply affected directly.
|
|
2131
2109
|
*/
|
|
2132
|
-
open(w, D = identity,
|
|
2133
|
-
const { defSize: F, lastSize: q, dragEl: W, canResize:
|
|
2134
|
-
if (!
|
|
2110
|
+
open(w, D = identity, O = !1) {
|
|
2111
|
+
const { defSize: F, lastSize: q, dragEl: W, canResize: Y, nestEl: G } = this.nestMap_.get(w);
|
|
2112
|
+
if (!Y)
|
|
2135
2113
|
return;
|
|
2136
2114
|
this.dispatchSplitEvent(UiEventType.SPLIT_WILL_OPEN, { nestName: w, nestEl: G }), W.classList.remove("collapsed", "closed");
|
|
2137
2115
|
const K = q || F, Q = () => {
|
|
2138
2116
|
this.dispatchSplitEvent(UiEventType.SPLIT_DID_OPEN, { nestName: w, nestEl: G }), D();
|
|
2139
2117
|
};
|
|
2140
|
-
this.resize(w, K, Q,
|
|
2118
|
+
this.resize(w, K, Q, O);
|
|
2141
2119
|
}
|
|
2142
2120
|
/**
|
|
2143
2121
|
* Close the nest ignoring its current locked state.
|
|
@@ -2147,8 +2125,8 @@ class Split extends Component {
|
|
|
2147
2125
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2148
2126
|
* simply affected directly.
|
|
2149
2127
|
*/
|
|
2150
|
-
toggle(w, D,
|
|
2151
|
-
this.nestMap_.get(w).sizeNow === 0 ? this.open(w, D,
|
|
2128
|
+
toggle(w, D, O = !1) {
|
|
2129
|
+
this.nestMap_.get(w).sizeNow === 0 ? this.open(w, D, O) : this.close(w, D, O);
|
|
2152
2130
|
}
|
|
2153
2131
|
//----------------------------------------------------------------------------
|
|
2154
2132
|
/**
|
|
@@ -2185,7 +2163,7 @@ class Split extends Component {
|
|
|
2185
2163
|
* @param {?Array<string>} classArrDragger Extra classes for the dragger element
|
|
2186
2164
|
* @param {?Array<string>} classArrGrabber Extra classes for the grabber element
|
|
2187
2165
|
*/
|
|
2188
|
-
addSplit(w = void 0, D = "EW",
|
|
2166
|
+
addSplit(w = void 0, D = "EW", O = 100, F = 100, q = [], W = [], Y = [], G = [], K = []) {
|
|
2189
2167
|
const Q = w || this.getElement();
|
|
2190
2168
|
if (this.splitNests_.has(Q))
|
|
2191
2169
|
return ["Already used!", Q];
|
|
@@ -2198,13 +2176,13 @@ class Split extends Component {
|
|
|
2198
2176
|
else
|
|
2199
2177
|
return ["Element not managed by this component", w];
|
|
2200
2178
|
}
|
|
2201
|
-
const J = `${tt}A`,
|
|
2179
|
+
const J = `${tt}A`, X = makeOuterNest(O, ["zoo_nest__A", J, ...q]), Z = new Dragger(D);
|
|
2202
2180
|
Z.domFunc = makeDraggerEl([`zoo_drag_${J}`, ...G], K), Z.render(Q), this.nestMap_.set(J, {
|
|
2203
2181
|
side: "A",
|
|
2204
|
-
nestEl:
|
|
2182
|
+
nestEl: X,
|
|
2205
2183
|
dragger: Z,
|
|
2206
2184
|
dragEl: Z.getElement(),
|
|
2207
|
-
defSize:
|
|
2185
|
+
defSize: O,
|
|
2208
2186
|
sizeNow: -1,
|
|
2209
2187
|
canResize: !0
|
|
2210
2188
|
});
|
|
@@ -2212,7 +2190,7 @@ class Split extends Component {
|
|
|
2212
2190
|
this.nestMap_.set(et, { nestEl: st, canResize: !1 });
|
|
2213
2191
|
const rt = `${tt}C`, nt = new Dragger(D);
|
|
2214
2192
|
nt.domFunc = makeDraggerEl([`zoo_drag_${rt}`, ...G], K), nt.render(Q);
|
|
2215
|
-
const ot = makeOuterNest(F, ["zoo_nest__C", rt, ...
|
|
2193
|
+
const ot = makeOuterNest(F, ["zoo_nest__C", rt, ...Y]);
|
|
2216
2194
|
this.nestMap_.set(rt, {
|
|
2217
2195
|
side: "C",
|
|
2218
2196
|
nestEl: ot,
|
|
@@ -2221,19 +2199,19 @@ class Split extends Component {
|
|
|
2221
2199
|
defSize: F,
|
|
2222
2200
|
sizeNow: -1,
|
|
2223
2201
|
canResize: !0
|
|
2224
|
-
}), [
|
|
2202
|
+
}), [X, Z.getElement(), st, nt.getElement(), ot].forEach((it) => Q.appendChild(it));
|
|
2225
2203
|
let ct = 0;
|
|
2226
|
-
const ht = (it, at, lt,
|
|
2204
|
+
const ht = (it, at, lt, ft) => {
|
|
2227
2205
|
let ut;
|
|
2228
|
-
const dt = it === "NS" ? "height" : "width",
|
|
2206
|
+
const dt = it === "NS" ? "height" : "width", gt = it === "NS" ? "deltaY" : "deltaX";
|
|
2229
2207
|
return (pt) => {
|
|
2230
2208
|
switch (pt.detail.value_) {
|
|
2231
2209
|
case UiEventType.COMP_DRAG_START:
|
|
2232
2210
|
ut = at.getBoundingClientRect()[dt], ct = st.getBoundingClientRect()[dt] + ut, this.nestMap_.get(lt).dragEl.classList.remove("collapsed");
|
|
2233
2211
|
break;
|
|
2234
2212
|
case UiEventType.COMP_DRAG_MOVE: {
|
|
2235
|
-
const
|
|
2236
|
-
this.nestMap_.get(lt).lastSize =
|
|
2213
|
+
const mt = Math.min(ct, ut + ft * pt.detail.data_[gt]);
|
|
2214
|
+
this.nestMap_.get(lt).lastSize = mt, at.style.flexBasis = mt + "px";
|
|
2237
2215
|
break;
|
|
2238
2216
|
}
|
|
2239
2217
|
case UiEventType.COMP_DRAG_END:
|
|
@@ -2242,8 +2220,8 @@ class Split extends Component {
|
|
|
2242
2220
|
}
|
|
2243
2221
|
};
|
|
2244
2222
|
};
|
|
2245
|
-
this.listen(Z, Component.compEventCode(), ht(D,
|
|
2246
|
-
if (it.propertyName === "flex-basis" && it.target ===
|
|
2223
|
+
this.listen(Z, Component.compEventCode(), ht(D, X, J, 1)), this.listen(nt, Component.compEventCode(), ht(D, ot, rt, -1)), this.listen(Z.getElement(), EV.DBLCLICK, () => this.toggle(J)), this.listen(nt.getElement(), EV.DBLCLICK, () => this.toggle(rt)), this.listen(Z.getElement().querySelector(".zoo_grabber"), EV.CLICK, () => this.toggle(J)), this.listen(nt.getElement().querySelector(".zoo_grabber"), EV.CLICK, () => this.toggle(rt)), this.listen(X, EV.TRANSITIONEND, (it) => {
|
|
2224
|
+
if (it.propertyName === "flex-basis" && it.target === X) {
|
|
2247
2225
|
const at = this.nestCallbackMap_.get(J);
|
|
2248
2226
|
this.nestCallbackMap_.delete(J), at && at(), this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END, this.nestMap_.get(J));
|
|
2249
2227
|
}
|
|
@@ -2265,50 +2243,50 @@ class Split extends Component {
|
|
|
2265
2243
|
* if any of the handlers returns false this will also return false.
|
|
2266
2244
|
*/
|
|
2267
2245
|
dispatchSplitEvent(w, D) {
|
|
2268
|
-
const
|
|
2246
|
+
const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.SPLIT, O);
|
|
2269
2247
|
return this.dispatchEvent(F);
|
|
2270
2248
|
}
|
|
2271
2249
|
}
|
|
2272
|
-
const convertElToSplit = (
|
|
2250
|
+
const convertElToSplit = (U, w) => (U.classList.add("zoo_split", `zoo_split__${w.toLowerCase()}`), U), makeOuterNest = (U, w = []) => {
|
|
2273
2251
|
const D = document.createElement("div");
|
|
2274
|
-
return D.setAttribute("id", randomId(7)), D.classList.add("zoo_nest", "zoo_nest__outer", ...w), D.style.flexBasis =
|
|
2275
|
-
}, makeInnerNest = (
|
|
2252
|
+
return D.setAttribute("id", randomId(7)), D.classList.add("zoo_nest", "zoo_nest__outer", ...w), D.style.flexBasis = U + "px", D;
|
|
2253
|
+
}, makeInnerNest = (U = []) => {
|
|
2276
2254
|
const w = document.createElement("div");
|
|
2277
|
-
return w.setAttribute("id", randomId(7)), w.classList.add("zoo_nest", "zoo_nest__inner", ...
|
|
2278
|
-
}, makeDraggerEl = (
|
|
2255
|
+
return w.setAttribute("id", randomId(7)), w.classList.add("zoo_nest", "zoo_nest__inner", ...U), w;
|
|
2256
|
+
}, makeDraggerEl = (U = [], w = []) => () => {
|
|
2279
2257
|
const D = document.createElement("div");
|
|
2280
|
-
D.setAttribute("id", randomId(7)), D.classList.add("zoo_dragger", ...
|
|
2281
|
-
const
|
|
2282
|
-
return
|
|
2283
|
-
}, needsToScroll = (
|
|
2284
|
-
const D =
|
|
2285
|
-
return (
|
|
2286
|
-
}, treeNodeSelect = (
|
|
2287
|
-
const D =
|
|
2258
|
+
D.setAttribute("id", randomId(7)), D.classList.add("zoo_dragger", ...U);
|
|
2259
|
+
const O = document.createElement("div");
|
|
2260
|
+
return O.classList.add("zoo_grabber", ...w), D.appendChild(O), D;
|
|
2261
|
+
}, needsToScroll = (U) => {
|
|
2262
|
+
const D = U.getBoundingClientRect().bottom;
|
|
2263
|
+
return (O) => O.getBoundingClientRect().bottom > D;
|
|
2264
|
+
}, treeNodeSelect = (U) => (w) => {
|
|
2265
|
+
const D = U.getElement().querySelector(".zv_tree_container"), O = needsToScroll(D), F = U.getElement().querySelectorAll(".tree-node");
|
|
2288
2266
|
let q;
|
|
2289
2267
|
[...F].forEach((W) => {
|
|
2290
2268
|
enableClass(W, "mdc-deprecated-list-item--activated", W.id === `tree-node_${w}`), W.id === `tree-node_${w}` && (q = W);
|
|
2291
|
-
}), q &&
|
|
2292
|
-
}, toggleTree = (
|
|
2293
|
-
const D = w.getElement().querySelector(".children"),
|
|
2269
|
+
}), q && O(q) && q.scrollIntoView(!1);
|
|
2270
|
+
}, toggleTree = (U, w) => {
|
|
2271
|
+
const D = w.getElement().querySelector(".children"), O = (
|
|
2294
2272
|
/**@type {boolean} */
|
|
2295
|
-
|
|
2273
|
+
U.isOn
|
|
2296
2274
|
), F = w.getElement().querySelectorAll(".children"), q = w.getElement().querySelectorAll(".zoo__reveal_icon");
|
|
2297
2275
|
[...F].forEach((W) => enableClass(
|
|
2298
2276
|
W,
|
|
2299
2277
|
"zoo__tree-children__hidden",
|
|
2300
|
-
W !== D && !
|
|
2278
|
+
W !== D && !O
|
|
2301
2279
|
)), [...q].forEach((W) => enableClass(
|
|
2302
2280
|
W,
|
|
2303
2281
|
"zoo__icon_rotated",
|
|
2304
|
-
W !== D && !
|
|
2282
|
+
W !== D && !O
|
|
2305
2283
|
));
|
|
2306
|
-
}, toggleTreeChildren = (
|
|
2307
|
-
const D = w.trigger,
|
|
2284
|
+
}, toggleTreeChildren = (U, w) => {
|
|
2285
|
+
const D = w.trigger, O = D.getAttribute("data-child-id"), F = U.getElement().querySelector(`#${O}`);
|
|
2308
2286
|
toggleClass(F, "zoo__tree-children__hidden"), toggleClass(D, "zoo__icon_rotated");
|
|
2309
|
-
}, _openTreeFromNodeUp = (
|
|
2287
|
+
}, _openTreeFromNodeUp = (U, w) => {
|
|
2310
2288
|
const D = w.parentElement;
|
|
2311
|
-
D.classList.contains("children") && (enableClass(D, "zoo__tree-children__hidden", !1), _openTreeFromNodeUp(
|
|
2289
|
+
D.classList.contains("children") && (enableClass(D, "zoo__tree-children__hidden", !1), _openTreeFromNodeUp(U, D));
|
|
2312
2290
|
}, treeUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2313
2291
|
__proto__: null,
|
|
2314
2292
|
_openTreeFromNodeUp,
|
|
@@ -2323,8 +2301,8 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2323
2301
|
* @param {Object} eventData - Event data with isOn boolean
|
|
2324
2302
|
* @param {Panel} ePanel - The panel containing the tree
|
|
2325
2303
|
*/
|
|
2326
|
-
toggle_tree: function(
|
|
2327
|
-
toggleTree(
|
|
2304
|
+
toggle_tree: function(U, w) {
|
|
2305
|
+
toggleTree(U, w);
|
|
2328
2306
|
},
|
|
2329
2307
|
/**
|
|
2330
2308
|
* Toggle children visibility for a specific tree node.
|
|
@@ -2332,8 +2310,8 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2332
2310
|
* @param {Object} eventData - Event data with trigger element
|
|
2333
2311
|
* @param {Panel} ePanel - The panel containing the tree
|
|
2334
2312
|
*/
|
|
2335
|
-
"tree_toggle-children": function(
|
|
2336
|
-
toggleTreeChildren(w,
|
|
2313
|
+
"tree_toggle-children": function(U, w) {
|
|
2314
|
+
toggleTreeChildren(w, U);
|
|
2337
2315
|
}
|
|
2338
2316
|
}, SearchHandlers = {
|
|
2339
2317
|
/**
|
|
@@ -2343,15 +2321,15 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2343
2321
|
* @param {Object} eventData - Event data with href, formData.q, and targetval
|
|
2344
2322
|
* @param {Panel} ePanel - The panel to update
|
|
2345
2323
|
*/
|
|
2346
|
-
search: function(
|
|
2347
|
-
let D = `${
|
|
2348
|
-
const
|
|
2349
|
-
if (
|
|
2324
|
+
search: function(U, w) {
|
|
2325
|
+
let D = `${U.href}`;
|
|
2326
|
+
const O = U.formData.q, F = U.targetval;
|
|
2327
|
+
if (O !== "" && (D = `${D}?q=${O}`), F !== "") {
|
|
2350
2328
|
let q = F;
|
|
2351
|
-
F.includes("page=") && (q = F.split("&").filter((W) => !W.includes("page=")).join("&")), D =
|
|
2329
|
+
F.includes("page=") && (q = F.split("&").filter((W) => !W.includes("page=")).join("&")), D = O !== "" ? `${D}&${q}` : `${D}?${q}`;
|
|
2352
2330
|
}
|
|
2353
2331
|
this.user.fetchAndSplit(D, w.abortController.signal).then(
|
|
2354
|
-
(q) => w.onReplacePartialDom(q,
|
|
2332
|
+
(q) => w.onReplacePartialDom(q, U.zvptarget)
|
|
2355
2333
|
);
|
|
2356
2334
|
},
|
|
2357
2335
|
/**
|
|
@@ -2361,8 +2339,8 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2361
2339
|
* @param {Object} eventData - Event data with trigger element
|
|
2362
2340
|
* @param {Panel} ePanel - The panel to update
|
|
2363
2341
|
*/
|
|
2364
|
-
reset_search: function(
|
|
2365
|
-
const D =
|
|
2342
|
+
reset_search: function(U, w) {
|
|
2343
|
+
const D = U.trigger.closest("form");
|
|
2366
2344
|
w.removeFromQParams("q"), D.elements.q.value = "", D.dispatchEvent(new Event("submit"));
|
|
2367
2345
|
}
|
|
2368
2346
|
}, QueryParamHandlers = {
|
|
@@ -2372,10 +2350,10 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2372
2350
|
* @param {Object} eventData - Event data with href and targetval for pagination
|
|
2373
2351
|
* @param {Panel} ePanel - The panel to update
|
|
2374
2352
|
*/
|
|
2375
|
-
paginate: function(
|
|
2376
|
-
const D = `${
|
|
2353
|
+
paginate: function(U, w) {
|
|
2354
|
+
const D = `${U.href}?${U.targetval}`;
|
|
2377
2355
|
this.user.fetchAndSplit(D, w.abortController.signal).then(
|
|
2378
|
-
(
|
|
2356
|
+
(O) => w.onReplacePartialDom(O, U.zvptarget)
|
|
2379
2357
|
);
|
|
2380
2358
|
},
|
|
2381
2359
|
/**
|
|
@@ -2384,10 +2362,10 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2384
2362
|
* @param {Object} eventData - Event data with href and targetval for filtering
|
|
2385
2363
|
* @param {Panel} ePanel - The panel to update
|
|
2386
2364
|
*/
|
|
2387
|
-
list_filter: function(
|
|
2388
|
-
const D = `${
|
|
2365
|
+
list_filter: function(U, w) {
|
|
2366
|
+
const D = `${U.href}?${U.targetval}`;
|
|
2389
2367
|
this.user.fetchAndSplit(D, w.abortController.signal).then(
|
|
2390
|
-
(
|
|
2368
|
+
(O) => w.onReplacePartialDom(O, U.zvptarget)
|
|
2391
2369
|
);
|
|
2392
2370
|
}
|
|
2393
2371
|
}, handlers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -2428,8 +2406,8 @@ class View extends Evt {
|
|
|
2428
2406
|
}
|
|
2429
2407
|
set split(w) {
|
|
2430
2408
|
this.split_ = w, this.listen(this.split_, UiEventType.SPLIT, (D) => {
|
|
2431
|
-
const
|
|
2432
|
-
switch (
|
|
2409
|
+
const O = D.detail.getValue(), F = D.detail.getData();
|
|
2410
|
+
switch (O) {
|
|
2433
2411
|
case UiEventType.SPLIT_WILL_OPEN:
|
|
2434
2412
|
this.onSplitWillOpen(F);
|
|
2435
2413
|
break;
|
|
@@ -2520,8 +2498,8 @@ class View extends Evt {
|
|
|
2520
2498
|
* @param {Panel} panel
|
|
2521
2499
|
*/
|
|
2522
2500
|
removePanel(w) {
|
|
2523
|
-
const [D,
|
|
2524
|
-
D &&
|
|
2501
|
+
const [D, O] = [...this.panelMap.entries()].find(([F, q]) => q === w);
|
|
2502
|
+
D && O && (O.dispose(), this.panelMap.delete(D));
|
|
2525
2503
|
}
|
|
2526
2504
|
/**
|
|
2527
2505
|
* @param {string} name
|
|
@@ -2551,17 +2529,17 @@ class View extends Evt {
|
|
|
2551
2529
|
*/
|
|
2552
2530
|
initPanelEventsInternal_() {
|
|
2553
2531
|
const w = /* @__PURE__ */ new Map();
|
|
2554
|
-
return w.set("destroy_me", (D,
|
|
2555
|
-
this.removePanel(
|
|
2556
|
-
}), w.set("switch_view", (D,
|
|
2532
|
+
return w.set("destroy_me", (D, O) => {
|
|
2533
|
+
this.removePanel(O);
|
|
2534
|
+
}), w.set("switch_view", (D, O) => {
|
|
2557
2535
|
this.debugMe("switch_view received: eventData", D);
|
|
2558
2536
|
const F = D.view;
|
|
2559
|
-
this.switchViewMap_.has(F) ? this.switchViewMap_.get(F)(D,
|
|
2537
|
+
this.switchViewMap_.has(F) ? this.switchViewMap_.get(F)(D, O) : this.debugMe("NO VIEW FOUND FOR:", F, this.switchViewMap_);
|
|
2560
2538
|
}), Object.entries({
|
|
2561
2539
|
...SearchHandlers,
|
|
2562
2540
|
...QueryParamHandlers
|
|
2563
|
-
}).forEach(([D,
|
|
2564
|
-
w.set(D,
|
|
2541
|
+
}).forEach(([D, O]) => {
|
|
2542
|
+
w.set(D, O.bind(this));
|
|
2565
2543
|
}), w;
|
|
2566
2544
|
}
|
|
2567
2545
|
/**
|
|
@@ -2588,18 +2566,18 @@ class View extends Evt {
|
|
|
2588
2566
|
*/
|
|
2589
2567
|
onPanelEvent(w) {
|
|
2590
2568
|
let D = w.detail.getValue();
|
|
2591
|
-
const
|
|
2592
|
-
D.startsWith("switch_view:") && (
|
|
2569
|
+
const O = w.detail.getData();
|
|
2570
|
+
D.startsWith("switch_view:") && (O.view = D.split(":")[1], D = "switch_view");
|
|
2593
2571
|
const F = (
|
|
2594
2572
|
/** @type {Panel} */
|
|
2595
2573
|
w.target
|
|
2596
2574
|
);
|
|
2597
|
-
this.panelEventMap_.has(D) ? this.panelEventMap_.get(D)(
|
|
2575
|
+
this.panelEventMap_.has(D) ? this.panelEventMap_.get(D)(O, F) : this.debugMe(`NO EVENT MATCH - This usually you are missing
|
|
2598
2576
|
a "mapPanEv(${D} ..." statement in your panel JS
|
|
2599
2577
|
or you have a "event='${D}'" attribute in your panel HTML`, {
|
|
2600
2578
|
event: w,
|
|
2601
2579
|
eventValue: D,
|
|
2602
|
-
eventData:
|
|
2580
|
+
eventData: O,
|
|
2603
2581
|
panel: F.constructor.name
|
|
2604
2582
|
});
|
|
2605
2583
|
}
|
|
@@ -2650,7 +2628,7 @@ class View extends Evt {
|
|
|
2650
2628
|
* if any of the handlers returns false this will also return false.
|
|
2651
2629
|
*/
|
|
2652
2630
|
dispatchViewEvent(w, D) {
|
|
2653
|
-
const
|
|
2631
|
+
const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.VIEW, O);
|
|
2654
2632
|
return this.dispatchEvent(F);
|
|
2655
2633
|
}
|
|
2656
2634
|
//--[ Meta Data ]--
|
|
@@ -2704,7 +2682,11 @@ class Conductor extends Evt {
|
|
|
2704
2682
|
constructor() {
|
|
2705
2683
|
super(), this.#n = this.#i(), window.addEventListener("popstate", (w) => {
|
|
2706
2684
|
w.state !== null && this.navTo(w.state);
|
|
2707
|
-
})
|
|
2685
|
+
}), this.doOnBeat(() => {
|
|
2686
|
+
document.dispatchEvent(new CustomEvent("zoo-tick-60", {
|
|
2687
|
+
detail: { timestamp: Date.now() }
|
|
2688
|
+
}));
|
|
2689
|
+
}, 6e4);
|
|
2708
2690
|
}
|
|
2709
2691
|
set split(w) {
|
|
2710
2692
|
this.#r = w;
|
|
@@ -2735,11 +2717,11 @@ class Conductor extends Evt {
|
|
|
2735
2717
|
#i() {
|
|
2736
2718
|
return (/* @__PURE__ */ new Map()).set("switch_view", (w, D) => {
|
|
2737
2719
|
if (this.#t.has(w.view)) {
|
|
2738
|
-
const
|
|
2720
|
+
const O = this.#t.get(w.view)(
|
|
2739
2721
|
w.pk || w.recordId,
|
|
2740
2722
|
w
|
|
2741
2723
|
);
|
|
2742
|
-
this.switchView(
|
|
2724
|
+
this.switchView(O);
|
|
2743
2725
|
}
|
|
2744
2726
|
});
|
|
2745
2727
|
}
|
|
@@ -2765,11 +2747,11 @@ class Conductor extends Evt {
|
|
|
2765
2747
|
* @param {!CustomEvent} e Event object.
|
|
2766
2748
|
*/
|
|
2767
2749
|
onViewEvent(w) {
|
|
2768
|
-
const D = w.detail.getValue(),
|
|
2750
|
+
const D = w.detail.getValue(), O = w.detail.getData(), F = (
|
|
2769
2751
|
/** @type {Panel} */
|
|
2770
2752
|
w.target
|
|
2771
2753
|
);
|
|
2772
|
-
this.#n.has(D) ? this.#n.get(D)(
|
|
2754
|
+
this.#n.has(D) ? this.#n.get(D)(O, F) : console.warn("Unhandled VIEW Event:", w, D, O, F);
|
|
2773
2755
|
}
|
|
2774
2756
|
/**
|
|
2775
2757
|
* Make the given view active.
|
|
@@ -2810,52 +2792,52 @@ class Conductor extends Evt {
|
|
|
2810
2792
|
*/
|
|
2811
2793
|
navTo = (w) => {
|
|
2812
2794
|
w.history = !0;
|
|
2813
|
-
const D = w.view,
|
|
2814
|
-
if (
|
|
2815
|
-
this.debugMe("NAV:VIEW:MAP", w),
|
|
2795
|
+
const D = w.view, O = this.#e;
|
|
2796
|
+
if (O.switchViewMap_.has(D))
|
|
2797
|
+
this.debugMe("NAV:VIEW:MAP", w), O.switchViewMap_.get(D)(w);
|
|
2816
2798
|
else if (this.#t.has(D)) {
|
|
2817
2799
|
const F = this.#t.get(D)(w.pk, w);
|
|
2818
2800
|
this.debugMe("NAV:NEW:VIEW", w), this.switchView(F);
|
|
2819
2801
|
}
|
|
2820
2802
|
};
|
|
2821
2803
|
}
|
|
2822
|
-
function _isPlaceholder(
|
|
2823
|
-
return
|
|
2804
|
+
function _isPlaceholder(U) {
|
|
2805
|
+
return U != null && typeof U == "object" && U["@@functional/placeholder"] === !0;
|
|
2824
2806
|
}
|
|
2825
|
-
function _curry1(
|
|
2807
|
+
function _curry1(U) {
|
|
2826
2808
|
return function w(D) {
|
|
2827
|
-
return arguments.length === 0 || _isPlaceholder(D) ? w :
|
|
2809
|
+
return arguments.length === 0 || _isPlaceholder(D) ? w : U.apply(this, arguments);
|
|
2828
2810
|
};
|
|
2829
2811
|
}
|
|
2830
|
-
function _curry2(
|
|
2831
|
-
return function w(D,
|
|
2812
|
+
function _curry2(U) {
|
|
2813
|
+
return function w(D, O) {
|
|
2832
2814
|
switch (arguments.length) {
|
|
2833
2815
|
case 0:
|
|
2834
2816
|
return w;
|
|
2835
2817
|
case 1:
|
|
2836
2818
|
return _isPlaceholder(D) ? w : _curry1(function(F) {
|
|
2837
|
-
return
|
|
2819
|
+
return U(D, F);
|
|
2838
2820
|
});
|
|
2839
2821
|
default:
|
|
2840
|
-
return _isPlaceholder(D) && _isPlaceholder(
|
|
2841
|
-
return
|
|
2842
|
-
}) : _isPlaceholder(
|
|
2843
|
-
return
|
|
2844
|
-
}) :
|
|
2822
|
+
return _isPlaceholder(D) && _isPlaceholder(O) ? w : _isPlaceholder(D) ? _curry1(function(F) {
|
|
2823
|
+
return U(F, O);
|
|
2824
|
+
}) : _isPlaceholder(O) ? _curry1(function(F) {
|
|
2825
|
+
return U(D, F);
|
|
2826
|
+
}) : U(D, O);
|
|
2845
2827
|
}
|
|
2846
2828
|
};
|
|
2847
2829
|
}
|
|
2848
|
-
function _concat(
|
|
2849
|
-
|
|
2850
|
-
var D,
|
|
2851
|
-
for (D = 0; D <
|
|
2852
|
-
q[q.length] =
|
|
2830
|
+
function _concat(U, w) {
|
|
2831
|
+
U = U || [], w = w || [];
|
|
2832
|
+
var D, O = U.length, F = w.length, q = [];
|
|
2833
|
+
for (D = 0; D < O; )
|
|
2834
|
+
q[q.length] = U[D], D += 1;
|
|
2853
2835
|
for (D = 0; D < F; )
|
|
2854
2836
|
q[q.length] = w[D], D += 1;
|
|
2855
2837
|
return q;
|
|
2856
2838
|
}
|
|
2857
|
-
function _arity(
|
|
2858
|
-
switch (
|
|
2839
|
+
function _arity(U, w) {
|
|
2840
|
+
switch (U) {
|
|
2859
2841
|
case 0:
|
|
2860
2842
|
return function() {
|
|
2861
2843
|
return w.apply(this, arguments);
|
|
@@ -2865,111 +2847,111 @@ function _arity(O, w) {
|
|
|
2865
2847
|
return w.apply(this, arguments);
|
|
2866
2848
|
};
|
|
2867
2849
|
case 2:
|
|
2868
|
-
return function(D,
|
|
2850
|
+
return function(D, O) {
|
|
2869
2851
|
return w.apply(this, arguments);
|
|
2870
2852
|
};
|
|
2871
2853
|
case 3:
|
|
2872
|
-
return function(D,
|
|
2854
|
+
return function(D, O, F) {
|
|
2873
2855
|
return w.apply(this, arguments);
|
|
2874
2856
|
};
|
|
2875
2857
|
case 4:
|
|
2876
|
-
return function(D,
|
|
2858
|
+
return function(D, O, F, q) {
|
|
2877
2859
|
return w.apply(this, arguments);
|
|
2878
2860
|
};
|
|
2879
2861
|
case 5:
|
|
2880
|
-
return function(D,
|
|
2862
|
+
return function(D, O, F, q, W) {
|
|
2881
2863
|
return w.apply(this, arguments);
|
|
2882
2864
|
};
|
|
2883
2865
|
case 6:
|
|
2884
|
-
return function(D,
|
|
2866
|
+
return function(D, O, F, q, W, Y) {
|
|
2885
2867
|
return w.apply(this, arguments);
|
|
2886
2868
|
};
|
|
2887
2869
|
case 7:
|
|
2888
|
-
return function(D,
|
|
2870
|
+
return function(D, O, F, q, W, Y, G) {
|
|
2889
2871
|
return w.apply(this, arguments);
|
|
2890
2872
|
};
|
|
2891
2873
|
case 8:
|
|
2892
|
-
return function(D,
|
|
2874
|
+
return function(D, O, F, q, W, Y, G, K) {
|
|
2893
2875
|
return w.apply(this, arguments);
|
|
2894
2876
|
};
|
|
2895
2877
|
case 9:
|
|
2896
|
-
return function(D,
|
|
2878
|
+
return function(D, O, F, q, W, Y, G, K, Q) {
|
|
2897
2879
|
return w.apply(this, arguments);
|
|
2898
2880
|
};
|
|
2899
2881
|
case 10:
|
|
2900
|
-
return function(D,
|
|
2882
|
+
return function(D, O, F, q, W, Y, G, K, Q, tt) {
|
|
2901
2883
|
return w.apply(this, arguments);
|
|
2902
2884
|
};
|
|
2903
2885
|
default:
|
|
2904
2886
|
throw new Error("First argument to _arity must be a non-negative integer no greater than ten");
|
|
2905
2887
|
}
|
|
2906
2888
|
}
|
|
2907
|
-
function _curryN(
|
|
2889
|
+
function _curryN(U, w, D) {
|
|
2908
2890
|
return function() {
|
|
2909
|
-
for (var
|
|
2891
|
+
for (var O = [], F = 0, q = U, W = 0, Y = !1; W < w.length || F < arguments.length; ) {
|
|
2910
2892
|
var G;
|
|
2911
|
-
W < w.length && (!_isPlaceholder(w[W]) || F >= arguments.length) ? G = w[W] : (G = arguments[F], F += 1),
|
|
2893
|
+
W < w.length && (!_isPlaceholder(w[W]) || F >= arguments.length) ? G = w[W] : (G = arguments[F], F += 1), O[W] = G, _isPlaceholder(G) ? Y = !0 : q -= 1, W += 1;
|
|
2912
2894
|
}
|
|
2913
|
-
return !
|
|
2895
|
+
return !Y && q <= 0 ? D.apply(this, O) : _arity(Math.max(0, q), _curryN(U, O, D));
|
|
2914
2896
|
};
|
|
2915
2897
|
}
|
|
2916
|
-
var curryN = /* @__PURE__ */ _curry2(function
|
|
2898
|
+
var curryN = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
2917
2899
|
return w === 1 ? _curry1(D) : _arity(w, _curryN(w, [], D));
|
|
2918
2900
|
});
|
|
2919
|
-
function _curry3(
|
|
2920
|
-
return function w(D,
|
|
2901
|
+
function _curry3(U) {
|
|
2902
|
+
return function w(D, O, F) {
|
|
2921
2903
|
switch (arguments.length) {
|
|
2922
2904
|
case 0:
|
|
2923
2905
|
return w;
|
|
2924
2906
|
case 1:
|
|
2925
2907
|
return _isPlaceholder(D) ? w : _curry2(function(q, W) {
|
|
2926
|
-
return
|
|
2908
|
+
return U(D, q, W);
|
|
2927
2909
|
});
|
|
2928
2910
|
case 2:
|
|
2929
|
-
return _isPlaceholder(D) && _isPlaceholder(
|
|
2930
|
-
return
|
|
2931
|
-
}) : _isPlaceholder(
|
|
2932
|
-
return
|
|
2911
|
+
return _isPlaceholder(D) && _isPlaceholder(O) ? w : _isPlaceholder(D) ? _curry2(function(q, W) {
|
|
2912
|
+
return U(q, O, W);
|
|
2913
|
+
}) : _isPlaceholder(O) ? _curry2(function(q, W) {
|
|
2914
|
+
return U(D, q, W);
|
|
2933
2915
|
}) : _curry1(function(q) {
|
|
2934
|
-
return
|
|
2916
|
+
return U(D, O, q);
|
|
2935
2917
|
});
|
|
2936
2918
|
default:
|
|
2937
|
-
return _isPlaceholder(D) && _isPlaceholder(
|
|
2938
|
-
return
|
|
2919
|
+
return _isPlaceholder(D) && _isPlaceholder(O) && _isPlaceholder(F) ? w : _isPlaceholder(D) && _isPlaceholder(O) ? _curry2(function(q, W) {
|
|
2920
|
+
return U(q, W, F);
|
|
2939
2921
|
}) : _isPlaceholder(D) && _isPlaceholder(F) ? _curry2(function(q, W) {
|
|
2940
|
-
return
|
|
2941
|
-
}) : _isPlaceholder(
|
|
2942
|
-
return
|
|
2922
|
+
return U(q, O, W);
|
|
2923
|
+
}) : _isPlaceholder(O) && _isPlaceholder(F) ? _curry2(function(q, W) {
|
|
2924
|
+
return U(D, q, W);
|
|
2943
2925
|
}) : _isPlaceholder(D) ? _curry1(function(q) {
|
|
2944
|
-
return
|
|
2945
|
-
}) : _isPlaceholder(
|
|
2946
|
-
return
|
|
2926
|
+
return U(q, O, F);
|
|
2927
|
+
}) : _isPlaceholder(O) ? _curry1(function(q) {
|
|
2928
|
+
return U(D, q, F);
|
|
2947
2929
|
}) : _isPlaceholder(F) ? _curry1(function(q) {
|
|
2948
|
-
return
|
|
2949
|
-
}) :
|
|
2930
|
+
return U(D, O, q);
|
|
2931
|
+
}) : U(D, O, F);
|
|
2950
2932
|
}
|
|
2951
2933
|
};
|
|
2952
2934
|
}
|
|
2953
|
-
const _isArray = Array.isArray || function
|
|
2935
|
+
const _isArray = Array.isArray || function U(w) {
|
|
2954
2936
|
return w != null && w.length >= 0 && Object.prototype.toString.call(w) === "[object Array]";
|
|
2955
2937
|
};
|
|
2956
|
-
function _isTransformer(
|
|
2957
|
-
return
|
|
2938
|
+
function _isTransformer(U) {
|
|
2939
|
+
return U != null && typeof U["@@transducer/step"] == "function";
|
|
2958
2940
|
}
|
|
2959
|
-
function _dispatchable(
|
|
2941
|
+
function _dispatchable(U, w, D) {
|
|
2960
2942
|
return function() {
|
|
2961
2943
|
if (arguments.length === 0)
|
|
2962
2944
|
return D();
|
|
2963
|
-
var
|
|
2964
|
-
if (!_isArray(
|
|
2965
|
-
for (var F = 0; F <
|
|
2966
|
-
if (typeof U[
|
|
2967
|
-
return U[
|
|
2945
|
+
var O = arguments[arguments.length - 1];
|
|
2946
|
+
if (!_isArray(O)) {
|
|
2947
|
+
for (var F = 0; F < U.length; ) {
|
|
2948
|
+
if (typeof O[U[F]] == "function")
|
|
2949
|
+
return O[U[F]].apply(O, Array.prototype.slice.call(arguments, 0, -1));
|
|
2968
2950
|
F += 1;
|
|
2969
2951
|
}
|
|
2970
|
-
if (_isTransformer(
|
|
2952
|
+
if (_isTransformer(O)) {
|
|
2971
2953
|
var q = w.apply(null, Array.prototype.slice.call(arguments, 0, -1));
|
|
2972
|
-
return q(
|
|
2954
|
+
return q(O);
|
|
2973
2955
|
}
|
|
2974
2956
|
}
|
|
2975
2957
|
return D.apply(this, arguments);
|
|
@@ -2979,12 +2961,12 @@ const _xfBase = {
|
|
|
2979
2961
|
init: function() {
|
|
2980
2962
|
return this.xf["@@transducer/init"]();
|
|
2981
2963
|
},
|
|
2982
|
-
result: function(
|
|
2983
|
-
return this.xf["@@transducer/result"](
|
|
2964
|
+
result: function(U) {
|
|
2965
|
+
return this.xf["@@transducer/result"](U);
|
|
2984
2966
|
}
|
|
2985
2967
|
};
|
|
2986
|
-
function _has(
|
|
2987
|
-
return Object.prototype.hasOwnProperty.call(w,
|
|
2968
|
+
function _has(U, w) {
|
|
2969
|
+
return Object.prototype.hasOwnProperty.call(w, U);
|
|
2988
2970
|
}
|
|
2989
2971
|
var toString = Object.prototype.toString, _isArguments = /* @__PURE__ */ (function() {
|
|
2990
2972
|
return toString.call(arguments) === "[object Arguments]" ? function(w) {
|
|
@@ -2996,82 +2978,82 @@ var toString = Object.prototype.toString, _isArguments = /* @__PURE__ */ (functi
|
|
|
2996
2978
|
toString: null
|
|
2997
2979
|
}.propertyIsEnumerable("toString"), nonEnumerableProps = ["constructor", "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"], hasArgsEnumBug = /* @__PURE__ */ (function() {
|
|
2998
2980
|
return arguments.propertyIsEnumerable("length");
|
|
2999
|
-
})(), contains = function
|
|
3000
|
-
for (var
|
|
3001
|
-
if (w[
|
|
2981
|
+
})(), contains = function U(w, D) {
|
|
2982
|
+
for (var O = 0; O < w.length; ) {
|
|
2983
|
+
if (w[O] === D)
|
|
3002
2984
|
return !0;
|
|
3003
|
-
|
|
2985
|
+
O += 1;
|
|
3004
2986
|
}
|
|
3005
2987
|
return !1;
|
|
3006
|
-
}, keys = /* @__PURE__ */ _curry1(typeof Object.keys == "function" && !hasArgsEnumBug ? function
|
|
2988
|
+
}, keys = /* @__PURE__ */ _curry1(typeof Object.keys == "function" && !hasArgsEnumBug ? function U(w) {
|
|
3007
2989
|
return Object(w) !== w ? [] : Object.keys(w);
|
|
3008
|
-
} : function
|
|
2990
|
+
} : function U(w) {
|
|
3009
2991
|
if (Object(w) !== w)
|
|
3010
2992
|
return [];
|
|
3011
|
-
var D,
|
|
2993
|
+
var D, O, F = [], q = hasArgsEnumBug && _isArguments(w);
|
|
3012
2994
|
for (D in w)
|
|
3013
2995
|
_has(D, w) && (!q || D !== "length") && (F[F.length] = D);
|
|
3014
2996
|
if (hasEnumBug)
|
|
3015
|
-
for (
|
|
3016
|
-
D = nonEnumerableProps[
|
|
2997
|
+
for (O = nonEnumerableProps.length - 1; O >= 0; )
|
|
2998
|
+
D = nonEnumerableProps[O], _has(D, w) && !contains(F, D) && (F[F.length] = D), O -= 1;
|
|
3017
2999
|
return F;
|
|
3018
3000
|
});
|
|
3019
|
-
function _map(
|
|
3020
|
-
for (var D = 0,
|
|
3021
|
-
F[D] =
|
|
3001
|
+
function _map(U, w) {
|
|
3002
|
+
for (var D = 0, O = w.length, F = Array(O); D < O; )
|
|
3003
|
+
F[D] = U(w[D]), D += 1;
|
|
3022
3004
|
return F;
|
|
3023
3005
|
}
|
|
3024
|
-
function _arrayReduce(
|
|
3025
|
-
for (var
|
|
3026
|
-
w =
|
|
3006
|
+
function _arrayReduce(U, w, D) {
|
|
3007
|
+
for (var O = 0, F = D.length; O < F; )
|
|
3008
|
+
w = U(w, D[O]), O += 1;
|
|
3027
3009
|
return w;
|
|
3028
3010
|
}
|
|
3029
3011
|
var XMap = /* @__PURE__ */ (function() {
|
|
3030
|
-
function
|
|
3012
|
+
function U(w, D) {
|
|
3031
3013
|
this.xf = D, this.f = w;
|
|
3032
3014
|
}
|
|
3033
|
-
return
|
|
3015
|
+
return U.prototype["@@transducer/init"] = _xfBase.init, U.prototype["@@transducer/result"] = _xfBase.result, U.prototype["@@transducer/step"] = function(w, D) {
|
|
3034
3016
|
return this.xf["@@transducer/step"](w, this.f(D));
|
|
3035
|
-
},
|
|
3036
|
-
})(), _xmap = function
|
|
3017
|
+
}, U;
|
|
3018
|
+
})(), _xmap = function U(w) {
|
|
3037
3019
|
return function(D) {
|
|
3038
3020
|
return new XMap(w, D);
|
|
3039
3021
|
};
|
|
3040
|
-
}, map = /* @__PURE__ */ _curry2(/* @__PURE__ */ _dispatchable(["fantasy-land/map", "map"], _xmap, function
|
|
3022
|
+
}, map = /* @__PURE__ */ _curry2(/* @__PURE__ */ _dispatchable(["fantasy-land/map", "map"], _xmap, function U(w, D) {
|
|
3041
3023
|
switch (Object.prototype.toString.call(D)) {
|
|
3042
3024
|
case "[object Function]":
|
|
3043
3025
|
return curryN(D.length, function() {
|
|
3044
3026
|
return w.call(this, D.apply(this, arguments));
|
|
3045
3027
|
});
|
|
3046
3028
|
case "[object Object]":
|
|
3047
|
-
return _arrayReduce(function(
|
|
3048
|
-
return
|
|
3029
|
+
return _arrayReduce(function(O, F) {
|
|
3030
|
+
return O[F] = w(D[F]), O;
|
|
3049
3031
|
}, {}, keys(D));
|
|
3050
3032
|
default:
|
|
3051
3033
|
return _map(w, D);
|
|
3052
3034
|
}
|
|
3053
3035
|
}));
|
|
3054
|
-
const _isInteger = Number.isInteger || function
|
|
3036
|
+
const _isInteger = Number.isInteger || function U(w) {
|
|
3055
3037
|
return w << 0 === w;
|
|
3056
3038
|
};
|
|
3057
|
-
function _nth(
|
|
3058
|
-
var D =
|
|
3039
|
+
function _nth(U, w) {
|
|
3040
|
+
var D = U < 0 ? w.length + U : U;
|
|
3059
3041
|
return w[D];
|
|
3060
3042
|
}
|
|
3061
|
-
function _prop(
|
|
3043
|
+
function _prop(U, w) {
|
|
3062
3044
|
if (w != null)
|
|
3063
|
-
return _isInteger(
|
|
3045
|
+
return _isInteger(U) ? _nth(U, w) : w[U];
|
|
3064
3046
|
}
|
|
3065
|
-
function _isString(
|
|
3066
|
-
return Object.prototype.toString.call(
|
|
3047
|
+
function _isString(U) {
|
|
3048
|
+
return Object.prototype.toString.call(U) === "[object String]";
|
|
3067
3049
|
}
|
|
3068
|
-
var _isArrayLike = /* @__PURE__ */ _curry1(function
|
|
3050
|
+
var _isArrayLike = /* @__PURE__ */ _curry1(function U(w) {
|
|
3069
3051
|
return _isArray(w) ? !0 : !w || typeof w != "object" || _isString(w) ? !1 : w.length === 0 ? !0 : w.length > 0 ? w.hasOwnProperty(0) && w.hasOwnProperty(w.length - 1) : !1;
|
|
3070
3052
|
}), symIterator = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
|
|
3071
|
-
function _createReduce(
|
|
3053
|
+
function _createReduce(U, w, D) {
|
|
3072
3054
|
return function(F, q, W) {
|
|
3073
3055
|
if (_isArrayLike(W))
|
|
3074
|
-
return
|
|
3056
|
+
return U(F, q, W);
|
|
3075
3057
|
if (W == null)
|
|
3076
3058
|
return q;
|
|
3077
3059
|
if (typeof W["fantasy-land/reduce"] == "function")
|
|
@@ -3085,78 +3067,78 @@ function _createReduce(O, w, D) {
|
|
|
3085
3067
|
throw new TypeError("reduce: list must be array or iterable");
|
|
3086
3068
|
};
|
|
3087
3069
|
}
|
|
3088
|
-
var and = /* @__PURE__ */ _curry2(function
|
|
3070
|
+
var and = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3089
3071
|
return w && D;
|
|
3090
3072
|
});
|
|
3091
|
-
function _iterableReduce(
|
|
3092
|
-
for (var
|
|
3093
|
-
w =
|
|
3073
|
+
function _iterableReduce(U, w, D) {
|
|
3074
|
+
for (var O = D.next(); !O.done; )
|
|
3075
|
+
w = U(w, O.value), O = D.next();
|
|
3094
3076
|
return w;
|
|
3095
3077
|
}
|
|
3096
|
-
function _methodReduce(
|
|
3097
|
-
return D[
|
|
3078
|
+
function _methodReduce(U, w, D, O) {
|
|
3079
|
+
return D[O](U, w);
|
|
3098
3080
|
}
|
|
3099
|
-
var _reduce = /* @__PURE__ */ _createReduce(_arrayReduce, _methodReduce, _iterableReduce), ap = /* @__PURE__ */ _curry2(function
|
|
3100
|
-
return typeof D["fantasy-land/ap"] == "function" ? D["fantasy-land/ap"](w) : typeof w.ap == "function" ? w.ap(D) : typeof w == "function" ? function(
|
|
3101
|
-
return w(
|
|
3102
|
-
} : _reduce(function(
|
|
3103
|
-
return _concat(
|
|
3081
|
+
var _reduce = /* @__PURE__ */ _createReduce(_arrayReduce, _methodReduce, _iterableReduce), ap = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3082
|
+
return typeof D["fantasy-land/ap"] == "function" ? D["fantasy-land/ap"](w) : typeof w.ap == "function" ? w.ap(D) : typeof w == "function" ? function(O) {
|
|
3083
|
+
return w(O)(D(O));
|
|
3084
|
+
} : _reduce(function(O, F) {
|
|
3085
|
+
return _concat(O, map(F, D));
|
|
3104
3086
|
}, [], w);
|
|
3105
3087
|
});
|
|
3106
|
-
function _assoc(
|
|
3107
|
-
if (_isInteger(
|
|
3108
|
-
var
|
|
3109
|
-
return F[
|
|
3088
|
+
function _assoc(U, w, D) {
|
|
3089
|
+
if (_isInteger(U) && _isArray(D)) {
|
|
3090
|
+
var O = U < 0 ? D.length + U : U, F = [].concat(D);
|
|
3091
|
+
return F[O] = w, F;
|
|
3110
3092
|
}
|
|
3111
3093
|
var q = {};
|
|
3112
3094
|
for (var W in D)
|
|
3113
3095
|
q[W] = D[W];
|
|
3114
|
-
return q[
|
|
3096
|
+
return q[U] = w, q;
|
|
3115
3097
|
}
|
|
3116
|
-
var isNil = /* @__PURE__ */ _curry1(function
|
|
3098
|
+
var isNil = /* @__PURE__ */ _curry1(function U(w) {
|
|
3117
3099
|
return w == null;
|
|
3118
|
-
}), assocPath = /* @__PURE__ */ _curry3(function
|
|
3100
|
+
}), assocPath = /* @__PURE__ */ _curry3(function U(w, D, O) {
|
|
3119
3101
|
if (w.length === 0)
|
|
3120
3102
|
return D;
|
|
3121
3103
|
var F = w[0];
|
|
3122
3104
|
if (w.length > 1) {
|
|
3123
|
-
var q = _prop(F,
|
|
3124
|
-
(isNil(q) || typeof q != "object") && (q = _isInteger(w[1]) ? [] : {}), D =
|
|
3105
|
+
var q = _prop(F, O);
|
|
3106
|
+
(isNil(q) || typeof q != "object") && (q = _isInteger(w[1]) ? [] : {}), D = U(Array.prototype.slice.call(w, 1), D, q);
|
|
3125
3107
|
}
|
|
3126
|
-
return _assoc(F, D,
|
|
3108
|
+
return _assoc(F, D, O);
|
|
3127
3109
|
});
|
|
3128
|
-
function _isFunction(
|
|
3129
|
-
var w = Object.prototype.toString.call(
|
|
3110
|
+
function _isFunction(U) {
|
|
3111
|
+
var w = Object.prototype.toString.call(U);
|
|
3130
3112
|
return w === "[object Function]" || w === "[object AsyncFunction]" || w === "[object GeneratorFunction]" || w === "[object AsyncGeneratorFunction]";
|
|
3131
3113
|
}
|
|
3132
|
-
var liftN = /* @__PURE__ */ _curry2(function
|
|
3133
|
-
var
|
|
3114
|
+
var liftN = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3115
|
+
var O = curryN(w, D);
|
|
3134
3116
|
return curryN(w, function() {
|
|
3135
|
-
return _arrayReduce(ap, map(
|
|
3117
|
+
return _arrayReduce(ap, map(O, arguments[0]), Array.prototype.slice.call(arguments, 1));
|
|
3136
3118
|
});
|
|
3137
|
-
}), lift = /* @__PURE__ */ _curry1(function
|
|
3119
|
+
}), lift = /* @__PURE__ */ _curry1(function U(w) {
|
|
3138
3120
|
return liftN(w.length, w);
|
|
3139
|
-
}), both = /* @__PURE__ */ _curry2(function
|
|
3121
|
+
}), both = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3140
3122
|
return _isFunction(w) ? function() {
|
|
3141
3123
|
return w.apply(this, arguments) && D.apply(this, arguments);
|
|
3142
3124
|
} : lift(and)(w, D);
|
|
3143
|
-
}), hasPath = /* @__PURE__ */ _curry2(function
|
|
3125
|
+
}), hasPath = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3144
3126
|
if (w.length === 0 || isNil(D))
|
|
3145
3127
|
return !1;
|
|
3146
|
-
for (var
|
|
3147
|
-
if (!isNil(
|
|
3148
|
-
|
|
3128
|
+
for (var O = D, F = 0; F < w.length; )
|
|
3129
|
+
if (!isNil(O) && _has(w[F], O))
|
|
3130
|
+
O = O[w[F]], F += 1;
|
|
3149
3131
|
else
|
|
3150
3132
|
return !1;
|
|
3151
3133
|
return !0;
|
|
3152
|
-
}), has = /* @__PURE__ */ _curry2(function
|
|
3134
|
+
}), has = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3153
3135
|
return hasPath([w], D);
|
|
3154
3136
|
});
|
|
3155
|
-
function _path(
|
|
3156
|
-
for (var D = w,
|
|
3137
|
+
function _path(U, w) {
|
|
3138
|
+
for (var D = w, O = 0; O < U.length; O += 1) {
|
|
3157
3139
|
if (D == null)
|
|
3158
3140
|
return;
|
|
3159
|
-
var F = O
|
|
3141
|
+
var F = U[O];
|
|
3160
3142
|
_isInteger(F) ? D = _nth(F, D) : D = D[F];
|
|
3161
3143
|
}
|
|
3162
3144
|
return D;
|
|
@@ -3166,17 +3148,7 @@ const DEFAULT_FORMATTERS = {
|
|
|
3166
3148
|
/**
|
|
3167
3149
|
* Format as JSON (useful for debugging)
|
|
3168
3150
|
*/
|
|
3169
|
-
json: (
|
|
3170
|
-
/**
|
|
3171
|
-
* Format date as "DD MMM YY HH:mm:ss" (e.g., "10 Nov 25 11:27:49")
|
|
3172
|
-
* Accepts ISO date strings, timestamps, or Date objects.
|
|
3173
|
-
* Returns empty string for null/undefined values.
|
|
3174
|
-
*/
|
|
3175
|
-
date: (O) => {
|
|
3176
|
-
if (!O) return "";
|
|
3177
|
-
const w = O instanceof Date ? O : new Date(O);
|
|
3178
|
-
return isNaN(w.getTime()) ? (console.warn("[Binder] Invalid date value:", O), "") : dateToZooyStdTimeString(w);
|
|
3179
|
-
},
|
|
3151
|
+
json: (U) => JSON.stringify(U, null, 2),
|
|
3180
3152
|
/**
|
|
3181
3153
|
* Template string interpolation formatter
|
|
3182
3154
|
* Evaluates a template string with access to 'value' and 'data'
|
|
@@ -3197,13 +3169,13 @@ const DEFAULT_FORMATTERS = {
|
|
|
3197
3169
|
* <span zoo-bind="price|tpl"
|
|
3198
3170
|
* zoo-bind-tpl="$${(value / 100).toFixed(2)}">
|
|
3199
3171
|
*/
|
|
3200
|
-
tpl: (
|
|
3201
|
-
const
|
|
3202
|
-
if (!
|
|
3172
|
+
tpl: (U, w, D) => {
|
|
3173
|
+
const O = D?.getAttribute("zoo-bind-attr-tpl") || D?.getAttribute("zoo-bind-tpl");
|
|
3174
|
+
if (!O) return U;
|
|
3203
3175
|
try {
|
|
3204
|
-
return new Function("value", "data", `return \`${
|
|
3176
|
+
return new Function("value", "data", `return \`${O}\`;`)(U, w);
|
|
3205
3177
|
} catch (F) {
|
|
3206
|
-
return console.warn("[Binder] Invalid template:",
|
|
3178
|
+
return console.warn("[Binder] Invalid template:", O, F), U;
|
|
3207
3179
|
}
|
|
3208
3180
|
}
|
|
3209
3181
|
};
|
|
@@ -3224,12 +3196,12 @@ class Binder {
|
|
|
3224
3196
|
* @param {Object<string, Function>} [options.formatters] - Custom formatters
|
|
3225
3197
|
* @throws {Error} If url or rootEl is missing/invalid
|
|
3226
3198
|
*/
|
|
3227
|
-
constructor(w, D,
|
|
3199
|
+
constructor(w, D, O, F = {}) {
|
|
3228
3200
|
if (!D)
|
|
3229
3201
|
throw new Error("Binder requires a URL");
|
|
3230
|
-
if (!
|
|
3202
|
+
if (!O || !(O instanceof Element))
|
|
3231
3203
|
throw new Error("Binder requires a valid rootEl Element");
|
|
3232
|
-
this.#t = w, this.#e = new URL(D, window.location.origin), this.#s =
|
|
3204
|
+
this.#t = w, this.#e = new URL(D, window.location.origin), this.#s = O, this.#n = { ...DEFAULT_FORMATTERS, ...F.formatters }, F.urlParams ? this.#i(F.urlParams) : this.#o();
|
|
3233
3205
|
}
|
|
3234
3206
|
get url() {
|
|
3235
3207
|
return this.#e;
|
|
@@ -3247,16 +3219,16 @@ class Binder {
|
|
|
3247
3219
|
return both(has("count"), has("results"))(this.#r);
|
|
3248
3220
|
}
|
|
3249
3221
|
#i(w) {
|
|
3250
|
-
return Object.entries(w).forEach(([D,
|
|
3251
|
-
if (!isDefAndNotNull(
|
|
3222
|
+
return Object.entries(w).forEach(([D, O]) => {
|
|
3223
|
+
if (!isDefAndNotNull(O) || O === "" || Array.isArray(O) && O.length < 1) {
|
|
3252
3224
|
this.#e.searchParams.delete(D);
|
|
3253
3225
|
return;
|
|
3254
3226
|
}
|
|
3255
|
-
if (Array.isArray(
|
|
3256
|
-
this.#e.searchParams.set(D,
|
|
3227
|
+
if (Array.isArray(O)) {
|
|
3228
|
+
this.#e.searchParams.set(D, O.join(","));
|
|
3257
3229
|
return;
|
|
3258
3230
|
}
|
|
3259
|
-
this.#e.searchParams.set(D,
|
|
3231
|
+
this.#e.searchParams.set(D, O);
|
|
3260
3232
|
}), this.#o(), this.#e;
|
|
3261
3233
|
}
|
|
3262
3234
|
/**
|
|
@@ -3339,19 +3311,19 @@ class Binder {
|
|
|
3339
3311
|
* @param {boolean} [options.removeAttributes=false] - Remove binding attributes after processing (vs keeping for re-render)
|
|
3340
3312
|
* @private
|
|
3341
3313
|
*/
|
|
3342
|
-
#a(w, D,
|
|
3314
|
+
#a(w, D, O = 0, F = {}) {
|
|
3343
3315
|
const q = F.removeAttributes ?? !1;
|
|
3344
3316
|
w.querySelectorAll("[zoo-bind-attr]").forEach((W) => {
|
|
3345
3317
|
if (W.closest("[zoo-template]")) return;
|
|
3346
3318
|
W.getAttribute("zoo-bind-attr").split(",").forEach((G) => {
|
|
3347
3319
|
const [K, Q] = G.split(":").map((Z) => Z.trim()), [tt, J] = Q.split("|").map((Z) => Z.trim());
|
|
3348
|
-
let
|
|
3349
|
-
J && this.#n[J] && (
|
|
3320
|
+
let X = this.#c(D, tt, O);
|
|
3321
|
+
J && this.#n[J] && (X = this.#n[J](X, D, W)), isDefAndNotNull(X) && W.setAttribute(K, X);
|
|
3350
3322
|
}), q && (W.removeAttribute("zoo-bind-attr"), W.removeAttribute("zoo-bind-attr-tpl"));
|
|
3351
3323
|
}), w.querySelectorAll("[zoo-bind]").forEach((W) => {
|
|
3352
3324
|
if (W.closest("[zoo-template]")) return;
|
|
3353
|
-
const
|
|
3354
|
-
let Q = this.#c(D, G,
|
|
3325
|
+
const Y = W.getAttribute("zoo-bind"), [G, K] = Y.split("|").map((tt) => tt.trim());
|
|
3326
|
+
let Q = this.#c(D, G, O);
|
|
3355
3327
|
K && this.#n[K] && (Q = this.#n[K](Q, D, W)), W.textContent = Q ?? "", q && (W.removeAttribute("zoo-bind"), W.removeAttribute("zoo-bind-tpl"));
|
|
3356
3328
|
});
|
|
3357
3329
|
}
|
|
@@ -3362,14 +3334,14 @@ class Binder {
|
|
|
3362
3334
|
*/
|
|
3363
3335
|
#l() {
|
|
3364
3336
|
this.#s.querySelectorAll("[zoo-template]").forEach((D) => {
|
|
3365
|
-
const
|
|
3366
|
-
if (!
|
|
3337
|
+
const O = D.getAttribute("zoo-template"), F = D.getAttribute("zoo-template-bind");
|
|
3338
|
+
if (!O) {
|
|
3367
3339
|
console.warn("[Binder] Consumer missing template ID", D);
|
|
3368
3340
|
return;
|
|
3369
3341
|
}
|
|
3370
|
-
const q = this.#s.querySelector(`#${
|
|
3342
|
+
const q = this.#s.querySelector(`#${O}`);
|
|
3371
3343
|
if (!q || q.tagName !== "TEMPLATE") {
|
|
3372
|
-
console.error(`[DataBinder] Template not found or invalid: ${
|
|
3344
|
+
console.error(`[DataBinder] Template not found or invalid: ${O}`);
|
|
3373
3345
|
return;
|
|
3374
3346
|
}
|
|
3375
3347
|
const W = F ? path(F.split("."), this.#r) : this.#r;
|
|
@@ -3381,8 +3353,8 @@ class Binder {
|
|
|
3381
3353
|
console.error(`[DataBinder] Data slice is not an array. Path: ${F}`, W);
|
|
3382
3354
|
return;
|
|
3383
3355
|
}
|
|
3384
|
-
D.innerHTML = "", W.forEach((
|
|
3385
|
-
const K = this.#h(q,
|
|
3356
|
+
D.innerHTML = "", W.forEach((Y, G) => {
|
|
3357
|
+
const K = this.#h(q, Y, G);
|
|
3386
3358
|
D.appendChild(K);
|
|
3387
3359
|
});
|
|
3388
3360
|
});
|
|
@@ -3397,9 +3369,9 @@ class Binder {
|
|
|
3397
3369
|
* @return {DocumentFragment} Rendered template clone
|
|
3398
3370
|
* @private
|
|
3399
3371
|
*/
|
|
3400
|
-
#h(w, D,
|
|
3372
|
+
#h(w, D, O) {
|
|
3401
3373
|
const F = w.content.cloneNode(!0);
|
|
3402
|
-
return this.#a(F, D,
|
|
3374
|
+
return this.#a(F, D, O, {
|
|
3403
3375
|
removeAttributes: !0
|
|
3404
3376
|
}), F;
|
|
3405
3377
|
}
|
|
@@ -3418,12 +3390,12 @@ class Binder {
|
|
|
3418
3390
|
* @return {*} The value, or undefined if not found
|
|
3419
3391
|
* @private
|
|
3420
3392
|
*/
|
|
3421
|
-
#c(w, D,
|
|
3393
|
+
#c(w, D, O) {
|
|
3422
3394
|
const F = {
|
|
3423
|
-
$index: () =>
|
|
3424
|
-
$index__paged: () => this.offset +
|
|
3425
|
-
$index1: () =>
|
|
3426
|
-
$index1__paged: () => this.offset +
|
|
3395
|
+
$index: () => O,
|
|
3396
|
+
$index__paged: () => this.offset + O,
|
|
3397
|
+
$index1: () => O + 1,
|
|
3398
|
+
$index1__paged: () => this.offset + O + 1
|
|
3427
3399
|
};
|
|
3428
3400
|
return F[D] ? F[D]() : path(D.split("."), w);
|
|
3429
3401
|
}
|
|
@@ -3439,13 +3411,13 @@ const SEMANTIC_ATTRS = new Map(Object.entries({
|
|
|
3439
3411
|
"zoo-view": "view",
|
|
3440
3412
|
"zoo-event": "event",
|
|
3441
3413
|
"zoo-href": "href"
|
|
3442
|
-
})), getSemanticAttributes = (
|
|
3414
|
+
})), getSemanticAttributes = (U) => {
|
|
3443
3415
|
let w = {};
|
|
3444
|
-
return Array.from(
|
|
3445
|
-
const
|
|
3446
|
-
SEMANTIC_ATTRS.has(
|
|
3416
|
+
return Array.from(U.attributes).forEach((D) => {
|
|
3417
|
+
const O = D.name, F = D.value;
|
|
3418
|
+
SEMANTIC_ATTRS.has(O) ? w[SEMANTIC_ATTRS.get(O)] = F : (O.startsWith("data-") || O.startsWith("zoo-")) && (w = assocPath(O.split("-"), F, w));
|
|
3447
3419
|
}), w;
|
|
3448
|
-
}, getEventAttribute = (
|
|
3420
|
+
}, getEventAttribute = (U, w, D = "event") => U.getAttribute(w) || U.getAttribute(D);
|
|
3449
3421
|
/**
|
|
3450
3422
|
* @license
|
|
3451
3423
|
* Copyright 2019 Google LLC
|
|
@@ -3453,16 +3425,16 @@ const SEMANTIC_ATTRS = new Map(Object.entries({
|
|
|
3453
3425
|
*/
|
|
3454
3426
|
const t$1 = globalThis, e$2 = t$1.ShadowRoot && (t$1.ShadyCSS === void 0 || t$1.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$3 = /* @__PURE__ */ new WeakMap();
|
|
3455
3427
|
let n$2 = class {
|
|
3456
|
-
constructor(w, D,
|
|
3457
|
-
if (this._$cssResult$ = !0,
|
|
3428
|
+
constructor(w, D, O) {
|
|
3429
|
+
if (this._$cssResult$ = !0, O !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
3458
3430
|
this.cssText = w, this.t = D;
|
|
3459
3431
|
}
|
|
3460
3432
|
get styleSheet() {
|
|
3461
3433
|
let w = this.o;
|
|
3462
3434
|
const D = this.t;
|
|
3463
3435
|
if (e$2 && w === void 0) {
|
|
3464
|
-
const
|
|
3465
|
-
|
|
3436
|
+
const O = D !== void 0 && D.length === 1;
|
|
3437
|
+
O && (w = o$3.get(D)), w === void 0 && ((this.o = w = new CSSStyleSheet()).replaceSync(this.cssText), O && o$3.set(D, w));
|
|
3466
3438
|
}
|
|
3467
3439
|
return w;
|
|
3468
3440
|
}
|
|
@@ -3470,58 +3442,58 @@ let n$2 = class {
|
|
|
3470
3442
|
return this.cssText;
|
|
3471
3443
|
}
|
|
3472
3444
|
};
|
|
3473
|
-
const r$2 = (
|
|
3474
|
-
const D =
|
|
3445
|
+
const r$2 = (U) => new n$2(typeof U == "string" ? U : U + "", void 0, s$2), i$3 = (U, ...w) => {
|
|
3446
|
+
const D = U.length === 1 ? U[0] : w.reduce(((O, F, q) => O + ((W) => {
|
|
3475
3447
|
if (W._$cssResult$ === !0) return W.cssText;
|
|
3476
3448
|
if (typeof W == "number") return W;
|
|
3477
3449
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + W + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
3478
|
-
})(F) +
|
|
3479
|
-
return new n$2(D,
|
|
3480
|
-
}, S$1 = (
|
|
3481
|
-
if (e$2)
|
|
3450
|
+
})(F) + U[q + 1]), U[0]);
|
|
3451
|
+
return new n$2(D, U, s$2);
|
|
3452
|
+
}, S$1 = (U, w) => {
|
|
3453
|
+
if (e$2) U.adoptedStyleSheets = w.map(((D) => D instanceof CSSStyleSheet ? D : D.styleSheet));
|
|
3482
3454
|
else for (const D of w) {
|
|
3483
|
-
const
|
|
3484
|
-
F !== void 0 &&
|
|
3455
|
+
const O = document.createElement("style"), F = t$1.litNonce;
|
|
3456
|
+
F !== void 0 && O.setAttribute("nonce", F), O.textContent = D.cssText, U.appendChild(O);
|
|
3485
3457
|
}
|
|
3486
|
-
}, c$2 = e$2 ? (
|
|
3458
|
+
}, c$2 = e$2 ? (U) => U : (U) => U instanceof CSSStyleSheet ? ((w) => {
|
|
3487
3459
|
let D = "";
|
|
3488
|
-
for (const
|
|
3460
|
+
for (const O of w.cssRules) D += O.cssText;
|
|
3489
3461
|
return r$2(D);
|
|
3490
|
-
})(
|
|
3462
|
+
})(U) : U;
|
|
3491
3463
|
/**
|
|
3492
3464
|
* @license
|
|
3493
3465
|
* Copyright 2017 Google LLC
|
|
3494
3466
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3495
3467
|
*/
|
|
3496
|
-
const { is: i$2, defineProperty: e$1, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$1, getOwnPropertySymbols: o$2, getPrototypeOf: n$1 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (
|
|
3468
|
+
const { is: i$2, defineProperty: e$1, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$1, getOwnPropertySymbols: o$2, getPrototypeOf: n$1 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (U, w) => U, u$1 = { toAttribute(U, w) {
|
|
3497
3469
|
switch (w) {
|
|
3498
3470
|
case Boolean:
|
|
3499
|
-
|
|
3471
|
+
U = U ? l$1 : null;
|
|
3500
3472
|
break;
|
|
3501
3473
|
case Object:
|
|
3502
3474
|
case Array:
|
|
3503
|
-
|
|
3475
|
+
U = U == null ? U : JSON.stringify(U);
|
|
3504
3476
|
}
|
|
3505
|
-
return
|
|
3506
|
-
}, fromAttribute(
|
|
3507
|
-
let D =
|
|
3477
|
+
return U;
|
|
3478
|
+
}, fromAttribute(U, w) {
|
|
3479
|
+
let D = U;
|
|
3508
3480
|
switch (w) {
|
|
3509
3481
|
case Boolean:
|
|
3510
|
-
D =
|
|
3482
|
+
D = U !== null;
|
|
3511
3483
|
break;
|
|
3512
3484
|
case Number:
|
|
3513
|
-
D =
|
|
3485
|
+
D = U === null ? null : Number(U);
|
|
3514
3486
|
break;
|
|
3515
3487
|
case Object:
|
|
3516
3488
|
case Array:
|
|
3517
3489
|
try {
|
|
3518
|
-
D = JSON.parse(
|
|
3490
|
+
D = JSON.parse(U);
|
|
3519
3491
|
} catch {
|
|
3520
3492
|
D = null;
|
|
3521
3493
|
}
|
|
3522
3494
|
}
|
|
3523
3495
|
return D;
|
|
3524
|
-
} }, f$1 = (
|
|
3496
|
+
} }, f$1 = (U, w) => !i$2(U, w), b$1 = { attribute: !0, type: String, converter: u$1, reflect: !1, useDefault: !1, hasChanged: f$1 };
|
|
3525
3497
|
Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
3526
3498
|
let y$1 = class extends HTMLElement {
|
|
3527
3499
|
static addInitializer(w) {
|
|
@@ -3532,19 +3504,19 @@ let y$1 = class extends HTMLElement {
|
|
|
3532
3504
|
}
|
|
3533
3505
|
static createProperty(w, D = b$1) {
|
|
3534
3506
|
if (D.state && (D.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(w) && ((D = Object.create(D)).wrapped = !0), this.elementProperties.set(w, D), !D.noAccessor) {
|
|
3535
|
-
const
|
|
3507
|
+
const O = Symbol(), F = this.getPropertyDescriptor(w, O, D);
|
|
3536
3508
|
F !== void 0 && e$1(this.prototype, w, F);
|
|
3537
3509
|
}
|
|
3538
3510
|
}
|
|
3539
|
-
static getPropertyDescriptor(w, D,
|
|
3511
|
+
static getPropertyDescriptor(w, D, O) {
|
|
3540
3512
|
const { get: F, set: q } = h$1(this.prototype, w) ?? { get() {
|
|
3541
3513
|
return this[D];
|
|
3542
3514
|
}, set(W) {
|
|
3543
3515
|
this[D] = W;
|
|
3544
3516
|
} };
|
|
3545
3517
|
return { get: F, set(W) {
|
|
3546
|
-
const
|
|
3547
|
-
q?.call(this, W), this.requestUpdate(w,
|
|
3518
|
+
const Y = F?.call(this);
|
|
3519
|
+
q?.call(this, W), this.requestUpdate(w, Y, O);
|
|
3548
3520
|
}, configurable: !0, enumerable: !0 };
|
|
3549
3521
|
}
|
|
3550
3522
|
static getPropertyOptions(w) {
|
|
@@ -3558,17 +3530,17 @@ let y$1 = class extends HTMLElement {
|
|
|
3558
3530
|
static finalize() {
|
|
3559
3531
|
if (this.hasOwnProperty(d$1("finalized"))) return;
|
|
3560
3532
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
|
|
3561
|
-
const D = this.properties,
|
|
3562
|
-
for (const F of
|
|
3533
|
+
const D = this.properties, O = [...r$1(D), ...o$2(D)];
|
|
3534
|
+
for (const F of O) this.createProperty(F, D[F]);
|
|
3563
3535
|
}
|
|
3564
3536
|
const w = this[Symbol.metadata];
|
|
3565
3537
|
if (w !== null) {
|
|
3566
3538
|
const D = litPropertyMetadata.get(w);
|
|
3567
|
-
if (D !== void 0) for (const [
|
|
3539
|
+
if (D !== void 0) for (const [O, F] of D) this.elementProperties.set(O, F);
|
|
3568
3540
|
}
|
|
3569
3541
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
3570
|
-
for (const [D,
|
|
3571
|
-
const F = this._$Eu(D,
|
|
3542
|
+
for (const [D, O] of this.elementProperties) {
|
|
3543
|
+
const F = this._$Eu(D, O);
|
|
3572
3544
|
F !== void 0 && this._$Eh.set(F, D);
|
|
3573
3545
|
}
|
|
3574
3546
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
@@ -3576,14 +3548,14 @@ let y$1 = class extends HTMLElement {
|
|
|
3576
3548
|
static finalizeStyles(w) {
|
|
3577
3549
|
const D = [];
|
|
3578
3550
|
if (Array.isArray(w)) {
|
|
3579
|
-
const
|
|
3580
|
-
for (const F of
|
|
3551
|
+
const O = new Set(w.flat(1 / 0).reverse());
|
|
3552
|
+
for (const F of O) D.unshift(c$2(F));
|
|
3581
3553
|
} else w !== void 0 && D.push(c$2(w));
|
|
3582
3554
|
return D;
|
|
3583
3555
|
}
|
|
3584
3556
|
static _$Eu(w, D) {
|
|
3585
|
-
const
|
|
3586
|
-
return
|
|
3557
|
+
const O = D.attribute;
|
|
3558
|
+
return O === !1 ? void 0 : typeof O == "string" ? O : typeof w == "string" ? w.toLowerCase() : void 0;
|
|
3587
3559
|
}
|
|
3588
3560
|
constructor() {
|
|
3589
3561
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -3599,7 +3571,7 @@ let y$1 = class extends HTMLElement {
|
|
|
3599
3571
|
}
|
|
3600
3572
|
_$E_() {
|
|
3601
3573
|
const w = /* @__PURE__ */ new Map(), D = this.constructor.elementProperties;
|
|
3602
|
-
for (const
|
|
3574
|
+
for (const O of D.keys()) this.hasOwnProperty(O) && (w.set(O, this[O]), delete this[O]);
|
|
3603
3575
|
w.size > 0 && (this._$Ep = w);
|
|
3604
3576
|
}
|
|
3605
3577
|
createRenderRoot() {
|
|
@@ -3614,35 +3586,35 @@ let y$1 = class extends HTMLElement {
|
|
|
3614
3586
|
disconnectedCallback() {
|
|
3615
3587
|
this._$EO?.forEach(((w) => w.hostDisconnected?.()));
|
|
3616
3588
|
}
|
|
3617
|
-
attributeChangedCallback(w, D,
|
|
3618
|
-
this._$AK(w,
|
|
3589
|
+
attributeChangedCallback(w, D, O) {
|
|
3590
|
+
this._$AK(w, O);
|
|
3619
3591
|
}
|
|
3620
3592
|
_$ET(w, D) {
|
|
3621
|
-
const
|
|
3622
|
-
if (F !== void 0 &&
|
|
3623
|
-
const q = (
|
|
3593
|
+
const O = this.constructor.elementProperties.get(w), F = this.constructor._$Eu(w, O);
|
|
3594
|
+
if (F !== void 0 && O.reflect === !0) {
|
|
3595
|
+
const q = (O.converter?.toAttribute !== void 0 ? O.converter : u$1).toAttribute(D, O.type);
|
|
3624
3596
|
this._$Em = w, q == null ? this.removeAttribute(F) : this.setAttribute(F, q), this._$Em = null;
|
|
3625
3597
|
}
|
|
3626
3598
|
}
|
|
3627
3599
|
_$AK(w, D) {
|
|
3628
|
-
const
|
|
3600
|
+
const O = this.constructor, F = O._$Eh.get(w);
|
|
3629
3601
|
if (F !== void 0 && this._$Em !== F) {
|
|
3630
|
-
const q =
|
|
3602
|
+
const q = O.getPropertyOptions(F), W = typeof q.converter == "function" ? { fromAttribute: q.converter } : q.converter?.fromAttribute !== void 0 ? q.converter : u$1;
|
|
3631
3603
|
this._$Em = F;
|
|
3632
|
-
const
|
|
3633
|
-
this[F] =
|
|
3604
|
+
const Y = W.fromAttribute(D, q.type);
|
|
3605
|
+
this[F] = Y ?? this._$Ej?.get(F) ?? Y, this._$Em = null;
|
|
3634
3606
|
}
|
|
3635
3607
|
}
|
|
3636
|
-
requestUpdate(w, D,
|
|
3608
|
+
requestUpdate(w, D, O) {
|
|
3637
3609
|
if (w !== void 0) {
|
|
3638
3610
|
const F = this.constructor, q = this[w];
|
|
3639
|
-
if (
|
|
3640
|
-
this.C(w, D,
|
|
3611
|
+
if (O ??= F.getPropertyOptions(w), !((O.hasChanged ?? f$1)(q, D) || O.useDefault && O.reflect && q === this._$Ej?.get(w) && !this.hasAttribute(F._$Eu(w, O)))) return;
|
|
3612
|
+
this.C(w, D, O);
|
|
3641
3613
|
}
|
|
3642
3614
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
3643
3615
|
}
|
|
3644
|
-
C(w, D, { useDefault:
|
|
3645
|
-
|
|
3616
|
+
C(w, D, { useDefault: O, reflect: F, wrapped: q }, W) {
|
|
3617
|
+
O && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(w) && (this._$Ej.set(w, W ?? D ?? this[w]), q !== !0 || W !== void 0) || (this._$AL.has(w) || (this.hasUpdated || O || (D = void 0), this._$AL.set(w, D)), F === !0 && this._$Em !== w && (this._$Eq ??= /* @__PURE__ */ new Set()).add(w));
|
|
3646
3618
|
}
|
|
3647
3619
|
async _$EP() {
|
|
3648
3620
|
this.isUpdatePending = !0;
|
|
@@ -3664,18 +3636,18 @@ let y$1 = class extends HTMLElement {
|
|
|
3664
3636
|
for (const [F, q] of this._$Ep) this[F] = q;
|
|
3665
3637
|
this._$Ep = void 0;
|
|
3666
3638
|
}
|
|
3667
|
-
const
|
|
3668
|
-
if (
|
|
3669
|
-
const { wrapped: W } = q,
|
|
3670
|
-
W !== !0 || this._$AL.has(F) ||
|
|
3639
|
+
const O = this.constructor.elementProperties;
|
|
3640
|
+
if (O.size > 0) for (const [F, q] of O) {
|
|
3641
|
+
const { wrapped: W } = q, Y = this[F];
|
|
3642
|
+
W !== !0 || this._$AL.has(F) || Y === void 0 || this.C(F, void 0, q, Y);
|
|
3671
3643
|
}
|
|
3672
3644
|
}
|
|
3673
3645
|
let w = !1;
|
|
3674
3646
|
const D = this._$AL;
|
|
3675
3647
|
try {
|
|
3676
|
-
w = this.shouldUpdate(D), w ? (this.willUpdate(D), this._$EO?.forEach(((
|
|
3677
|
-
} catch (
|
|
3678
|
-
throw w = !1, this._$EM(),
|
|
3648
|
+
w = this.shouldUpdate(D), w ? (this.willUpdate(D), this._$EO?.forEach(((O) => O.hostUpdate?.())), this.update(D)) : this._$EM();
|
|
3649
|
+
} catch (O) {
|
|
3650
|
+
throw w = !1, this._$EM(), O;
|
|
3679
3651
|
}
|
|
3680
3652
|
w && this._$AE(D);
|
|
3681
3653
|
}
|
|
@@ -3710,46 +3682,46 @@ y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$1("eleme
|
|
|
3710
3682
|
* Copyright 2017 Google LLC
|
|
3711
3683
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3712
3684
|
*/
|
|
3713
|
-
const t = globalThis, i$1 = t.trustedTypes, s$1 = i$1 ? i$1.createPolicy("lit-html", { createHTML: (
|
|
3685
|
+
const t = globalThis, i$1 = t.trustedTypes, s$1 = i$1 ? i$1.createPolicy("lit-html", { createHTML: (U) => U }) : void 0, e = "$lit$", h = `lit$${Math.random().toFixed(9).slice(2)}$`, o$1 = "?" + h, n = `<${o$1}>`, r = document, l = () => r.createComment(""), c = (U) => U === null || typeof U != "object" && typeof U != "function", a = Array.isArray, u = (U) => a(U) || typeof U?.[Symbol.iterator] == "function", d = `[
|
|
3714
3686
|
\f\r]`, f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
|
|
3715
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y = (
|
|
3716
|
-
function P(
|
|
3717
|
-
if (!a(
|
|
3687
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y = (U) => (w, ...D) => ({ _$litType$: U, strings: w, values: D }), x = y(1), b = y(2), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), C = r.createTreeWalker(r, 129);
|
|
3688
|
+
function P(U, w) {
|
|
3689
|
+
if (!a(U) || !U.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
3718
3690
|
return s$1 !== void 0 ? s$1.createHTML(w) : w;
|
|
3719
3691
|
}
|
|
3720
|
-
const V = (
|
|
3721
|
-
const D =
|
|
3692
|
+
const V = (U, w) => {
|
|
3693
|
+
const D = U.length - 1, O = [];
|
|
3722
3694
|
let F, q = w === 2 ? "<svg>" : w === 3 ? "<math>" : "", W = f;
|
|
3723
|
-
for (let
|
|
3724
|
-
const G =
|
|
3695
|
+
for (let Y = 0; Y < D; Y++) {
|
|
3696
|
+
const G = U[Y];
|
|
3725
3697
|
let K, Q, tt = -1, J = 0;
|
|
3726
3698
|
for (; J < G.length && (W.lastIndex = J, Q = W.exec(G), Q !== null); ) J = W.lastIndex, W === f ? Q[1] === "!--" ? W = v : Q[1] !== void 0 ? W = _ : Q[2] !== void 0 ? ($.test(Q[2]) && (F = RegExp("</" + Q[2], "g")), W = m) : Q[3] !== void 0 && (W = m) : W === m ? Q[0] === ">" ? (W = F ?? f, tt = -1) : Q[1] === void 0 ? tt = -2 : (tt = W.lastIndex - Q[2].length, K = Q[1], W = Q[3] === void 0 ? m : Q[3] === '"' ? g : p) : W === g || W === p ? W = m : W === v || W === _ ? W = f : (W = m, F = void 0);
|
|
3727
|
-
const
|
|
3728
|
-
q += W === f ? G + n : tt >= 0 ? (
|
|
3699
|
+
const X = W === m && U[Y + 1].startsWith("/>") ? " " : "";
|
|
3700
|
+
q += W === f ? G + n : tt >= 0 ? (O.push(K), G.slice(0, tt) + e + G.slice(tt) + h + X) : G + h + (tt === -2 ? Y : X);
|
|
3729
3701
|
}
|
|
3730
|
-
return [P(
|
|
3702
|
+
return [P(U, q + (U[D] || "<?>") + (w === 2 ? "</svg>" : w === 3 ? "</math>" : "")), O];
|
|
3731
3703
|
};
|
|
3732
3704
|
class N {
|
|
3733
|
-
constructor({ strings: w, _$litType$: D },
|
|
3705
|
+
constructor({ strings: w, _$litType$: D }, O) {
|
|
3734
3706
|
let F;
|
|
3735
3707
|
this.parts = [];
|
|
3736
3708
|
let q = 0, W = 0;
|
|
3737
|
-
const
|
|
3738
|
-
if (this.el = N.createElement(K,
|
|
3709
|
+
const Y = w.length - 1, G = this.parts, [K, Q] = V(w, D);
|
|
3710
|
+
if (this.el = N.createElement(K, O), C.currentNode = this.el.content, D === 2 || D === 3) {
|
|
3739
3711
|
const tt = this.el.content.firstChild;
|
|
3740
3712
|
tt.replaceWith(...tt.childNodes);
|
|
3741
3713
|
}
|
|
3742
|
-
for (; (F = C.nextNode()) !== null && G.length <
|
|
3714
|
+
for (; (F = C.nextNode()) !== null && G.length < Y; ) {
|
|
3743
3715
|
if (F.nodeType === 1) {
|
|
3744
3716
|
if (F.hasAttributes()) for (const tt of F.getAttributeNames()) if (tt.endsWith(e)) {
|
|
3745
|
-
const J = Q[W++],
|
|
3746
|
-
G.push({ type: 1, index: q, name: Z[2], strings:
|
|
3717
|
+
const J = Q[W++], X = F.getAttribute(tt).split(h), Z = /([.?@])?(.*)/.exec(J);
|
|
3718
|
+
G.push({ type: 1, index: q, name: Z[2], strings: X, ctor: Z[1] === "." ? H : Z[1] === "?" ? I : Z[1] === "@" ? L : k }), F.removeAttribute(tt);
|
|
3747
3719
|
} else tt.startsWith(h) && (G.push({ type: 6, index: q }), F.removeAttribute(tt));
|
|
3748
3720
|
if ($.test(F.tagName)) {
|
|
3749
3721
|
const tt = F.textContent.split(h), J = tt.length - 1;
|
|
3750
3722
|
if (J > 0) {
|
|
3751
3723
|
F.textContent = i$1 ? i$1.emptyScript : "";
|
|
3752
|
-
for (let
|
|
3724
|
+
for (let X = 0; X < J; X++) F.append(tt[X], l()), C.nextNode(), G.push({ type: 2, index: ++q });
|
|
3753
3725
|
F.append(tt[J], l());
|
|
3754
3726
|
}
|
|
3755
3727
|
}
|
|
@@ -3762,15 +3734,15 @@ class N {
|
|
|
3762
3734
|
}
|
|
3763
3735
|
}
|
|
3764
3736
|
static createElement(w, D) {
|
|
3765
|
-
const
|
|
3766
|
-
return
|
|
3737
|
+
const O = r.createElement("template");
|
|
3738
|
+
return O.innerHTML = w, O;
|
|
3767
3739
|
}
|
|
3768
3740
|
}
|
|
3769
|
-
function S(
|
|
3741
|
+
function S(U, w, D = U, O) {
|
|
3770
3742
|
if (w === T) return w;
|
|
3771
|
-
let F =
|
|
3743
|
+
let F = O !== void 0 ? D._$Co?.[O] : D._$Cl;
|
|
3772
3744
|
const q = c(w) ? void 0 : w._$litDirective$;
|
|
3773
|
-
return F?.constructor !== q && (F?._$AO?.(!1), q === void 0 ? F = void 0 : (F = new q(
|
|
3745
|
+
return F?.constructor !== q && (F?._$AO?.(!1), q === void 0 ? F = void 0 : (F = new q(U), F._$AT(U, D, O)), O !== void 0 ? (D._$Co ??= [])[O] = F : D._$Cl = F), F !== void 0 && (w = S(U, F._$AS(U, w.values), F, O)), w;
|
|
3774
3746
|
}
|
|
3775
3747
|
class M {
|
|
3776
3748
|
constructor(w, D) {
|
|
@@ -3783,13 +3755,13 @@ class M {
|
|
|
3783
3755
|
return this._$AM._$AU;
|
|
3784
3756
|
}
|
|
3785
3757
|
u(w) {
|
|
3786
|
-
const { el: { content: D }, parts:
|
|
3758
|
+
const { el: { content: D }, parts: O } = this._$AD, F = (w?.creationScope ?? r).importNode(D, !0);
|
|
3787
3759
|
C.currentNode = F;
|
|
3788
|
-
let q = C.nextNode(), W = 0,
|
|
3760
|
+
let q = C.nextNode(), W = 0, Y = 0, G = O[0];
|
|
3789
3761
|
for (; G !== void 0; ) {
|
|
3790
3762
|
if (W === G.index) {
|
|
3791
3763
|
let K;
|
|
3792
|
-
G.type === 2 ? K = new R(q, q.nextSibling, this, w) : G.type === 1 ? K = new G.ctor(q, G.name, G.strings, this, w) : G.type === 6 && (K = new z(q, this, w)), this._$AV.push(K), G =
|
|
3764
|
+
G.type === 2 ? K = new R(q, q.nextSibling, this, w) : G.type === 1 ? K = new G.ctor(q, G.name, G.strings, this, w) : G.type === 6 && (K = new z(q, this, w)), this._$AV.push(K), G = O[++Y];
|
|
3793
3765
|
}
|
|
3794
3766
|
W !== G?.index && (q = C.nextNode(), W++);
|
|
3795
3767
|
}
|
|
@@ -3797,15 +3769,15 @@ class M {
|
|
|
3797
3769
|
}
|
|
3798
3770
|
p(w) {
|
|
3799
3771
|
let D = 0;
|
|
3800
|
-
for (const
|
|
3772
|
+
for (const O of this._$AV) O !== void 0 && (O.strings !== void 0 ? (O._$AI(w, O, D), D += O.strings.length - 2) : O._$AI(w[D])), D++;
|
|
3801
3773
|
}
|
|
3802
3774
|
}
|
|
3803
3775
|
class R {
|
|
3804
3776
|
get _$AU() {
|
|
3805
3777
|
return this._$AM?._$AU ?? this._$Cv;
|
|
3806
3778
|
}
|
|
3807
|
-
constructor(w, D,
|
|
3808
|
-
this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = w, this._$AB = D, this._$AM =
|
|
3779
|
+
constructor(w, D, O, F) {
|
|
3780
|
+
this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = w, this._$AB = D, this._$AM = O, this.options = F, this._$Cv = F?.isConnected ?? !0;
|
|
3809
3781
|
}
|
|
3810
3782
|
get parentNode() {
|
|
3811
3783
|
let w = this._$AA.parentNode;
|
|
@@ -3831,7 +3803,7 @@ class R {
|
|
|
3831
3803
|
this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = w : this.T(r.createTextNode(w)), this._$AH = w;
|
|
3832
3804
|
}
|
|
3833
3805
|
$(w) {
|
|
3834
|
-
const { values: D, _$litType$:
|
|
3806
|
+
const { values: D, _$litType$: O } = w, F = typeof O == "number" ? this._$AC(w) : (O.el === void 0 && (O.el = N.createElement(P(O.h, O.h[0]), this.options)), O);
|
|
3835
3807
|
if (this._$AH?._$AD === F) this._$AH.p(D);
|
|
3836
3808
|
else {
|
|
3837
3809
|
const q = new M(F, this), W = q.u(this.options);
|
|
@@ -3845,14 +3817,14 @@ class R {
|
|
|
3845
3817
|
k(w) {
|
|
3846
3818
|
a(this._$AH) || (this._$AH = [], this._$AR());
|
|
3847
3819
|
const D = this._$AH;
|
|
3848
|
-
let
|
|
3849
|
-
for (const q of w) F === D.length ? D.push(
|
|
3850
|
-
F < D.length && (this._$AR(
|
|
3820
|
+
let O, F = 0;
|
|
3821
|
+
for (const q of w) F === D.length ? D.push(O = new R(this.O(l()), this.O(l()), this, this.options)) : O = D[F], O._$AI(q), F++;
|
|
3822
|
+
F < D.length && (this._$AR(O && O._$AB.nextSibling, F), D.length = F);
|
|
3851
3823
|
}
|
|
3852
3824
|
_$AR(w = this._$AA.nextSibling, D) {
|
|
3853
3825
|
for (this._$AP?.(!1, !0, D); w !== this._$AB; ) {
|
|
3854
|
-
const
|
|
3855
|
-
w.remove(), w =
|
|
3826
|
+
const O = w.nextSibling;
|
|
3827
|
+
w.remove(), w = O;
|
|
3856
3828
|
}
|
|
3857
3829
|
}
|
|
3858
3830
|
setConnected(w) {
|
|
@@ -3866,17 +3838,17 @@ class k {
|
|
|
3866
3838
|
get _$AU() {
|
|
3867
3839
|
return this._$AM._$AU;
|
|
3868
3840
|
}
|
|
3869
|
-
constructor(w, D,
|
|
3870
|
-
this.type = 1, this._$AH = E, this._$AN = void 0, this.element = w, this.name = D, this._$AM = F, this.options = q,
|
|
3841
|
+
constructor(w, D, O, F, q) {
|
|
3842
|
+
this.type = 1, this._$AH = E, this._$AN = void 0, this.element = w, this.name = D, this._$AM = F, this.options = q, O.length > 2 || O[0] !== "" || O[1] !== "" ? (this._$AH = Array(O.length - 1).fill(new String()), this.strings = O) : this._$AH = E;
|
|
3871
3843
|
}
|
|
3872
|
-
_$AI(w, D = this,
|
|
3844
|
+
_$AI(w, D = this, O, F) {
|
|
3873
3845
|
const q = this.strings;
|
|
3874
3846
|
let W = !1;
|
|
3875
3847
|
if (q === void 0) w = S(this, w, D, 0), W = !c(w) || w !== this._$AH && w !== T, W && (this._$AH = w);
|
|
3876
3848
|
else {
|
|
3877
|
-
const
|
|
3849
|
+
const Y = w;
|
|
3878
3850
|
let G, K;
|
|
3879
|
-
for (w = q[0], G = 0; G < q.length - 1; G++) K = S(this,
|
|
3851
|
+
for (w = q[0], G = 0; G < q.length - 1; G++) K = S(this, Y[O + G], D, G), K === T && (K = this._$AH[G]), W ||= !c(K) || K !== this._$AH[G], K === E ? w = E : w !== E && (w += (K ?? "") + q[G + 1]), this._$AH[G] = K;
|
|
3880
3852
|
}
|
|
3881
3853
|
W && !F && this.j(w);
|
|
3882
3854
|
}
|
|
@@ -3901,21 +3873,21 @@ class I extends k {
|
|
|
3901
3873
|
}
|
|
3902
3874
|
}
|
|
3903
3875
|
class L extends k {
|
|
3904
|
-
constructor(w, D,
|
|
3905
|
-
super(w, D,
|
|
3876
|
+
constructor(w, D, O, F, q) {
|
|
3877
|
+
super(w, D, O, F, q), this.type = 5;
|
|
3906
3878
|
}
|
|
3907
3879
|
_$AI(w, D = this) {
|
|
3908
3880
|
if ((w = S(this, w, D, 0) ?? E) === T) return;
|
|
3909
|
-
const
|
|
3910
|
-
F && this.element.removeEventListener(this.name, this,
|
|
3881
|
+
const O = this._$AH, F = w === E && O !== E || w.capture !== O.capture || w.once !== O.once || w.passive !== O.passive, q = w !== E && (O === E || F);
|
|
3882
|
+
F && this.element.removeEventListener(this.name, this, O), q && this.element.addEventListener(this.name, this, w), this._$AH = w;
|
|
3911
3883
|
}
|
|
3912
3884
|
handleEvent(w) {
|
|
3913
3885
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, w) : this._$AH.handleEvent(w);
|
|
3914
3886
|
}
|
|
3915
3887
|
}
|
|
3916
3888
|
class z {
|
|
3917
|
-
constructor(w, D,
|
|
3918
|
-
this.element = w, this.type = 6, this._$AN = void 0, this._$AM = D, this.options =
|
|
3889
|
+
constructor(w, D, O) {
|
|
3890
|
+
this.element = w, this.type = 6, this._$AN = void 0, this._$AM = D, this.options = O;
|
|
3919
3891
|
}
|
|
3920
3892
|
get _$AU() {
|
|
3921
3893
|
return this._$AM._$AU;
|
|
@@ -3926,14 +3898,14 @@ class z {
|
|
|
3926
3898
|
}
|
|
3927
3899
|
const j = t.litHtmlPolyfillSupport;
|
|
3928
3900
|
j?.(N, R), (t.litHtmlVersions ??= []).push("3.3.1");
|
|
3929
|
-
const B = (
|
|
3930
|
-
const
|
|
3931
|
-
let F =
|
|
3901
|
+
const B = (U, w, D) => {
|
|
3902
|
+
const O = D?.renderBefore ?? w;
|
|
3903
|
+
let F = O._$litPart$;
|
|
3932
3904
|
if (F === void 0) {
|
|
3933
3905
|
const q = D?.renderBefore ?? null;
|
|
3934
|
-
|
|
3906
|
+
O._$litPart$ = F = new R(w.insertBefore(l(), q), q, void 0, D ?? {});
|
|
3935
3907
|
}
|
|
3936
|
-
return F._$AI(
|
|
3908
|
+
return F._$AI(U), F;
|
|
3937
3909
|
};
|
|
3938
3910
|
/**
|
|
3939
3911
|
* @license
|
|
@@ -3994,7 +3966,7 @@ class ZooTag extends i {
|
|
|
3994
3966
|
}
|
|
3995
3967
|
`;
|
|
3996
3968
|
render() {
|
|
3997
|
-
const w = this.prefix ?? "", D = this.token ?? "default",
|
|
3969
|
+
const w = this.prefix ?? "", D = this.token ?? "default", O = this.postfix ?? "", F = `${w}${D}${O}`;
|
|
3998
3970
|
return x`
|
|
3999
3971
|
<span
|
|
4000
3972
|
class="tag"
|
|
@@ -4009,19 +3981,171 @@ class ZooTag extends i {
|
|
|
4009
3981
|
}
|
|
4010
3982
|
}
|
|
4011
3983
|
customElements.get("zoo-tag") || customElements.define("zoo-tag", ZooTag);
|
|
3984
|
+
const formatRelativeTime = (U) => {
|
|
3985
|
+
const D = Math.floor((/* @__PURE__ */ new Date() - U) / 1e3), O = [
|
|
3986
|
+
{ name: "year", seconds: 31536e3 },
|
|
3987
|
+
{ name: "month", seconds: 2592e3 },
|
|
3988
|
+
{ name: "week", seconds: 604800 },
|
|
3989
|
+
{ name: "day", seconds: 86400 },
|
|
3990
|
+
{ name: "hour", seconds: 3600 },
|
|
3991
|
+
{ name: "minute", seconds: 60 },
|
|
3992
|
+
{ name: "second", seconds: 1 }
|
|
3993
|
+
];
|
|
3994
|
+
if (D < 0) {
|
|
3995
|
+
const F = Math.abs(D);
|
|
3996
|
+
for (const q of O) {
|
|
3997
|
+
const W = Math.floor(F / q.seconds);
|
|
3998
|
+
if (W >= 1)
|
|
3999
|
+
return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(W, q.name);
|
|
4000
|
+
}
|
|
4001
|
+
return "just now";
|
|
4002
|
+
}
|
|
4003
|
+
for (const F of O) {
|
|
4004
|
+
const q = Math.floor(D / F.seconds);
|
|
4005
|
+
if (q >= 1)
|
|
4006
|
+
return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-q, F.name);
|
|
4007
|
+
}
|
|
4008
|
+
return "just now";
|
|
4009
|
+
}, formatDatetime = (U) => {
|
|
4010
|
+
const w = new Intl.DateTimeFormat("en", {
|
|
4011
|
+
day: "2-digit",
|
|
4012
|
+
month: "short",
|
|
4013
|
+
year: "2-digit",
|
|
4014
|
+
hour: "2-digit",
|
|
4015
|
+
minute: "2-digit",
|
|
4016
|
+
second: "2-digit",
|
|
4017
|
+
hourCycle: "h23"
|
|
4018
|
+
}), [{ value: D }, , { value: O }, , { value: F }, , { value: q }, , { value: W }, , { value: Y }] = w.formatToParts(U);
|
|
4019
|
+
return `${O} ${D} ${F} ${q}:${W}:${Y}`;
|
|
4020
|
+
}, formatDate = (U) => {
|
|
4021
|
+
const w = new Intl.DateTimeFormat("en", {
|
|
4022
|
+
day: "2-digit",
|
|
4023
|
+
month: "short",
|
|
4024
|
+
year: "2-digit"
|
|
4025
|
+
}), [{ value: D }, , { value: O }, , { value: F }] = w.formatToParts(U);
|
|
4026
|
+
return `${O} ${D} ${F}`;
|
|
4027
|
+
};
|
|
4028
|
+
class ZooTimestamp extends i {
|
|
4029
|
+
static properties = {
|
|
4030
|
+
timestamp: { type: Number },
|
|
4031
|
+
kind: { type: String },
|
|
4032
|
+
concat: { type: String }
|
|
4033
|
+
};
|
|
4034
|
+
static styles = i$3`
|
|
4035
|
+
:host {
|
|
4036
|
+
display: inline;
|
|
4037
|
+
}
|
|
4038
|
+
|
|
4039
|
+
.relative {
|
|
4040
|
+
color: var(--zoo-timestamp-relative-color, inherit);
|
|
4041
|
+
font-weight: var(--zoo-timestamp-relative-weight, inherit);
|
|
4042
|
+
font-size: var(--zoo-timestamp-relative-size, inherit);
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
.static {
|
|
4046
|
+
color: var(--zoo-timestamp-static-color, inherit);
|
|
4047
|
+
font-weight: var(--zoo-timestamp-static-weight, inherit);
|
|
4048
|
+
font-size: var(--zoo-timestamp-static-size, inherit);
|
|
4049
|
+
}
|
|
4050
|
+
|
|
4051
|
+
.separator {
|
|
4052
|
+
color: var(--zoo-timestamp-separator-color, inherit);
|
|
4053
|
+
}
|
|
4054
|
+
`;
|
|
4055
|
+
constructor() {
|
|
4056
|
+
super(), this.timestamp = Date.now(), this.kind = "both", this.concat = "r (s)", this._boundTickHandler = this._onTimeTick.bind(this), this._isListening = !1;
|
|
4057
|
+
}
|
|
4058
|
+
/**
|
|
4059
|
+
* Determines if the current kind requires listening to time ticks
|
|
4060
|
+
* @returns {boolean}
|
|
4061
|
+
*/
|
|
4062
|
+
_shouldListenToTicks() {
|
|
4063
|
+
return this.kind === "relative" || this.kind === "both";
|
|
4064
|
+
}
|
|
4065
|
+
connectedCallback() {
|
|
4066
|
+
super.connectedCallback(), this._updateTickListener();
|
|
4067
|
+
}
|
|
4068
|
+
disconnectedCallback() {
|
|
4069
|
+
this._removeTickListener(), super.disconnectedCallback();
|
|
4070
|
+
}
|
|
4071
|
+
updated(w) {
|
|
4072
|
+
super.updated(w), w.has("kind") && this._updateTickListener();
|
|
4073
|
+
}
|
|
4074
|
+
/**
|
|
4075
|
+
* Add or remove tick listener based on kind
|
|
4076
|
+
*/
|
|
4077
|
+
_updateTickListener() {
|
|
4078
|
+
const w = this._shouldListenToTicks();
|
|
4079
|
+
w && !this._isListening ? (document.addEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !0) : !w && this._isListening && this._removeTickListener();
|
|
4080
|
+
}
|
|
4081
|
+
/**
|
|
4082
|
+
* Remove tick listener
|
|
4083
|
+
*/
|
|
4084
|
+
_removeTickListener() {
|
|
4085
|
+
this._isListening && (document.removeEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !1);
|
|
4086
|
+
}
|
|
4087
|
+
_onTimeTick() {
|
|
4088
|
+
this.requestUpdate();
|
|
4089
|
+
}
|
|
4090
|
+
/**
|
|
4091
|
+
* Parses the concat template and splits it into parts
|
|
4092
|
+
* @param {string} template - Template string with 'r' and 's' placeholders
|
|
4093
|
+
* @returns {Array} Array of objects with {type: 'text'|'relative'|'static', value: string}
|
|
4094
|
+
*/
|
|
4095
|
+
_parseTemplate(w) {
|
|
4096
|
+
const D = [];
|
|
4097
|
+
let O = w;
|
|
4098
|
+
for (; O.length > 0; ) {
|
|
4099
|
+
const F = O.indexOf("r"), q = O.indexOf("s"), W = [F, q].filter((Y) => Y !== -1).sort((Y, G) => Y - G)[0];
|
|
4100
|
+
if (W === void 0) {
|
|
4101
|
+
O.length > 0 && D.push({ type: "text", value: O });
|
|
4102
|
+
break;
|
|
4103
|
+
}
|
|
4104
|
+
W > 0 && D.push({ type: "text", value: O.substring(0, W) }), W === F ? D.push({ type: "relative", value: "" }) : D.push({ type: "static", value: "" }), O = O.substring(W + 1);
|
|
4105
|
+
}
|
|
4106
|
+
return D;
|
|
4107
|
+
}
|
|
4108
|
+
_getFormattedParts() {
|
|
4109
|
+
let w = this.timestamp;
|
|
4110
|
+
w < 9466848e5 && (w = w * 1e3);
|
|
4111
|
+
const D = new Date(w), O = formatRelativeTime(D), F = formatDatetime(D), q = formatDate(D);
|
|
4112
|
+
switch (this.kind) {
|
|
4113
|
+
case "relative":
|
|
4114
|
+
return [{ type: "relative", value: O }];
|
|
4115
|
+
case "datetime":
|
|
4116
|
+
return [{ type: "static", value: F }];
|
|
4117
|
+
case "date":
|
|
4118
|
+
return [{ type: "static", value: q }];
|
|
4119
|
+
case "both":
|
|
4120
|
+
return this._parseTemplate(this.concat).map((G) => G.type === "relative" ? { type: "relative", value: O } : G.type === "static" ? { type: "static", value: F } : G);
|
|
4121
|
+
default:
|
|
4122
|
+
return this._parseTemplate(this.concat).map((G) => G.type === "relative" ? { type: "relative", value: O } : G.type === "static" ? { type: "static", value: F } : G);
|
|
4123
|
+
}
|
|
4124
|
+
}
|
|
4125
|
+
render() {
|
|
4126
|
+
let w = this.timestamp;
|
|
4127
|
+
w < 9466848e5 && (w = w * 1e3);
|
|
4128
|
+
const D = new Date(w), O = this._getFormattedParts();
|
|
4129
|
+
return x`<time datetime="${D.toISOString()}">
|
|
4130
|
+
${O.map((F) => F.type === "relative" ? x`<span class="relative">${F.value}</span>` : F.type === "static" ? x`<span class="static">${F.value}</span>` : x`<span class="separator">${F.value}</span>`)}
|
|
4131
|
+
</time>`;
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
customElements.get("zoo-timestamp") || customElements.define("zoo-timestamp", ZooTimestamp);
|
|
4012
4135
|
const zoo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4013
4136
|
__proto__: null,
|
|
4014
4137
|
ZooTag,
|
|
4138
|
+
ZooTimestamp,
|
|
4015
4139
|
getEventAttribute,
|
|
4016
4140
|
getSemanticAttributes
|
|
4017
4141
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4018
|
-
async function registerCarbonLibrary() {
|
|
4019
|
-
const { registerCarbonLibrary:
|
|
4020
|
-
return
|
|
4142
|
+
async function registerCarbonLibrary(U = {}) {
|
|
4143
|
+
const { registerCarbonLibrary: w } = await import("./register-DgYdd65A.js");
|
|
4144
|
+
return w(U);
|
|
4021
4145
|
}
|
|
4022
4146
|
async function registerMdcLibrary() {
|
|
4023
|
-
const { registerMdcLibrary:
|
|
4024
|
-
return
|
|
4147
|
+
const { registerMdcLibrary: U } = await import("./register-bMHOSpvM.js");
|
|
4148
|
+
return U();
|
|
4025
4149
|
}
|
|
4026
4150
|
const zooy = {
|
|
4027
4151
|
Evt,
|