pennsieve-dashboard 0.3.1 → 0.3.2
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/pennsieve-dashboard.es.js +1069 -1055
- package/dist/pennsieve-dashboard.umd.js +29 -29
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,171 +1,171 @@
|
|
|
1
1
|
var Bs = Object.defineProperty;
|
|
2
2
|
var Fs = (o, e, t) => e in o ? Bs(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { defineStore as Ks, storeToRefs as
|
|
6
|
-
import { ElTag as Qs, ElTooltip as
|
|
3
|
+
var B = (o, e, t) => Fs(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { defineComponent as ce, createElementBlock as M, openBlock as E, createElementVNode as D, ref as $, reactive as ei, isRef as Us, isReactive as Ws, markRaw as Gs, computed as de, watch as pe, resolveComponent as se, createBlock as te, withCtx as W, createVNode as G, Fragment as Ae, renderList as Ge, unref as K, createTextVNode as ze, inject as Vs, shallowRef as as, resolveDirective as hs, renderSlot as Et, mergeProps as ai, withDirectives as Ne, toDisplayString as we, withKeys as us, vShow as Tt, vModelText as qs, createCommentVNode as We, toRaw as js, onMounted as cs, onBeforeUnmount as ds, normalizeClass as ps, resolveDynamicComponent as Gi, onBeforeMount as Ys, provide as Xs, defineAsyncComponent as Zs, nextTick as Vi } from "vue";
|
|
5
|
+
import { defineStore as Ks, storeToRefs as ti } from "pinia";
|
|
6
|
+
import { ElTag as Qs, ElTooltip as ii } from "element-plus";
|
|
7
7
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
8
|
-
var Js = /* @__PURE__ */
|
|
8
|
+
var Js = /* @__PURE__ */ ce({
|
|
9
9
|
name: "CircleCloseFilled",
|
|
10
10
|
__name: "circle-close-filled",
|
|
11
11
|
setup(o) {
|
|
12
|
-
return (e, t) => (
|
|
12
|
+
return (e, t) => (E(), M("svg", {
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
viewBox: "0 0 1024 1024"
|
|
15
15
|
}, [
|
|
16
|
-
|
|
16
|
+
D("path", {
|
|
17
17
|
fill: "currentColor",
|
|
18
18
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"
|
|
19
19
|
})
|
|
20
20
|
]));
|
|
21
21
|
}
|
|
22
|
-
}), er = Js, tr = /* @__PURE__ */
|
|
22
|
+
}), er = Js, tr = /* @__PURE__ */ ce({
|
|
23
23
|
name: "Close",
|
|
24
24
|
__name: "close",
|
|
25
25
|
setup(o) {
|
|
26
|
-
return (e, t) => (
|
|
26
|
+
return (e, t) => (E(), M("svg", {
|
|
27
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
28
|
viewBox: "0 0 1024 1024"
|
|
29
29
|
}, [
|
|
30
|
-
|
|
30
|
+
D("path", {
|
|
31
31
|
fill: "currentColor",
|
|
32
32
|
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
33
33
|
})
|
|
34
34
|
]));
|
|
35
35
|
}
|
|
36
|
-
}), ir = tr, sr = /* @__PURE__ */
|
|
36
|
+
}), ir = tr, sr = /* @__PURE__ */ ce({
|
|
37
37
|
name: "Edit",
|
|
38
38
|
__name: "edit",
|
|
39
39
|
setup(o) {
|
|
40
|
-
return (e, t) => (
|
|
40
|
+
return (e, t) => (E(), M("svg", {
|
|
41
41
|
xmlns: "http://www.w3.org/2000/svg",
|
|
42
42
|
viewBox: "0 0 1024 1024"
|
|
43
43
|
}, [
|
|
44
|
-
|
|
44
|
+
D("path", {
|
|
45
45
|
fill: "currentColor",
|
|
46
46
|
d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"
|
|
47
47
|
}),
|
|
48
|
-
|
|
48
|
+
D("path", {
|
|
49
49
|
fill: "currentColor",
|
|
50
50
|
d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
|
|
51
51
|
})
|
|
52
52
|
]));
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), fs = sr, rr = /* @__PURE__ */ ce({
|
|
55
55
|
name: "FullScreen",
|
|
56
56
|
__name: "full-screen",
|
|
57
57
|
setup(o) {
|
|
58
|
-
return (e, t) => (
|
|
58
|
+
return (e, t) => (E(), M("svg", {
|
|
59
59
|
xmlns: "http://www.w3.org/2000/svg",
|
|
60
60
|
viewBox: "0 0 1024 1024"
|
|
61
61
|
}, [
|
|
62
|
-
|
|
62
|
+
D("path", {
|
|
63
63
|
fill: "currentColor",
|
|
64
64
|
d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
|
|
65
65
|
})
|
|
66
66
|
]));
|
|
67
67
|
}
|
|
68
|
-
}), nr = rr, or = /* @__PURE__ */
|
|
68
|
+
}), nr = rr, or = /* @__PURE__ */ ce({
|
|
69
69
|
name: "Lock",
|
|
70
70
|
__name: "lock",
|
|
71
71
|
setup(o) {
|
|
72
|
-
return (e, t) => (
|
|
72
|
+
return (e, t) => (E(), M("svg", {
|
|
73
73
|
xmlns: "http://www.w3.org/2000/svg",
|
|
74
74
|
viewBox: "0 0 1024 1024"
|
|
75
75
|
}, [
|
|
76
|
-
|
|
76
|
+
D("path", {
|
|
77
77
|
fill: "currentColor",
|
|
78
78
|
d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
|
|
79
79
|
}),
|
|
80
|
-
|
|
80
|
+
D("path", {
|
|
81
81
|
fill: "currentColor",
|
|
82
82
|
d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"
|
|
83
83
|
})
|
|
84
84
|
]));
|
|
85
85
|
}
|
|
86
|
-
}), lr = or, ar = /* @__PURE__ */
|
|
86
|
+
}), lr = or, ar = /* @__PURE__ */ ce({
|
|
87
87
|
name: "ScaleToOriginal",
|
|
88
88
|
__name: "scale-to-original",
|
|
89
89
|
setup(o) {
|
|
90
|
-
return (e, t) => (
|
|
90
|
+
return (e, t) => (E(), M("svg", {
|
|
91
91
|
xmlns: "http://www.w3.org/2000/svg",
|
|
92
92
|
viewBox: "0 0 1024 1024"
|
|
93
93
|
}, [
|
|
94
|
-
|
|
94
|
+
D("path", {
|
|
95
95
|
fill: "currentColor",
|
|
96
96
|
d: "M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512"
|
|
97
97
|
})
|
|
98
98
|
]));
|
|
99
99
|
}
|
|
100
|
-
}), hr = ar, ur = /* @__PURE__ */
|
|
100
|
+
}), hr = ar, ur = /* @__PURE__ */ ce({
|
|
101
101
|
name: "Unlock",
|
|
102
102
|
__name: "unlock",
|
|
103
103
|
setup(o) {
|
|
104
|
-
return (e, t) => (
|
|
104
|
+
return (e, t) => (E(), M("svg", {
|
|
105
105
|
xmlns: "http://www.w3.org/2000/svg",
|
|
106
106
|
viewBox: "0 0 1024 1024"
|
|
107
107
|
}, [
|
|
108
|
-
|
|
108
|
+
D("path", {
|
|
109
109
|
fill: "currentColor",
|
|
110
110
|
d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
|
|
111
111
|
}),
|
|
112
|
-
|
|
112
|
+
D("path", {
|
|
113
113
|
fill: "currentColor",
|
|
114
114
|
d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"
|
|
115
115
|
})
|
|
116
116
|
]));
|
|
117
117
|
}
|
|
118
118
|
}), cr = ur;
|
|
119
|
-
const
|
|
120
|
-
const o =
|
|
121
|
-
function u(
|
|
122
|
-
l[
|
|
119
|
+
const lt = Ks("globalPensieveDashVars", () => {
|
|
120
|
+
const o = $([]), e = $({}), t = "dashboard-globalVarsStore", i = $([]), s = $([]), r = $({}), l = ei({}), n = ei({});
|
|
121
|
+
function u(g, m, F = !1) {
|
|
122
|
+
l[g] = m, n[g] = F;
|
|
123
123
|
}
|
|
124
|
-
function a(
|
|
125
|
-
for (const
|
|
126
|
-
Object.assign(l,
|
|
124
|
+
function a(g = {}) {
|
|
125
|
+
for (const m of Object.keys(l)) delete l[m];
|
|
126
|
+
Object.assign(l, g);
|
|
127
127
|
}
|
|
128
|
-
const h = (
|
|
129
|
-
delete l[
|
|
128
|
+
const h = (g) => {
|
|
129
|
+
delete l[g];
|
|
130
130
|
};
|
|
131
131
|
function p() {
|
|
132
|
-
for (const
|
|
132
|
+
for (const g of Object.keys(l)) delete l[g];
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function c() {
|
|
135
135
|
s.value = [...o.value], a({});
|
|
136
136
|
}
|
|
137
|
-
const
|
|
138
|
-
i.value.push({ name:
|
|
139
|
-
},
|
|
137
|
+
const y = (g) => s.value.find((m) => m.id === g), v = (g, m) => {
|
|
138
|
+
i.value.push({ name: g, value: m });
|
|
139
|
+
}, R = () => {
|
|
140
140
|
i.value = [];
|
|
141
|
-
},
|
|
142
|
-
r.value =
|
|
141
|
+
}, N = (g) => {
|
|
142
|
+
r.value = S(g);
|
|
143
143
|
}, x = () => r.value;
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
147
|
-
for (const [
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
|
|
144
|
+
function S(g) {
|
|
145
|
+
const m = {};
|
|
146
|
+
if (!g || typeof g != "object") return m;
|
|
147
|
+
for (const [F, z] of Object.entries(g))
|
|
148
|
+
if (z && typeof z == "object" && !(Us(z) || Ws(z))) {
|
|
149
|
+
const he = Object.getPrototypeOf(z) === Object.prototype;
|
|
150
|
+
m[F] = he ? { ...z } : Gs(z);
|
|
151
151
|
} else
|
|
152
|
-
|
|
153
|
-
return
|
|
154
|
-
}
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
const
|
|
160
|
-
return
|
|
161
|
-
...
|
|
162
|
-
component:
|
|
152
|
+
m[F] = z;
|
|
153
|
+
return m;
|
|
154
|
+
}
|
|
155
|
+
const C = (g) => {
|
|
156
|
+
const m = s.value.find((F) => F.id === g);
|
|
157
|
+
m && (m.Props = m.Props || {}, m.Props.locked = !m.Props.locked);
|
|
158
|
+
}, T = (g) => g.map((m) => {
|
|
159
|
+
const F = e.value[m.componentKey];
|
|
160
|
+
return F ? {
|
|
161
|
+
...m,
|
|
162
|
+
component: F
|
|
163
163
|
// attach runtime component
|
|
164
164
|
} : null;
|
|
165
|
-
}).filter((
|
|
166
|
-
function
|
|
165
|
+
}).filter((m) => !!m);
|
|
166
|
+
function I(g) {
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Q() {
|
|
169
169
|
}
|
|
170
170
|
return {
|
|
171
171
|
DASHBOARD_ITEMS: s,
|
|
@@ -175,35 +175,35 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
175
175
|
Services: r,
|
|
176
176
|
Filters: l,
|
|
177
177
|
displayFilters: n,
|
|
178
|
-
registerGridProvider:
|
|
179
|
-
unregisterGridProvider:
|
|
178
|
+
registerGridProvider: I,
|
|
179
|
+
unregisterGridProvider: Q,
|
|
180
180
|
setFilter: u,
|
|
181
181
|
clearFilter: h,
|
|
182
182
|
clearAllFilters: p,
|
|
183
183
|
resetFilters: a,
|
|
184
|
-
resetGridLayout:
|
|
185
|
-
getDashItem:
|
|
186
|
-
toggleWidgetLock:
|
|
184
|
+
resetGridLayout: c,
|
|
185
|
+
getDashItem: y,
|
|
186
|
+
toggleWidgetLock: C,
|
|
187
187
|
addOptionsDataItems: v,
|
|
188
|
-
clearOptionsDataItems:
|
|
188
|
+
clearOptionsDataItems: R,
|
|
189
189
|
//saveToLocalStorage,
|
|
190
190
|
loadFromLocalStorage: () => {
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
193
|
-
|
|
191
|
+
const g = localStorage.getItem(t);
|
|
192
|
+
if (!g) {
|
|
193
|
+
c();
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
try {
|
|
197
|
-
const
|
|
198
|
-
s.value = Array.isArray(
|
|
199
|
-
} catch (
|
|
200
|
-
console.error("Failed to parse globalVarsStore:",
|
|
197
|
+
const m = JSON.parse(g);
|
|
198
|
+
s.value = Array.isArray(m.items) ? T(m.items) : [...o.value], a(m.filters ?? {});
|
|
199
|
+
} catch (m) {
|
|
200
|
+
console.error("Failed to parse globalVarsStore:", m), s.value = [...o.value], a({});
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
|
-
setOptionServices:
|
|
203
|
+
setOptionServices: N,
|
|
204
204
|
getServices: x
|
|
205
205
|
};
|
|
206
|
-
}), dr = { class: "widget-settings-container" }, pr = { class: "widget-setting" }, fr = { class: "dialog-footer" }, gr = /* @__PURE__ */
|
|
206
|
+
}), dr = { class: "widget-settings-container" }, pr = { class: "widget-setting" }, fr = { class: "dialog-footer" }, gr = /* @__PURE__ */ ce({
|
|
207
207
|
__name: "TextWidgetSettings",
|
|
208
208
|
props: {
|
|
209
209
|
showDialog: { type: Boolean },
|
|
@@ -213,89 +213,89 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
213
213
|
},
|
|
214
214
|
emits: ["close-dialog", "update-text-var"],
|
|
215
215
|
setup(o, { emit: e }) {
|
|
216
|
-
const t =
|
|
216
|
+
const t = lt(), { optionsData: i } = ti(t), s = e, r = o, l = de({
|
|
217
217
|
get: () => r.showDialog,
|
|
218
218
|
set: (p) => {
|
|
219
219
|
p || s("close-dialog");
|
|
220
220
|
}
|
|
221
|
-
}), n =
|
|
222
|
-
|
|
221
|
+
}), n = $(r.reactiveSourceValue ?? ""), u = $(r.manualEntryValue ?? ""), a = $(!!r.hideHeaderValue);
|
|
222
|
+
pe(() => r.reactiveSourceValue, (p) => {
|
|
223
223
|
n.value = p ?? "";
|
|
224
|
-
}),
|
|
224
|
+
}), pe(() => r.manualEntryValue, (p) => {
|
|
225
225
|
u.value = p ?? "";
|
|
226
|
-
}, { immediate: !0 }),
|
|
226
|
+
}, { immediate: !0 }), pe(() => r.hideHeaderValue, (p) => {
|
|
227
227
|
a.value = !!p;
|
|
228
228
|
});
|
|
229
229
|
function h() {
|
|
230
230
|
var v;
|
|
231
|
-
const p = (n.value || "").trim(),
|
|
231
|
+
const p = (n.value || "").trim(), c = p !== "", y = c ? null : ((v = u.value) == null ? void 0 : v.trim()) || "";
|
|
232
232
|
s("update-text-var", {
|
|
233
|
-
reactiveSource:
|
|
234
|
-
manualEdit:
|
|
233
|
+
reactiveSource: c ? p : null,
|
|
234
|
+
manualEdit: y,
|
|
235
235
|
hideHeader: a.value
|
|
236
236
|
}), l.value = !1;
|
|
237
237
|
}
|
|
238
|
-
return (p,
|
|
239
|
-
const
|
|
240
|
-
return
|
|
238
|
+
return (p, c) => {
|
|
239
|
+
const y = se("el-option"), v = se("el-select"), R = se("el-input"), N = se("el-checkbox"), x = se("el-button"), S = se("el-dialog");
|
|
240
|
+
return E(), te(S, {
|
|
241
241
|
class: "full-dialog-dashboard",
|
|
242
242
|
modelValue: l.value,
|
|
243
|
-
"onUpdate:modelValue":
|
|
243
|
+
"onUpdate:modelValue": c[4] || (c[4] = (C) => l.value = C),
|
|
244
244
|
title: "Text Widget Settings",
|
|
245
245
|
"append-to-body": !0
|
|
246
246
|
}, {
|
|
247
|
-
footer:
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
footer: W(() => [
|
|
248
|
+
D("div", fr, [
|
|
249
|
+
G(x, {
|
|
250
250
|
class: "secondary",
|
|
251
|
-
onClick:
|
|
251
|
+
onClick: c[3] || (c[3] = (C) => l.value = !1)
|
|
252
252
|
}, {
|
|
253
|
-
default:
|
|
254
|
-
|
|
253
|
+
default: W(() => [...c[8] || (c[8] = [
|
|
254
|
+
ze("Cancel", -1)
|
|
255
255
|
])]),
|
|
256
256
|
_: 1
|
|
257
257
|
}),
|
|
258
|
-
|
|
259
|
-
default:
|
|
260
|
-
|
|
258
|
+
G(x, { onClick: h }, {
|
|
259
|
+
default: W(() => [...c[9] || (c[9] = [
|
|
260
|
+
ze("Save", -1)
|
|
261
261
|
])]),
|
|
262
262
|
_: 1
|
|
263
263
|
})
|
|
264
264
|
])
|
|
265
265
|
]),
|
|
266
|
-
default:
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
266
|
+
default: W(() => [
|
|
267
|
+
D("div", dr, [
|
|
268
|
+
D("div", pr, [
|
|
269
|
+
c[5] || (c[5] = D("h4", null, "Select This Widget's Value", -1)),
|
|
270
|
+
c[6] || (c[6] = D("h5", null, "Select From Variables", -1)),
|
|
271
|
+
G(v, {
|
|
272
272
|
modelValue: n.value,
|
|
273
|
-
"onUpdate:modelValue":
|
|
273
|
+
"onUpdate:modelValue": c[0] || (c[0] = (C) => n.value = C),
|
|
274
274
|
class: "text-settings-height"
|
|
275
275
|
}, {
|
|
276
|
-
default:
|
|
277
|
-
(
|
|
276
|
+
default: W(() => [
|
|
277
|
+
(E(), te(y, {
|
|
278
278
|
value: "",
|
|
279
279
|
key: "__manual__",
|
|
280
280
|
label: "Manual entry"
|
|
281
281
|
})),
|
|
282
|
-
(
|
|
283
|
-
key:
|
|
284
|
-
label:
|
|
285
|
-
value:
|
|
282
|
+
(E(!0), M(Ae, null, Ge(K(i), (C) => (E(), te(y, {
|
|
283
|
+
key: C.name,
|
|
284
|
+
label: C.name,
|
|
285
|
+
value: C.name
|
|
286
286
|
}, null, 8, ["label", "value"]))), 128))
|
|
287
287
|
]),
|
|
288
288
|
_: 1
|
|
289
289
|
}, 8, ["modelValue"]),
|
|
290
|
-
|
|
291
|
-
|
|
290
|
+
c[7] || (c[7] = D("h5", null, "Manual Entry", -1)),
|
|
291
|
+
G(R, {
|
|
292
292
|
modelValue: u.value,
|
|
293
|
-
"onUpdate:modelValue":
|
|
293
|
+
"onUpdate:modelValue": c[1] || (c[1] = (C) => u.value = C),
|
|
294
294
|
class: "text-settings-height"
|
|
295
295
|
}, null, 8, ["modelValue"]),
|
|
296
|
-
|
|
296
|
+
G(N, {
|
|
297
297
|
modelValue: a.value,
|
|
298
|
-
"onUpdate:modelValue":
|
|
298
|
+
"onUpdate:modelValue": c[2] || (c[2] = (C) => a.value = C),
|
|
299
299
|
label: "Hide Header"
|
|
300
300
|
}, null, 8, ["modelValue"])
|
|
301
301
|
])
|
|
@@ -305,12 +305,12 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
305
305
|
}, 8, ["modelValue"]);
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
|
-
}),
|
|
308
|
+
}), De = (o, e) => {
|
|
309
309
|
const t = o.__vccOpts || o;
|
|
310
310
|
for (const [i, s] of e)
|
|
311
311
|
t[i] = s;
|
|
312
312
|
return t;
|
|
313
|
-
}, mr = /* @__PURE__ */
|
|
313
|
+
}, mr = /* @__PURE__ */ De(gr, [["__scopeId", "data-v-769ea864"]]), _r = { key: 0 }, yr = /* @__PURE__ */ ce({
|
|
314
314
|
inheritAttrs: !1,
|
|
315
315
|
__name: "TextWidget",
|
|
316
316
|
props: {
|
|
@@ -320,137 +320,137 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
320
320
|
hideHeader: { type: Boolean }
|
|
321
321
|
},
|
|
322
322
|
setup(o) {
|
|
323
|
-
const e =
|
|
323
|
+
const e = lt(), t = o;
|
|
324
324
|
Vs("dashboard:globalVars", null);
|
|
325
|
-
const i =
|
|
326
|
-
|
|
325
|
+
const i = $(t.displayText ?? "");
|
|
326
|
+
pe(() => t.displayText, (x) => {
|
|
327
327
|
i.value = x ?? "";
|
|
328
328
|
}, { immediate: !0 });
|
|
329
|
-
const s =
|
|
330
|
-
var
|
|
331
|
-
const x = (
|
|
329
|
+
const s = de(() => !!(t.bindedKey && t.bindedKey.trim() !== "")), r = de(() => {
|
|
330
|
+
var T;
|
|
331
|
+
const x = (T = t.bindedKey) == null ? void 0 : T.trim();
|
|
332
332
|
if (!x) return "—";
|
|
333
|
-
const
|
|
334
|
-
return Array.isArray(
|
|
335
|
-
}), l =
|
|
333
|
+
const S = e.optionsData.find((I) => (I == null ? void 0 : I.name) === x), C = S == null ? void 0 : S.value;
|
|
334
|
+
return Array.isArray(C) ? C.join(", ") : C && typeof C == "object" ? JSON.stringify(C) : C ?? "—";
|
|
335
|
+
}), l = $("Text Widget"), n = as([{ comp: fs, event: y, tooltip: "open Text settings" }]), u = $(!1), a = $(null);
|
|
336
336
|
function h() {
|
|
337
|
-
var x,
|
|
338
|
-
u.value = !0, (
|
|
337
|
+
var x, S;
|
|
338
|
+
u.value = !0, (S = (x = a.value) == null ? void 0 : x.focus) == null || S.call(x);
|
|
339
339
|
}
|
|
340
340
|
function p() {
|
|
341
341
|
u.value = !1;
|
|
342
342
|
}
|
|
343
|
-
const
|
|
344
|
-
function
|
|
345
|
-
|
|
343
|
+
const c = $(!1);
|
|
344
|
+
function y() {
|
|
345
|
+
c.value = !0;
|
|
346
346
|
}
|
|
347
347
|
function v() {
|
|
348
|
-
|
|
348
|
+
c.value = !1;
|
|
349
349
|
}
|
|
350
|
-
function
|
|
351
|
-
const
|
|
352
|
-
|
|
350
|
+
function R({ manualEdit: x, reactiveSource: S, hideHeader: C }) {
|
|
351
|
+
const T = e.getDashItem(t.widgetID);
|
|
352
|
+
T && (T.hideHeader = C, S && S.trim() !== "" ? (T.Props = T.Props || {}, T.Props.bindedKey = S, T.Props.displayText = null, T.componentName = N(S)) : (T.Props = T.Props || {}, T.Props.bindedKey = null, T.Props.displayText = x ?? "", T.componentName = x ?? "Text"));
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return x ? x.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, (
|
|
354
|
+
function N(x) {
|
|
355
|
+
return x ? x.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, (S) => S.toUpperCase()) : "";
|
|
356
356
|
}
|
|
357
|
-
return (x,
|
|
358
|
-
const
|
|
359
|
-
return
|
|
360
|
-
|
|
357
|
+
return (x, S) => {
|
|
358
|
+
const C = se("el-input"), T = hs("click-out");
|
|
359
|
+
return E(), M(Ae, null, [
|
|
360
|
+
Et(x.$slots, "default", {
|
|
361
361
|
widgetName: l.value,
|
|
362
362
|
childIcons: n.value
|
|
363
363
|
}, void 0, !0),
|
|
364
|
-
|
|
365
|
-
s.value ? (
|
|
366
|
-
|
|
367
|
-
])) :
|
|
364
|
+
D("div", ai({ class: "text-widget-wrap" }, x.$attrs), [
|
|
365
|
+
s.value ? (E(), M("div", _r, [
|
|
366
|
+
D("h2", null, we(r.value), 1)
|
|
367
|
+
])) : Ne((E(), M("div", {
|
|
368
368
|
key: 1,
|
|
369
|
-
onKeyup:
|
|
369
|
+
onKeyup: us(p, ["enter"]),
|
|
370
370
|
class: "tw-flex"
|
|
371
371
|
}, [
|
|
372
|
-
|
|
373
|
-
|
|
372
|
+
Ne(D("div", null, [
|
|
373
|
+
G(C, {
|
|
374
374
|
ref_key: "textUserInput",
|
|
375
375
|
ref: a,
|
|
376
376
|
modelValue: i.value,
|
|
377
|
-
"onUpdate:modelValue":
|
|
378
|
-
onFocus:
|
|
379
|
-
var
|
|
380
|
-
return (
|
|
377
|
+
"onUpdate:modelValue": S[0] || (S[0] = (I) => i.value = I),
|
|
378
|
+
onFocus: S[1] || (S[1] = (I) => {
|
|
379
|
+
var Q, le;
|
|
380
|
+
return (le = (Q = I.target) == null ? void 0 : Q.select) == null ? void 0 : le.call(Q);
|
|
381
381
|
})
|
|
382
382
|
}, null, 8, ["modelValue"])
|
|
383
383
|
], 512), [
|
|
384
|
-
[
|
|
384
|
+
[Tt, u.value]
|
|
385
385
|
]),
|
|
386
|
-
|
|
387
|
-
onClick:
|
|
386
|
+
Ne(D("div", {
|
|
387
|
+
onClick: S[2] || (S[2] = (I) => h()),
|
|
388
388
|
class: "tw-w-full tw-h-full"
|
|
389
389
|
}, [
|
|
390
|
-
|
|
390
|
+
D("h2", null, we(i.value), 1)
|
|
391
391
|
], 512), [
|
|
392
|
-
[
|
|
392
|
+
[Tt, !u.value]
|
|
393
393
|
])
|
|
394
394
|
], 32)), [
|
|
395
|
-
[
|
|
395
|
+
[T, p]
|
|
396
396
|
])
|
|
397
397
|
], 16),
|
|
398
|
-
|
|
399
|
-
"show-dialog":
|
|
398
|
+
G(mr, {
|
|
399
|
+
"show-dialog": c.value,
|
|
400
400
|
"reactive-source-value": t.bindedKey || "",
|
|
401
401
|
"manual-entry-value": i.value,
|
|
402
402
|
"hide-header-value": t.hideHeader || !1,
|
|
403
403
|
onCloseDialog: v,
|
|
404
|
-
onUpdateTextVar:
|
|
404
|
+
onUpdateTextVar: R
|
|
405
405
|
}, null, 8, ["show-dialog", "reactive-source-value", "manual-entry-value", "hide-header-value"])
|
|
406
406
|
], 64);
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
-
}), _o = /* @__PURE__ */
|
|
410
|
-
function
|
|
409
|
+
}), _o = /* @__PURE__ */ De(yr, [["__scopeId", "data-v-bbd00006"]]);
|
|
410
|
+
function hi() {
|
|
411
411
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
412
412
|
}
|
|
413
|
-
var
|
|
414
|
-
function
|
|
415
|
-
|
|
413
|
+
var He = hi();
|
|
414
|
+
function gs(o) {
|
|
415
|
+
He = o;
|
|
416
416
|
}
|
|
417
|
-
var
|
|
418
|
-
function
|
|
417
|
+
var rt = { exec: () => null };
|
|
418
|
+
function P(o, e = "") {
|
|
419
419
|
let t = typeof o == "string" ? o : o.source, i = { replace: (s, r) => {
|
|
420
420
|
let l = typeof r == "string" ? r : r.source;
|
|
421
|
-
return l = l.replace(
|
|
421
|
+
return l = l.replace(re.caret, "$1"), t = t.replace(s, l), i;
|
|
422
422
|
}, getRegex: () => new RegExp(t, e) };
|
|
423
423
|
return i;
|
|
424
424
|
}
|
|
425
|
-
var
|
|
426
|
-
]`).replace("lheading",
|
|
427
|
-
function
|
|
425
|
+
var re = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (o) => new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}#`), htmlBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}<(?:[a-z].*>|!--)`, "i") }, vr = /^(?:[ \t]*(?:\n|$))+/, br = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, wr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, at = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, xr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ui = /(?:[*+-]|\d{1,9}[.)])/, ms = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, _s = P(ms).replace(/bull/g, ui).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), kr = P(ms).replace(/bull/g, ui).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), ci = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Er = /^[^\n]+/, di = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Tr = P(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", di).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Rr = P(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, ui).getRegex(), Mt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", pi = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Sr = P("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", pi).replace("tag", Mt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ys = P(ci).replace("hr", at).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Mt).getRegex(), Cr = P(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ys).getRegex(), fi = { blockquote: Cr, code: br, def: Tr, fences: wr, heading: xr, hr: at, html: Sr, lheading: _s, list: Rr, newline: vr, paragraph: ys, table: rt, text: Er }, qi = P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", at).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Mt).getRegex(), Ar = { ...fi, lheading: kr, table: qi, paragraph: P(ci).replace("hr", at).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", qi).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Mt).getRegex() }, Dr = { ...fi, html: P(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", pi).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: rt, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: P(ci).replace("hr", at).replace("heading", ` *#{1,6} *[^
|
|
426
|
+
]`).replace("lheading", _s).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Lr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, zr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, vs = /^( {2,}|\\)\n(?!\s*$)/, Nr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ht = /[\p{P}\p{S}]/u, gi = /[\s\p{P}\p{S}]/u, bs = /[^\s\p{P}\p{S}]/u, Mr = P(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, gi).getRegex(), ws = /(?!~)[\p{P}\p{S}]/u, Hr = /(?!~)[\s\p{P}\p{S}]/u, Ir = /(?:[^\s\p{P}\p{S}]|~)/u, Or = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g, xs = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Pr = P(xs, "u").replace(/punct/g, Ht).getRegex(), $r = P(xs, "u").replace(/punct/g, ws).getRegex(), ks = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Br = P(ks, "gu").replace(/notPunctSpace/g, bs).replace(/punctSpace/g, gi).replace(/punct/g, Ht).getRegex(), Fr = P(ks, "gu").replace(/notPunctSpace/g, Ir).replace(/punctSpace/g, Hr).replace(/punct/g, ws).getRegex(), Ur = P("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, bs).replace(/punctSpace/g, gi).replace(/punct/g, Ht).getRegex(), Wr = P(/\\(punct)/, "gu").replace(/punct/g, Ht).getRegex(), Gr = P(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Vr = P(pi).replace("(?:-->|$)", "-->").getRegex(), qr = P("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Vr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Rt = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, jr = P(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Rt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Es = P(/^!?\[(label)\]\[(ref)\]/).replace("label", Rt).replace("ref", di).getRegex(), Ts = P(/^!?\[(ref)\](?:\[\])?/).replace("ref", di).getRegex(), Yr = P("reflink|nolink(?!\\()", "g").replace("reflink", Es).replace("nolink", Ts).getRegex(), mi = { _backpedal: rt, anyPunctuation: Wr, autolink: Gr, blockSkip: Or, br: vs, code: zr, del: rt, emStrongLDelim: Pr, emStrongRDelimAst: Br, emStrongRDelimUnd: Ur, escape: Lr, link: jr, nolink: Ts, punctuation: Mr, reflink: Es, reflinkSearch: Yr, tag: qr, text: Nr, url: rt }, Xr = { ...mi, link: P(/^!?\[(label)\]\((.*?)\)/).replace("label", Rt).getRegex(), reflink: P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Rt).getRegex() }, si = { ...mi, emStrongRDelimAst: Fr, emStrongLDelim: $r, url: P(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ }, Zr = { ...si, br: P(vs).replace("{2,}", "*").getRegex(), text: P(si.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, vt = { normal: fi, gfm: Ar, pedantic: Dr }, Ke = { normal: mi, gfm: si, breaks: Zr, pedantic: Xr }, Kr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ji = (o) => Kr[o];
|
|
427
|
+
function ye(o, e) {
|
|
428
428
|
if (e) {
|
|
429
|
-
if (
|
|
430
|
-
} else if (
|
|
429
|
+
if (re.escapeTest.test(o)) return o.replace(re.escapeReplace, ji);
|
|
430
|
+
} else if (re.escapeTestNoEncode.test(o)) return o.replace(re.escapeReplaceNoEncode, ji);
|
|
431
431
|
return o;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function Yi(o) {
|
|
434
434
|
try {
|
|
435
|
-
o = encodeURI(o).replace(
|
|
435
|
+
o = encodeURI(o).replace(re.percentDecode, "%");
|
|
436
436
|
} catch {
|
|
437
437
|
return null;
|
|
438
438
|
}
|
|
439
439
|
return o;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function Xi(o, e) {
|
|
442
442
|
var r;
|
|
443
|
-
let t = o.replace(
|
|
443
|
+
let t = o.replace(re.findPipe, (l, n, u) => {
|
|
444
444
|
let a = !1, h = n;
|
|
445
445
|
for (; --h >= 0 && u[h] === "\\"; ) a = !a;
|
|
446
446
|
return a ? "|" : " |";
|
|
447
|
-
}), i = t.split(
|
|
447
|
+
}), i = t.split(re.splitPipe), s = 0;
|
|
448
448
|
if (i[0].trim() || i.shift(), i.length > 0 && !((r = i.at(-1)) != null && r.trim()) && i.pop(), e) if (i.length > e) i.splice(e);
|
|
449
449
|
else for (; i.length < e; ) i.push("");
|
|
450
|
-
for (; s < i.length; s++) i[s] = i[s].trim().replace(
|
|
450
|
+
for (; s < i.length; s++) i[s] = i[s].trim().replace(re.slashPipe, "|");
|
|
451
451
|
return i;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Qe(o, e, t) {
|
|
454
454
|
let i = o.length;
|
|
455
455
|
if (i === 0) return "";
|
|
456
456
|
let s = 0;
|
|
@@ -466,7 +466,7 @@ function Qr(o, e) {
|
|
|
466
466
|
else if (o[i] === e[1] && (t--, t < 0)) return i;
|
|
467
467
|
return t > 0 ? -2 : -1;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Zi(o, e, t, i, s) {
|
|
470
470
|
let r = e.href, l = e.title || null, n = o[1].replace(s.other.outputLinkReplace, "$1");
|
|
471
471
|
i.state.inLink = !0;
|
|
472
472
|
let u = { type: o[0].charAt(0) === "!" ? "image" : "link", raw: t, href: r, title: l, text: n, tokens: i.inlineTokens(n) };
|
|
@@ -485,12 +485,12 @@ function Jr(o, e, t) {
|
|
|
485
485
|
}).join(`
|
|
486
486
|
`);
|
|
487
487
|
}
|
|
488
|
-
var
|
|
488
|
+
var St = class {
|
|
489
489
|
constructor(o) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
this.options = o ||
|
|
490
|
+
B(this, "options");
|
|
491
|
+
B(this, "rules");
|
|
492
|
+
B(this, "lexer");
|
|
493
|
+
this.options = o || He;
|
|
494
494
|
}
|
|
495
495
|
space(o) {
|
|
496
496
|
let e = this.rules.block.newline.exec(o);
|
|
@@ -500,7 +500,7 @@ var Tt = class {
|
|
|
500
500
|
let e = this.rules.block.code.exec(o);
|
|
501
501
|
if (e) {
|
|
502
502
|
let t = e[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
503
|
-
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? t :
|
|
503
|
+
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? t : Qe(t, `
|
|
504
504
|
`) };
|
|
505
505
|
}
|
|
506
506
|
}
|
|
@@ -516,7 +516,7 @@ var Tt = class {
|
|
|
516
516
|
if (e) {
|
|
517
517
|
let t = e[2].trim();
|
|
518
518
|
if (this.rules.other.endingHash.test(t)) {
|
|
519
|
-
let i =
|
|
519
|
+
let i = Qe(t, "#");
|
|
520
520
|
(this.options.pedantic || !i || this.rules.other.endingSpaceChar.test(i)) && (t = i.trim());
|
|
521
521
|
}
|
|
522
522
|
return { type: "heading", raw: e[0], depth: e[1].length, text: t, tokens: this.lexer.inline(t) };
|
|
@@ -524,13 +524,13 @@ var Tt = class {
|
|
|
524
524
|
}
|
|
525
525
|
hr(o) {
|
|
526
526
|
let e = this.rules.block.hr.exec(o);
|
|
527
|
-
if (e) return { type: "hr", raw:
|
|
527
|
+
if (e) return { type: "hr", raw: Qe(e[0], `
|
|
528
528
|
`) };
|
|
529
529
|
}
|
|
530
530
|
blockquote(o) {
|
|
531
531
|
let e = this.rules.block.blockquote.exec(o);
|
|
532
532
|
if (e) {
|
|
533
|
-
let t =
|
|
533
|
+
let t = Qe(e[0], `
|
|
534
534
|
`).split(`
|
|
535
535
|
`), i = "", s = "", r = [];
|
|
536
536
|
for (; t.length > 0; ) {
|
|
@@ -547,19 +547,19 @@ ${a}` : a, s = s ? `${s}
|
|
|
547
547
|
${h}` : h;
|
|
548
548
|
let p = this.lexer.state.top;
|
|
549
549
|
if (this.lexer.state.top = !0, this.lexer.blockTokens(h, r, !0), this.lexer.state.top = p, t.length === 0) break;
|
|
550
|
-
let
|
|
551
|
-
if ((
|
|
552
|
-
if ((
|
|
553
|
-
let
|
|
550
|
+
let c = r.at(-1);
|
|
551
|
+
if ((c == null ? void 0 : c.type) === "code") break;
|
|
552
|
+
if ((c == null ? void 0 : c.type) === "blockquote") {
|
|
553
|
+
let y = c, v = y.raw + `
|
|
554
554
|
` + t.join(`
|
|
555
|
-
`),
|
|
556
|
-
r[r.length - 1] =
|
|
555
|
+
`), R = this.blockquote(v);
|
|
556
|
+
r[r.length - 1] = R, i = i.substring(0, i.length - y.raw.length) + R.raw, s = s.substring(0, s.length - y.text.length) + R.text;
|
|
557
557
|
break;
|
|
558
|
-
} else if ((
|
|
559
|
-
let
|
|
558
|
+
} else if ((c == null ? void 0 : c.type) === "list") {
|
|
559
|
+
let y = c, v = y.raw + `
|
|
560
560
|
` + t.join(`
|
|
561
|
-
`),
|
|
562
|
-
r[r.length - 1] =
|
|
561
|
+
`), R = this.list(v);
|
|
562
|
+
r[r.length - 1] = R, i = i.substring(0, i.length - c.raw.length) + R.raw, s = s.substring(0, s.length - y.raw.length) + R.raw, t = v.substring(r.at(-1).raw.length).split(`
|
|
563
563
|
`);
|
|
564
564
|
continue;
|
|
565
565
|
}
|
|
@@ -578,29 +578,29 @@ ${h}` : h;
|
|
|
578
578
|
if (!(e = r.exec(o)) || this.rules.block.hr.test(o)) break;
|
|
579
579
|
a = e[0], o = o.substring(a.length);
|
|
580
580
|
let p = e[2].split(`
|
|
581
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (x) => " ".repeat(3 * x.length)),
|
|
582
|
-
`, 1)[0],
|
|
583
|
-
if (this.options.pedantic ? (v = 2, h = p.trimStart()) :
|
|
584
|
-
`, o = o.substring(
|
|
585
|
-
let x = this.rules.other.nextBulletRegex(v),
|
|
581
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (x) => " ".repeat(3 * x.length)), c = o.split(`
|
|
582
|
+
`, 1)[0], y = !p.trim(), v = 0;
|
|
583
|
+
if (this.options.pedantic ? (v = 2, h = p.trimStart()) : y ? v = e[1].length + 1 : (v = e[2].search(this.rules.other.nonSpaceChar), v = v > 4 ? 1 : v, h = p.slice(v), v += e[1].length), y && this.rules.other.blankLine.test(c) && (a += c + `
|
|
584
|
+
`, o = o.substring(c.length + 1), u = !0), !u) {
|
|
585
|
+
let x = this.rules.other.nextBulletRegex(v), S = this.rules.other.hrRegex(v), C = this.rules.other.fencesBeginRegex(v), T = this.rules.other.headingBeginRegex(v), I = this.rules.other.htmlBeginRegex(v);
|
|
586
586
|
for (; o; ) {
|
|
587
|
-
let
|
|
588
|
-
`, 1)[0],
|
|
589
|
-
if (
|
|
590
|
-
if (
|
|
591
|
-
` +
|
|
587
|
+
let Q = o.split(`
|
|
588
|
+
`, 1)[0], le;
|
|
589
|
+
if (c = Q, this.options.pedantic ? (c = c.replace(this.rules.other.listReplaceNesting, " "), le = c) : le = c.replace(this.rules.other.tabCharGlobal, " "), C.test(c) || T.test(c) || I.test(c) || x.test(c) || S.test(c)) break;
|
|
590
|
+
if (le.search(this.rules.other.nonSpaceChar) >= v || !c.trim()) h += `
|
|
591
|
+
` + le.slice(v);
|
|
592
592
|
else {
|
|
593
|
-
if (
|
|
593
|
+
if (y || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || C.test(p) || T.test(p) || S.test(p)) break;
|
|
594
594
|
h += `
|
|
595
|
-
` +
|
|
595
|
+
` + c;
|
|
596
596
|
}
|
|
597
|
-
!
|
|
598
|
-
`, o = o.substring(
|
|
597
|
+
!y && !c.trim() && (y = !0), a += Q + `
|
|
598
|
+
`, o = o.substring(Q.length + 1), p = le.slice(v);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
s.loose || (l ? s.loose = !0 : this.rules.other.doubleBlankLine.test(a) && (l = !0));
|
|
602
|
-
let
|
|
603
|
-
this.options.gfm && (
|
|
602
|
+
let R = null, N;
|
|
603
|
+
this.options.gfm && (R = this.rules.other.listIsTask.exec(h), R && (N = R[0] !== "[ ] ", h = h.replace(this.rules.other.listReplaceTask, ""))), s.items.push({ type: "list_item", raw: a, task: !!R, checked: N, loose: !1, text: h, tokens: [] }), s.raw += a;
|
|
604
604
|
}
|
|
605
605
|
let n = s.items.at(-1);
|
|
606
606
|
if (n) n.raw = n.raw.trimEnd(), n.text = n.text.trimEnd();
|
|
@@ -629,12 +629,12 @@ ${h}` : h;
|
|
|
629
629
|
var l;
|
|
630
630
|
let e = this.rules.block.table.exec(o);
|
|
631
631
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
632
|
-
let t =
|
|
632
|
+
let t = Xi(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = (l = e[3]) != null && l.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
633
633
|
`) : [], r = { type: "table", raw: e[0], header: [], align: [], rows: [] };
|
|
634
634
|
if (t.length === i.length) {
|
|
635
635
|
for (let n of i) this.rules.other.tableAlignRight.test(n) ? r.align.push("right") : this.rules.other.tableAlignCenter.test(n) ? r.align.push("center") : this.rules.other.tableAlignLeft.test(n) ? r.align.push("left") : r.align.push(null);
|
|
636
636
|
for (let n = 0; n < t.length; n++) r.header.push({ text: t[n], tokens: this.lexer.inline(t[n]), header: !0, align: r.align[n] });
|
|
637
|
-
for (let n of s) r.rows.push(
|
|
637
|
+
for (let n of s) r.rows.push(Xi(n, r.header.length).map((u, a) => ({ text: u, tokens: this.lexer.inline(u), header: !1, align: r.align[a] })));
|
|
638
638
|
return r;
|
|
639
639
|
}
|
|
640
640
|
}
|
|
@@ -668,7 +668,7 @@ ${h}` : h;
|
|
|
668
668
|
let t = e[2].trim();
|
|
669
669
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(t)) {
|
|
670
670
|
if (!this.rules.other.endAngleBracket.test(t)) return;
|
|
671
|
-
let r =
|
|
671
|
+
let r = Qe(t.slice(0, -1), "\\");
|
|
672
672
|
if ((t.length - r.length) % 2 === 0) return;
|
|
673
673
|
} else {
|
|
674
674
|
let r = Qr(e[2], "()");
|
|
@@ -683,7 +683,7 @@ ${h}` : h;
|
|
|
683
683
|
let r = this.rules.other.pedanticHrefTitle.exec(i);
|
|
684
684
|
r && (i = r[1], s = r[3]);
|
|
685
685
|
} else s = e[3] ? e[3].slice(1, -1) : "";
|
|
686
|
-
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? i = i.slice(1) : i = i.slice(1, -1)),
|
|
686
|
+
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? i = i.slice(1) : i = i.slice(1, -1)), Zi(e, { href: i && i.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
687
687
|
}
|
|
688
688
|
}
|
|
689
689
|
reflink(o, e) {
|
|
@@ -694,7 +694,7 @@ ${h}` : h;
|
|
|
694
694
|
let r = t[0].charAt(0);
|
|
695
695
|
return { type: "text", raw: r, text: r };
|
|
696
696
|
}
|
|
697
|
-
return
|
|
697
|
+
return Zi(t, s, t[0], this.lexer, this.rules);
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
700
|
emStrong(o, e, t = "") {
|
|
@@ -714,11 +714,11 @@ ${h}` : h;
|
|
|
714
714
|
l = Math.min(l, l + n + u);
|
|
715
715
|
let h = [...i[0]][0].length, p = o.slice(0, s + i.index + h + l);
|
|
716
716
|
if (Math.min(s, l) % 2) {
|
|
717
|
-
let
|
|
718
|
-
return { type: "em", raw: p, text:
|
|
717
|
+
let y = p.slice(1, -1);
|
|
718
|
+
return { type: "em", raw: p, text: y, tokens: this.lexer.inlineTokens(y) };
|
|
719
719
|
}
|
|
720
|
-
let
|
|
721
|
-
return { type: "strong", raw: p, text:
|
|
720
|
+
let c = p.slice(2, -2);
|
|
721
|
+
return { type: "strong", raw: p, text: c, tokens: this.lexer.inlineTokens(c) };
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
724
|
}
|
|
@@ -767,28 +767,28 @@ ${h}` : h;
|
|
|
767
767
|
return { type: "text", raw: e[0], text: e[0], escaped: t };
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
|
-
},
|
|
770
|
+
}, Re = class ri {
|
|
771
771
|
constructor(e) {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
778
|
-
let t = { other:
|
|
779
|
-
this.options.pedantic ? (t.block =
|
|
772
|
+
B(this, "tokens");
|
|
773
|
+
B(this, "options");
|
|
774
|
+
B(this, "state");
|
|
775
|
+
B(this, "tokenizer");
|
|
776
|
+
B(this, "inlineQueue");
|
|
777
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || He, this.options.tokenizer = this.options.tokenizer || new St(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
778
|
+
let t = { other: re, block: vt.normal, inline: Ke.normal };
|
|
779
|
+
this.options.pedantic ? (t.block = vt.pedantic, t.inline = Ke.pedantic) : this.options.gfm && (t.block = vt.gfm, this.options.breaks ? t.inline = Ke.breaks : t.inline = Ke.gfm), this.tokenizer.rules = t;
|
|
780
780
|
}
|
|
781
781
|
static get rules() {
|
|
782
|
-
return { block:
|
|
782
|
+
return { block: vt, inline: Ke };
|
|
783
783
|
}
|
|
784
784
|
static lex(e, t) {
|
|
785
|
-
return new
|
|
785
|
+
return new ri(t).lex(e);
|
|
786
786
|
}
|
|
787
787
|
static lexInline(e, t) {
|
|
788
|
-
return new
|
|
788
|
+
return new ri(t).inlineTokens(e);
|
|
789
789
|
}
|
|
790
790
|
lex(e) {
|
|
791
|
-
e = e.replace(
|
|
791
|
+
e = e.replace(re.carriageReturn, `
|
|
792
792
|
`), this.blockTokens(e, this.tokens);
|
|
793
793
|
for (let t = 0; t < this.inlineQueue.length; t++) {
|
|
794
794
|
let i = this.inlineQueue[t];
|
|
@@ -798,7 +798,7 @@ ${h}` : h;
|
|
|
798
798
|
}
|
|
799
799
|
blockTokens(e, t = [], i = !1) {
|
|
800
800
|
var s, r, l;
|
|
801
|
-
for (this.options.pedantic && (e = e.replace(
|
|
801
|
+
for (this.options.pedantic && (e = e.replace(re.tabCharGlobal, " ").replace(re.spaceLine, "")); e; ) {
|
|
802
802
|
let n;
|
|
803
803
|
if ((r = (s = this.options.extensions) == null ? void 0 : s.block) != null && r.some((a) => (n = a.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1)) continue;
|
|
804
804
|
if (n = this.tokenizer.space(e)) {
|
|
@@ -861,8 +861,8 @@ ${h}` : h;
|
|
|
861
861
|
let u = e;
|
|
862
862
|
if ((l = this.options.extensions) != null && l.startBlock) {
|
|
863
863
|
let a = 1 / 0, h = e.slice(1), p;
|
|
864
|
-
this.options.extensions.startBlock.forEach((
|
|
865
|
-
p =
|
|
864
|
+
this.options.extensions.startBlock.forEach((c) => {
|
|
865
|
+
p = c.call({ lexer: this }, h), typeof p == "number" && p >= 0 && (a = Math.min(a, p));
|
|
866
866
|
}), a < 1 / 0 && a >= 0 && (u = e.substring(0, a + 1));
|
|
867
867
|
}
|
|
868
868
|
if (this.state.top && (n = this.tokenizer.paragraph(u))) {
|
|
@@ -908,7 +908,7 @@ ${h}` : h;
|
|
|
908
908
|
for (; e; ) {
|
|
909
909
|
r || (l = ""), r = !1;
|
|
910
910
|
let h;
|
|
911
|
-
if ((u = (n = this.options.extensions) == null ? void 0 : n.inline) != null && u.some((
|
|
911
|
+
if ((u = (n = this.options.extensions) == null ? void 0 : n.inline) != null && u.some((c) => (h = c.call({ lexer: this }, e, t)) ? (e = e.substring(h.raw.length), t.push(h), !0) : !1)) continue;
|
|
912
912
|
if (h = this.tokenizer.escape(e)) {
|
|
913
913
|
e = e.substring(h.raw.length), t.push(h);
|
|
914
914
|
continue;
|
|
@@ -923,8 +923,8 @@ ${h}` : h;
|
|
|
923
923
|
}
|
|
924
924
|
if (h = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
925
925
|
e = e.substring(h.raw.length);
|
|
926
|
-
let
|
|
927
|
-
h.type === "text" && (
|
|
926
|
+
let c = t.at(-1);
|
|
927
|
+
h.type === "text" && (c == null ? void 0 : c.type) === "text" ? (c.raw += h.raw, c.text += h.text) : t.push(h);
|
|
928
928
|
continue;
|
|
929
929
|
}
|
|
930
930
|
if (h = this.tokenizer.emStrong(e, i, l)) {
|
|
@@ -953,42 +953,42 @@ ${h}` : h;
|
|
|
953
953
|
}
|
|
954
954
|
let p = e;
|
|
955
955
|
if ((a = this.options.extensions) != null && a.startInline) {
|
|
956
|
-
let
|
|
957
|
-
this.options.extensions.startInline.forEach((
|
|
958
|
-
v =
|
|
959
|
-
}),
|
|
956
|
+
let c = 1 / 0, y = e.slice(1), v;
|
|
957
|
+
this.options.extensions.startInline.forEach((R) => {
|
|
958
|
+
v = R.call({ lexer: this }, y), typeof v == "number" && v >= 0 && (c = Math.min(c, v));
|
|
959
|
+
}), c < 1 / 0 && c >= 0 && (p = e.substring(0, c + 1));
|
|
960
960
|
}
|
|
961
961
|
if (h = this.tokenizer.inlineText(p)) {
|
|
962
962
|
e = e.substring(h.raw.length), h.raw.slice(-1) !== "_" && (l = h.raw.slice(-1)), r = !0;
|
|
963
|
-
let
|
|
964
|
-
(
|
|
963
|
+
let c = t.at(-1);
|
|
964
|
+
(c == null ? void 0 : c.type) === "text" ? (c.raw += h.raw, c.text += h.text) : t.push(h);
|
|
965
965
|
continue;
|
|
966
966
|
}
|
|
967
967
|
if (e) {
|
|
968
|
-
let
|
|
968
|
+
let c = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
969
969
|
if (this.options.silent) {
|
|
970
|
-
console.error(
|
|
970
|
+
console.error(c);
|
|
971
971
|
break;
|
|
972
|
-
} else throw new Error(
|
|
972
|
+
} else throw new Error(c);
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
975
|
return t;
|
|
976
976
|
}
|
|
977
|
-
},
|
|
977
|
+
}, Ct = class {
|
|
978
978
|
constructor(o) {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
this.options = o ||
|
|
979
|
+
B(this, "options");
|
|
980
|
+
B(this, "parser");
|
|
981
|
+
this.options = o || He;
|
|
982
982
|
}
|
|
983
983
|
space(o) {
|
|
984
984
|
return "";
|
|
985
985
|
}
|
|
986
986
|
code({ text: o, lang: e, escaped: t }) {
|
|
987
987
|
var r;
|
|
988
|
-
let i = (r = (e || "").match(
|
|
988
|
+
let i = (r = (e || "").match(re.notSpaceStart)) == null ? void 0 : r[0], s = o.replace(re.endingNewline, "") + `
|
|
989
989
|
`;
|
|
990
|
-
return i ? '<pre><code class="language-' +
|
|
991
|
-
` : "<pre><code>" + (t ? s :
|
|
990
|
+
return i ? '<pre><code class="language-' + ye(i) + '">' + (t ? s : ye(s, !0)) + `</code></pre>
|
|
991
|
+
` : "<pre><code>" + (t ? s : ye(s, !0)) + `</code></pre>
|
|
992
992
|
`;
|
|
993
993
|
}
|
|
994
994
|
blockquote({ tokens: o }) {
|
|
@@ -1026,7 +1026,7 @@ ${this.parser.parse(o)}</blockquote>
|
|
|
1026
1026
|
let e = "";
|
|
1027
1027
|
if (o.task) {
|
|
1028
1028
|
let i = this.checkbox({ checked: !!o.checked });
|
|
1029
|
-
o.loose ? ((t = o.tokens[0]) == null ? void 0 : t.type) === "paragraph" ? (o.tokens[0].text = i + " " + o.tokens[0].text, o.tokens[0].tokens && o.tokens[0].tokens.length > 0 && o.tokens[0].tokens[0].type === "text" && (o.tokens[0].tokens[0].text = i + " " +
|
|
1029
|
+
o.loose ? ((t = o.tokens[0]) == null ? void 0 : t.type) === "paragraph" ? (o.tokens[0].text = i + " " + o.tokens[0].text, o.tokens[0].tokens && o.tokens[0].tokens.length > 0 && o.tokens[0].tokens[0].type === "text" && (o.tokens[0].tokens[0].text = i + " " + ye(o.tokens[0].tokens[0].text), o.tokens[0].tokens[0].escaped = !0)) : o.tokens.unshift({ type: "text", raw: i + " ", text: i + " ", escaped: !0 }) : e += i + " ";
|
|
1030
1030
|
}
|
|
1031
1031
|
return e += this.parser.parse(o.tokens, !!o.loose), `<li>${e}</li>
|
|
1032
1032
|
`;
|
|
@@ -1072,7 +1072,7 @@ ${o}</tr>
|
|
|
1072
1072
|
return `<em>${this.parser.parseInline(o)}</em>`;
|
|
1073
1073
|
}
|
|
1074
1074
|
codespan({ text: o }) {
|
|
1075
|
-
return `<code>${
|
|
1075
|
+
return `<code>${ye(o, !0)}</code>`;
|
|
1076
1076
|
}
|
|
1077
1077
|
br(o) {
|
|
1078
1078
|
return "<br>";
|
|
@@ -1081,24 +1081,24 @@ ${o}</tr>
|
|
|
1081
1081
|
return `<del>${this.parser.parseInline(o)}</del>`;
|
|
1082
1082
|
}
|
|
1083
1083
|
link({ href: o, title: e, tokens: t }) {
|
|
1084
|
-
let i = this.parser.parseInline(t), s =
|
|
1084
|
+
let i = this.parser.parseInline(t), s = Yi(o);
|
|
1085
1085
|
if (s === null) return i;
|
|
1086
1086
|
o = s;
|
|
1087
1087
|
let r = '<a href="' + o + '"';
|
|
1088
|
-
return e && (r += ' title="' +
|
|
1088
|
+
return e && (r += ' title="' + ye(e) + '"'), r += ">" + i + "</a>", r;
|
|
1089
1089
|
}
|
|
1090
1090
|
image({ href: o, title: e, text: t, tokens: i }) {
|
|
1091
1091
|
i && (t = this.parser.parseInline(i, this.parser.textRenderer));
|
|
1092
|
-
let s =
|
|
1093
|
-
if (s === null) return
|
|
1092
|
+
let s = Yi(o);
|
|
1093
|
+
if (s === null) return ye(t);
|
|
1094
1094
|
o = s;
|
|
1095
1095
|
let r = `<img src="${o}" alt="${t}"`;
|
|
1096
|
-
return e && (r += ` title="${
|
|
1096
|
+
return e && (r += ` title="${ye(e)}"`), r += ">", r;
|
|
1097
1097
|
}
|
|
1098
1098
|
text(o) {
|
|
1099
|
-
return "tokens" in o && o.tokens ? this.parser.parseInline(o.tokens) : "escaped" in o && o.escaped ? o.text :
|
|
1099
|
+
return "tokens" in o && o.tokens ? this.parser.parseInline(o.tokens) : "escaped" in o && o.escaped ? o.text : ye(o.text);
|
|
1100
1100
|
}
|
|
1101
|
-
},
|
|
1101
|
+
}, _i = class {
|
|
1102
1102
|
strong({ text: o }) {
|
|
1103
1103
|
return o;
|
|
1104
1104
|
}
|
|
@@ -1126,18 +1126,18 @@ ${o}</tr>
|
|
|
1126
1126
|
br() {
|
|
1127
1127
|
return "";
|
|
1128
1128
|
}
|
|
1129
|
-
},
|
|
1129
|
+
}, Se = class ni {
|
|
1130
1130
|
constructor(e) {
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
this.options = e ||
|
|
1131
|
+
B(this, "options");
|
|
1132
|
+
B(this, "renderer");
|
|
1133
|
+
B(this, "textRenderer");
|
|
1134
|
+
this.options = e || He, this.options.renderer = this.options.renderer || new Ct(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new _i();
|
|
1135
1135
|
}
|
|
1136
1136
|
static parse(e, t) {
|
|
1137
|
-
return new
|
|
1137
|
+
return new ni(t).parse(e);
|
|
1138
1138
|
}
|
|
1139
1139
|
static parseInline(e, t) {
|
|
1140
|
-
return new
|
|
1140
|
+
return new ni(t).parseInline(e);
|
|
1141
1141
|
}
|
|
1142
1142
|
parse(e, t = !0) {
|
|
1143
1143
|
var s, r;
|
|
@@ -1272,11 +1272,11 @@ ${o}</tr>
|
|
|
1272
1272
|
}
|
|
1273
1273
|
return i;
|
|
1274
1274
|
}
|
|
1275
|
-
},
|
|
1275
|
+
}, Jt, xt = (Jt = class {
|
|
1276
1276
|
constructor(o) {
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
this.options = o ||
|
|
1277
|
+
B(this, "options");
|
|
1278
|
+
B(this, "block");
|
|
1279
|
+
this.options = o || He;
|
|
1280
1280
|
}
|
|
1281
1281
|
preprocess(o) {
|
|
1282
1282
|
return o;
|
|
@@ -1288,23 +1288,23 @@ ${o}</tr>
|
|
|
1288
1288
|
return o;
|
|
1289
1289
|
}
|
|
1290
1290
|
provideLexer() {
|
|
1291
|
-
return this.block ?
|
|
1291
|
+
return this.block ? Re.lex : Re.lexInline;
|
|
1292
1292
|
}
|
|
1293
1293
|
provideParser() {
|
|
1294
|
-
return this.block ?
|
|
1294
|
+
return this.block ? Se.parse : Se.parseInline;
|
|
1295
1295
|
}
|
|
1296
|
-
},
|
|
1296
|
+
}, B(Jt, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Jt), en = class {
|
|
1297
1297
|
constructor(...o) {
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1298
|
+
B(this, "defaults", hi());
|
|
1299
|
+
B(this, "options", this.setOptions);
|
|
1300
|
+
B(this, "parse", this.parseMarkdown(!0));
|
|
1301
|
+
B(this, "parseInline", this.parseMarkdown(!1));
|
|
1302
|
+
B(this, "Parser", Se);
|
|
1303
|
+
B(this, "Renderer", Ct);
|
|
1304
|
+
B(this, "TextRenderer", _i);
|
|
1305
|
+
B(this, "Lexer", Re);
|
|
1306
|
+
B(this, "Tokenizer", St);
|
|
1307
|
+
B(this, "Hooks", xt);
|
|
1308
1308
|
this.use(...o);
|
|
1309
1309
|
}
|
|
1310
1310
|
walkTokens(o, e) {
|
|
@@ -1352,7 +1352,7 @@ ${o}</tr>
|
|
|
1352
1352
|
}
|
|
1353
1353
|
"childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
|
|
1354
1354
|
}), i.extensions = e), t.renderer) {
|
|
1355
|
-
let s = this.defaults.renderer || new
|
|
1355
|
+
let s = this.defaults.renderer || new Ct(this.defaults);
|
|
1356
1356
|
for (let r in t.renderer) {
|
|
1357
1357
|
if (!(r in s)) throw new Error(`renderer '${r}' does not exist`);
|
|
1358
1358
|
if (["options", "parser"].includes(r)) continue;
|
|
@@ -1365,7 +1365,7 @@ ${o}</tr>
|
|
|
1365
1365
|
i.renderer = s;
|
|
1366
1366
|
}
|
|
1367
1367
|
if (t.tokenizer) {
|
|
1368
|
-
let s = this.defaults.tokenizer || new
|
|
1368
|
+
let s = this.defaults.tokenizer || new St(this.defaults);
|
|
1369
1369
|
for (let r in t.tokenizer) {
|
|
1370
1370
|
if (!(r in s)) throw new Error(`tokenizer '${r}' does not exist`);
|
|
1371
1371
|
if (["options", "rules", "lexer"].includes(r)) continue;
|
|
@@ -1378,12 +1378,12 @@ ${o}</tr>
|
|
|
1378
1378
|
i.tokenizer = s;
|
|
1379
1379
|
}
|
|
1380
1380
|
if (t.hooks) {
|
|
1381
|
-
let s = this.defaults.hooks || new
|
|
1381
|
+
let s = this.defaults.hooks || new xt();
|
|
1382
1382
|
for (let r in t.hooks) {
|
|
1383
1383
|
if (!(r in s)) throw new Error(`hook '${r}' does not exist`);
|
|
1384
1384
|
if (["options", "block"].includes(r)) continue;
|
|
1385
1385
|
let l = r, n = t.hooks[l], u = s[l];
|
|
1386
|
-
|
|
1386
|
+
xt.passThroughHooks.has(r) ? s[l] = (a) => {
|
|
1387
1387
|
if (this.defaults.async) return Promise.resolve(n.call(s, a)).then((p) => u.call(s, p));
|
|
1388
1388
|
let h = n.call(s, a);
|
|
1389
1389
|
return u.call(s, h);
|
|
@@ -1408,10 +1408,10 @@ ${o}</tr>
|
|
|
1408
1408
|
return this.defaults = { ...this.defaults, ...o }, this;
|
|
1409
1409
|
}
|
|
1410
1410
|
lexer(o, e) {
|
|
1411
|
-
return
|
|
1411
|
+
return Re.lex(o, e ?? this.defaults);
|
|
1412
1412
|
}
|
|
1413
1413
|
parser(o, e) {
|
|
1414
|
-
return
|
|
1414
|
+
return Se.parse(o, e ?? this.defaults);
|
|
1415
1415
|
}
|
|
1416
1416
|
parseMarkdown(o) {
|
|
1417
1417
|
return (e, t) => {
|
|
@@ -1420,7 +1420,7 @@ ${o}</tr>
|
|
|
1420
1420
|
if (typeof e > "u" || e === null) return r(new Error("marked(): input parameter is undefined or null"));
|
|
1421
1421
|
if (typeof e != "string") return r(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
1422
1422
|
s.hooks && (s.hooks.options = s, s.hooks.block = o);
|
|
1423
|
-
let l = s.hooks ? s.hooks.provideLexer() : o ?
|
|
1423
|
+
let l = s.hooks ? s.hooks.provideLexer() : o ? Re.lex : Re.lexInline, n = s.hooks ? s.hooks.provideParser() : o ? Se.parse : Se.parseInline;
|
|
1424
1424
|
if (s.async) return Promise.resolve(s.hooks ? s.hooks.preprocess(e) : e).then((u) => l(u, s)).then((u) => s.hooks ? s.hooks.processAllTokens(u) : u).then((u) => s.walkTokens ? Promise.all(this.walkTokens(u, s.walkTokens)).then(() => u) : u).then((u) => n(u, s)).then((u) => s.hooks ? s.hooks.postprocess(u) : u).catch(r);
|
|
1425
1425
|
try {
|
|
1426
1426
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
@@ -1437,92 +1437,92 @@ ${o}</tr>
|
|
|
1437
1437
|
return (t) => {
|
|
1438
1438
|
if (t.message += `
|
|
1439
1439
|
Please report this to https://github.com/markedjs/marked.`, o) {
|
|
1440
|
-
let i = "<p>An error occurred:</p><pre>" +
|
|
1440
|
+
let i = "<p>An error occurred:</p><pre>" + ye(t.message + "", !0) + "</pre>";
|
|
1441
1441
|
return e ? Promise.resolve(i) : i;
|
|
1442
1442
|
}
|
|
1443
1443
|
if (e) return Promise.reject(t);
|
|
1444
1444
|
throw t;
|
|
1445
1445
|
};
|
|
1446
1446
|
}
|
|
1447
|
-
},
|
|
1448
|
-
function
|
|
1449
|
-
return
|
|
1447
|
+
}, Me = new en();
|
|
1448
|
+
function O(o, e) {
|
|
1449
|
+
return Me.parse(o, e);
|
|
1450
1450
|
}
|
|
1451
|
-
|
|
1452
|
-
return
|
|
1451
|
+
O.options = O.setOptions = function(o) {
|
|
1452
|
+
return Me.setOptions(o), O.defaults = Me.defaults, gs(O.defaults), O;
|
|
1453
1453
|
};
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
return
|
|
1454
|
+
O.getDefaults = hi;
|
|
1455
|
+
O.defaults = He;
|
|
1456
|
+
O.use = function(...o) {
|
|
1457
|
+
return Me.use(...o), O.defaults = Me.defaults, gs(O.defaults), O;
|
|
1458
1458
|
};
|
|
1459
|
-
|
|
1460
|
-
return
|
|
1459
|
+
O.walkTokens = function(o, e) {
|
|
1460
|
+
return Me.walkTokens(o, e);
|
|
1461
1461
|
};
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1462
|
+
O.parseInline = Me.parseInline;
|
|
1463
|
+
O.Parser = Se;
|
|
1464
|
+
O.parser = Se.parse;
|
|
1465
|
+
O.Renderer = Ct;
|
|
1466
|
+
O.TextRenderer = _i;
|
|
1467
|
+
O.Lexer = Re;
|
|
1468
|
+
O.lexer = Re.lex;
|
|
1469
|
+
O.Tokenizer = St;
|
|
1470
|
+
O.Hooks = xt;
|
|
1471
|
+
O.parse = O;
|
|
1472
|
+
O.options;
|
|
1473
|
+
O.setOptions;
|
|
1474
|
+
O.use;
|
|
1475
|
+
O.walkTokens;
|
|
1476
|
+
O.parseInline;
|
|
1477
|
+
Se.parse;
|
|
1478
|
+
Re.lex;
|
|
1479
1479
|
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
|
1480
1480
|
const {
|
|
1481
|
-
entries:
|
|
1482
|
-
setPrototypeOf:
|
|
1481
|
+
entries: Rs,
|
|
1482
|
+
setPrototypeOf: Ki,
|
|
1483
1483
|
isFrozen: tn,
|
|
1484
1484
|
getPrototypeOf: sn,
|
|
1485
1485
|
getOwnPropertyDescriptor: rn
|
|
1486
1486
|
} = Object;
|
|
1487
1487
|
let {
|
|
1488
|
-
freeze:
|
|
1489
|
-
seal:
|
|
1490
|
-
create:
|
|
1488
|
+
freeze: ne,
|
|
1489
|
+
seal: fe,
|
|
1490
|
+
create: Ss
|
|
1491
1491
|
} = Object, {
|
|
1492
|
-
apply:
|
|
1493
|
-
construct:
|
|
1492
|
+
apply: oi,
|
|
1493
|
+
construct: li
|
|
1494
1494
|
} = typeof Reflect < "u" && Reflect;
|
|
1495
|
-
|
|
1495
|
+
ne || (ne = function(e) {
|
|
1496
1496
|
return e;
|
|
1497
1497
|
});
|
|
1498
|
-
|
|
1498
|
+
fe || (fe = function(e) {
|
|
1499
1499
|
return e;
|
|
1500
1500
|
});
|
|
1501
|
-
|
|
1501
|
+
oi || (oi = function(e, t, i) {
|
|
1502
1502
|
return e.apply(t, i);
|
|
1503
1503
|
});
|
|
1504
|
-
|
|
1504
|
+
li || (li = function(e, t) {
|
|
1505
1505
|
return new e(...t);
|
|
1506
1506
|
});
|
|
1507
|
-
const
|
|
1508
|
-
function
|
|
1507
|
+
const bt = oe(Array.prototype.forEach), nn = oe(Array.prototype.lastIndexOf), Qi = oe(Array.prototype.pop), Je = oe(Array.prototype.push), on = oe(Array.prototype.splice), kt = oe(String.prototype.toLowerCase), Yt = oe(String.prototype.toString), Ji = oe(String.prototype.match), et = oe(String.prototype.replace), ln = oe(String.prototype.indexOf), an = oe(String.prototype.trim), ge = oe(Object.prototype.hasOwnProperty), ie = oe(RegExp.prototype.test), tt = hn(TypeError);
|
|
1508
|
+
function oe(o) {
|
|
1509
1509
|
return function(e) {
|
|
1510
1510
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
1511
1511
|
for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
1512
1512
|
i[s - 1] = arguments[s];
|
|
1513
|
-
return
|
|
1513
|
+
return oi(o, e, i);
|
|
1514
1514
|
};
|
|
1515
1515
|
}
|
|
1516
1516
|
function hn(o) {
|
|
1517
1517
|
return function() {
|
|
1518
1518
|
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
|
|
1519
1519
|
t[i] = arguments[i];
|
|
1520
|
-
return
|
|
1520
|
+
return li(o, t);
|
|
1521
1521
|
};
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1524
|
-
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1525
|
-
|
|
1523
|
+
function L(o, e) {
|
|
1524
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : kt;
|
|
1525
|
+
Ki && Ki(o, null);
|
|
1526
1526
|
let i = e.length;
|
|
1527
1527
|
for (; i--; ) {
|
|
1528
1528
|
let s = e[i];
|
|
@@ -1536,23 +1536,23 @@ function N(o, e) {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
function un(o) {
|
|
1538
1538
|
for (let e = 0; e < o.length; e++)
|
|
1539
|
-
|
|
1539
|
+
ge(o, e) || (o[e] = null);
|
|
1540
1540
|
return o;
|
|
1541
1541
|
}
|
|
1542
|
-
function
|
|
1543
|
-
const e =
|
|
1544
|
-
for (const [t, i] of
|
|
1545
|
-
|
|
1542
|
+
function Te(o) {
|
|
1543
|
+
const e = Ss(null);
|
|
1544
|
+
for (const [t, i] of Rs(o))
|
|
1545
|
+
ge(o, t) && (Array.isArray(i) ? e[t] = un(i) : i && typeof i == "object" && i.constructor === Object ? e[t] = Te(i) : e[t] = i);
|
|
1546
1546
|
return e;
|
|
1547
1547
|
}
|
|
1548
|
-
function
|
|
1548
|
+
function it(o, e) {
|
|
1549
1549
|
for (; o !== null; ) {
|
|
1550
1550
|
const i = rn(o, e);
|
|
1551
1551
|
if (i) {
|
|
1552
1552
|
if (i.get)
|
|
1553
|
-
return
|
|
1553
|
+
return oe(i.get);
|
|
1554
1554
|
if (typeof i.value == "function")
|
|
1555
|
-
return
|
|
1555
|
+
return oe(i.value);
|
|
1556
1556
|
}
|
|
1557
1557
|
o = sn(o);
|
|
1558
1558
|
}
|
|
@@ -1561,27 +1561,27 @@ function Je(o, e) {
|
|
|
1561
1561
|
}
|
|
1562
1562
|
return t;
|
|
1563
1563
|
}
|
|
1564
|
-
const
|
|
1564
|
+
const es = ne(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Xt = ne(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Zt = ne(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), cn = ne(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Kt = ne(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), dn = ne(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ts = ne(["#text"]), is = ne(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Qt = ne(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ss = ne(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), wt = ne(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pn = fe(/\{\{[\w\W]*|[\w\W]*\}\}/gm), fn = fe(/<%[\w\W]*|[\w\W]*%>/gm), gn = fe(/\$\{[\w\W]*/gm), mn = fe(/^data-[\-\w.\u00B7-\uFFFF]+$/), _n = fe(/^aria-[\-\w]+$/), Cs = fe(
|
|
1565
1565
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
1566
1566
|
// eslint-disable-line no-useless-escape
|
|
1567
|
-
), yn =
|
|
1567
|
+
), yn = fe(/^(?:\w+script|data):/i), vn = fe(
|
|
1568
1568
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
1569
1569
|
// eslint-disable-line no-control-regex
|
|
1570
|
-
),
|
|
1571
|
-
var
|
|
1570
|
+
), As = fe(/^html$/i), bn = fe(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
1571
|
+
var rs = /* @__PURE__ */ Object.freeze({
|
|
1572
1572
|
__proto__: null,
|
|
1573
1573
|
ARIA_ATTR: _n,
|
|
1574
1574
|
ATTR_WHITESPACE: vn,
|
|
1575
1575
|
CUSTOM_ELEMENT: bn,
|
|
1576
1576
|
DATA_ATTR: mn,
|
|
1577
|
-
DOCTYPE_NAME:
|
|
1577
|
+
DOCTYPE_NAME: As,
|
|
1578
1578
|
ERB_EXPR: fn,
|
|
1579
|
-
IS_ALLOWED_URI:
|
|
1579
|
+
IS_ALLOWED_URI: Cs,
|
|
1580
1580
|
IS_SCRIPT_OR_DATA: yn,
|
|
1581
1581
|
MUSTACHE_EXPR: pn,
|
|
1582
1582
|
TMPLIT_EXPR: gn
|
|
1583
1583
|
});
|
|
1584
|
-
const
|
|
1584
|
+
const st = {
|
|
1585
1585
|
element: 1,
|
|
1586
1586
|
text: 3,
|
|
1587
1587
|
// Deprecated
|
|
@@ -1609,7 +1609,7 @@ const et = {
|
|
|
1609
1609
|
} catch {
|
|
1610
1610
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
1611
1611
|
}
|
|
1612
|
-
},
|
|
1612
|
+
}, ns = function() {
|
|
1613
1613
|
return {
|
|
1614
1614
|
afterSanitizeAttributes: [],
|
|
1615
1615
|
afterSanitizeElements: [],
|
|
@@ -1622,10 +1622,10 @@ const et = {
|
|
|
1622
1622
|
uponSanitizeShadowNode: []
|
|
1623
1623
|
};
|
|
1624
1624
|
};
|
|
1625
|
-
function
|
|
1625
|
+
function Ds() {
|
|
1626
1626
|
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wn();
|
|
1627
|
-
const e = (w) =>
|
|
1628
|
-
if (e.version = "3.2.6", e.removed = [], !o || !o.document || o.document.nodeType !==
|
|
1627
|
+
const e = (w) => Ds(w);
|
|
1628
|
+
if (e.version = "3.2.6", e.removed = [], !o || !o.document || o.document.nodeType !== st.document || !o.Element)
|
|
1629
1629
|
return e.isSupported = !1, e;
|
|
1630
1630
|
let {
|
|
1631
1631
|
document: t
|
|
@@ -1638,41 +1638,41 @@ function As() {
|
|
|
1638
1638
|
NodeFilter: a,
|
|
1639
1639
|
NamedNodeMap: h = o.NamedNodeMap || o.MozNamedAttrMap,
|
|
1640
1640
|
HTMLFormElement: p,
|
|
1641
|
-
DOMParser:
|
|
1642
|
-
trustedTypes:
|
|
1643
|
-
} = o, v = u.prototype,
|
|
1641
|
+
DOMParser: c,
|
|
1642
|
+
trustedTypes: y
|
|
1643
|
+
} = o, v = u.prototype, R = it(v, "cloneNode"), N = it(v, "remove"), x = it(v, "nextSibling"), S = it(v, "childNodes"), C = it(v, "parentNode");
|
|
1644
1644
|
if (typeof l == "function") {
|
|
1645
1645
|
const w = t.createElement("template");
|
|
1646
1646
|
w.content && w.content.ownerDocument && (t = w.content.ownerDocument);
|
|
1647
1647
|
}
|
|
1648
|
-
let
|
|
1648
|
+
let T, I = "";
|
|
1649
1649
|
const {
|
|
1650
|
-
implementation:
|
|
1651
|
-
createNodeIterator:
|
|
1652
|
-
createDocumentFragment:
|
|
1653
|
-
getElementsByTagName:
|
|
1650
|
+
implementation: Q,
|
|
1651
|
+
createNodeIterator: le,
|
|
1652
|
+
createDocumentFragment: g,
|
|
1653
|
+
getElementsByTagName: m
|
|
1654
1654
|
} = t, {
|
|
1655
|
-
importNode:
|
|
1655
|
+
importNode: F
|
|
1656
1656
|
} = i;
|
|
1657
|
-
let
|
|
1658
|
-
e.isSupported = typeof
|
|
1657
|
+
let z = ns();
|
|
1658
|
+
e.isSupported = typeof Rs == "function" && typeof C == "function" && Q && Q.createHTMLDocument !== void 0;
|
|
1659
1659
|
const {
|
|
1660
|
-
MUSTACHE_EXPR:
|
|
1661
|
-
ERB_EXPR:
|
|
1662
|
-
TMPLIT_EXPR:
|
|
1663
|
-
DATA_ATTR:
|
|
1664
|
-
ARIA_ATTR:
|
|
1665
|
-
IS_SCRIPT_OR_DATA:
|
|
1666
|
-
ATTR_WHITESPACE:
|
|
1667
|
-
CUSTOM_ELEMENT:
|
|
1668
|
-
} =
|
|
1660
|
+
MUSTACHE_EXPR: he,
|
|
1661
|
+
ERB_EXPR: Ce,
|
|
1662
|
+
TMPLIT_EXPR: H,
|
|
1663
|
+
DATA_ATTR: Ve,
|
|
1664
|
+
ARIA_ATTR: ht,
|
|
1665
|
+
IS_SCRIPT_OR_DATA: ut,
|
|
1666
|
+
ATTR_WHITESPACE: qe,
|
|
1667
|
+
CUSTOM_ELEMENT: ct
|
|
1668
|
+
} = rs;
|
|
1669
1669
|
let {
|
|
1670
|
-
IS_ALLOWED_URI:
|
|
1671
|
-
} =
|
|
1672
|
-
const
|
|
1673
|
-
let
|
|
1674
|
-
const
|
|
1675
|
-
let
|
|
1670
|
+
IS_ALLOWED_URI: bi
|
|
1671
|
+
} = rs, j = null;
|
|
1672
|
+
const wi = L({}, [...es, ...Xt, ...Zt, ...Kt, ...ts]);
|
|
1673
|
+
let X = null;
|
|
1674
|
+
const xi = L({}, [...is, ...Qt, ...ss, ...wt]);
|
|
1675
|
+
let V = Object.seal(Ss(null, {
|
|
1676
1676
|
tagNameCheck: {
|
|
1677
1677
|
writable: !0,
|
|
1678
1678
|
configurable: !1,
|
|
@@ -1691,167 +1691,167 @@ function As() {
|
|
|
1691
1691
|
enumerable: !0,
|
|
1692
1692
|
value: !1
|
|
1693
1693
|
}
|
|
1694
|
-
})),
|
|
1694
|
+
})), je = null, Ot = null, ki = !0, Pt = !0, Ei = !1, Ti = !0, Ie = !1, dt = !0, Le = !1, $t = !1, Bt = !1, Oe = !1, pt = !1, ft = !1, Ri = !0, Si = !1;
|
|
1695
1695
|
const zs = "user-content-";
|
|
1696
|
-
let
|
|
1697
|
-
const
|
|
1698
|
-
let
|
|
1699
|
-
const
|
|
1700
|
-
let
|
|
1701
|
-
const
|
|
1702
|
-
let Be =
|
|
1703
|
-
const Ns =
|
|
1704
|
-
let
|
|
1705
|
-
const Ms =
|
|
1706
|
-
let
|
|
1707
|
-
const
|
|
1708
|
-
let
|
|
1709
|
-
const Os = t.createElement("form"),
|
|
1710
|
-
return
|
|
1711
|
-
},
|
|
1712
|
-
let
|
|
1713
|
-
if (!(Fe && Fe ===
|
|
1714
|
-
if ((!
|
|
1715
|
-
|
|
1716
|
-
if (typeof
|
|
1717
|
-
throw
|
|
1718
|
-
if (typeof
|
|
1719
|
-
throw
|
|
1720
|
-
|
|
1696
|
+
let Ft = !0, Ye = !1, Pe = {}, $e = null;
|
|
1697
|
+
const Ci = L({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
1698
|
+
let Ai = null;
|
|
1699
|
+
const Di = L({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
1700
|
+
let Ut = null;
|
|
1701
|
+
const Li = L({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), gt = "http://www.w3.org/1998/Math/MathML", mt = "http://www.w3.org/2000/svg", xe = "http://www.w3.org/1999/xhtml";
|
|
1702
|
+
let Be = xe, Wt = !1, Gt = null;
|
|
1703
|
+
const Ns = L({}, [gt, mt, xe], Yt);
|
|
1704
|
+
let _t = L({}, ["mi", "mo", "mn", "ms", "mtext"]), yt = L({}, ["annotation-xml"]);
|
|
1705
|
+
const Ms = L({}, ["title", "style", "font", "a", "script"]);
|
|
1706
|
+
let Xe = null;
|
|
1707
|
+
const Hs = ["application/xhtml+xml", "text/html"], Is = "text/html";
|
|
1708
|
+
let Y = null, Fe = null;
|
|
1709
|
+
const Os = t.createElement("form"), zi = function(d) {
|
|
1710
|
+
return d instanceof RegExp || d instanceof Function;
|
|
1711
|
+
}, Vt = function() {
|
|
1712
|
+
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1713
|
+
if (!(Fe && Fe === d)) {
|
|
1714
|
+
if ((!d || typeof d != "object") && (d = {}), d = Te(d), Xe = // eslint-disable-next-line unicorn/prefer-includes
|
|
1715
|
+
Hs.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? Is : d.PARSER_MEDIA_TYPE, Y = Xe === "application/xhtml+xml" ? Yt : kt, j = ge(d, "ALLOWED_TAGS") ? L({}, d.ALLOWED_TAGS, Y) : wi, X = ge(d, "ALLOWED_ATTR") ? L({}, d.ALLOWED_ATTR, Y) : xi, Gt = ge(d, "ALLOWED_NAMESPACES") ? L({}, d.ALLOWED_NAMESPACES, Yt) : Ns, Ut = ge(d, "ADD_URI_SAFE_ATTR") ? L(Te(Li), d.ADD_URI_SAFE_ATTR, Y) : Li, Ai = ge(d, "ADD_DATA_URI_TAGS") ? L(Te(Di), d.ADD_DATA_URI_TAGS, Y) : Di, $e = ge(d, "FORBID_CONTENTS") ? L({}, d.FORBID_CONTENTS, Y) : Ci, je = ge(d, "FORBID_TAGS") ? L({}, d.FORBID_TAGS, Y) : Te({}), Ot = ge(d, "FORBID_ATTR") ? L({}, d.FORBID_ATTR, Y) : Te({}), Pe = ge(d, "USE_PROFILES") ? d.USE_PROFILES : !1, ki = d.ALLOW_ARIA_ATTR !== !1, Pt = d.ALLOW_DATA_ATTR !== !1, Ei = d.ALLOW_UNKNOWN_PROTOCOLS || !1, Ti = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ie = d.SAFE_FOR_TEMPLATES || !1, dt = d.SAFE_FOR_XML !== !1, Le = d.WHOLE_DOCUMENT || !1, Oe = d.RETURN_DOM || !1, pt = d.RETURN_DOM_FRAGMENT || !1, ft = d.RETURN_TRUSTED_TYPE || !1, Bt = d.FORCE_BODY || !1, Ri = d.SANITIZE_DOM !== !1, Si = d.SANITIZE_NAMED_PROPS || !1, Ft = d.KEEP_CONTENT !== !1, Ye = d.IN_PLACE || !1, bi = d.ALLOWED_URI_REGEXP || Cs, Be = d.NAMESPACE || xe, _t = d.MATHML_TEXT_INTEGRATION_POINTS || _t, yt = d.HTML_INTEGRATION_POINTS || yt, V = d.CUSTOM_ELEMENT_HANDLING || {}, d.CUSTOM_ELEMENT_HANDLING && zi(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (V.tagNameCheck = d.CUSTOM_ELEMENT_HANDLING.tagNameCheck), d.CUSTOM_ELEMENT_HANDLING && zi(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (V.attributeNameCheck = d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), d.CUSTOM_ELEMENT_HANDLING && typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (V.allowCustomizedBuiltInElements = d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ie && (Pt = !1), pt && (Oe = !0), Pe && (j = L({}, ts), X = [], Pe.html === !0 && (L(j, es), L(X, is)), Pe.svg === !0 && (L(j, Xt), L(X, Qt), L(X, wt)), Pe.svgFilters === !0 && (L(j, Zt), L(X, Qt), L(X, wt)), Pe.mathMl === !0 && (L(j, Kt), L(X, ss), L(X, wt))), d.ADD_TAGS && (j === wi && (j = Te(j)), L(j, d.ADD_TAGS, Y)), d.ADD_ATTR && (X === xi && (X = Te(X)), L(X, d.ADD_ATTR, Y)), d.ADD_URI_SAFE_ATTR && L(Ut, d.ADD_URI_SAFE_ATTR, Y), d.FORBID_CONTENTS && ($e === Ci && ($e = Te($e)), L($e, d.FORBID_CONTENTS, Y)), Ft && (j["#text"] = !0), Le && L(j, ["html", "head", "body"]), j.table && (L(j, ["tbody"]), delete je.tbody), d.TRUSTED_TYPES_POLICY) {
|
|
1716
|
+
if (typeof d.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
1717
|
+
throw tt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1718
|
+
if (typeof d.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
1719
|
+
throw tt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
1720
|
+
T = d.TRUSTED_TYPES_POLICY, I = T.createHTML("");
|
|
1721
1721
|
} else
|
|
1722
|
-
|
|
1723
|
-
|
|
1722
|
+
T === void 0 && (T = xn(y, s)), T !== null && typeof I == "string" && (I = T.createHTML(""));
|
|
1723
|
+
ne && ne(d), Fe = d;
|
|
1724
1724
|
}
|
|
1725
|
-
},
|
|
1726
|
-
let
|
|
1727
|
-
(!
|
|
1725
|
+
}, Ni = L({}, [...Xt, ...Zt, ...cn]), Mi = L({}, [...Kt, ...dn]), Ps = function(d) {
|
|
1726
|
+
let _ = C(d);
|
|
1727
|
+
(!_ || !_.tagName) && (_ = {
|
|
1728
1728
|
namespaceURI: Be,
|
|
1729
1729
|
tagName: "template"
|
|
1730
1730
|
});
|
|
1731
|
-
const b =
|
|
1732
|
-
return
|
|
1733
|
-
},
|
|
1734
|
-
|
|
1735
|
-
element:
|
|
1731
|
+
const b = kt(d.tagName), U = kt(_.tagName);
|
|
1732
|
+
return Gt[d.namespaceURI] ? d.namespaceURI === mt ? _.namespaceURI === xe ? b === "svg" : _.namespaceURI === gt ? b === "svg" && (U === "annotation-xml" || _t[U]) : !!Ni[b] : d.namespaceURI === gt ? _.namespaceURI === xe ? b === "math" : _.namespaceURI === mt ? b === "math" && yt[U] : !!Mi[b] : d.namespaceURI === xe ? _.namespaceURI === mt && !yt[U] || _.namespaceURI === gt && !_t[U] ? !1 : !Mi[b] && (Ms[b] || !Ni[b]) : !!(Xe === "application/xhtml+xml" && Gt[d.namespaceURI]) : !1;
|
|
1733
|
+
}, _e = function(d) {
|
|
1734
|
+
Je(e.removed, {
|
|
1735
|
+
element: d
|
|
1736
1736
|
});
|
|
1737
1737
|
try {
|
|
1738
|
-
|
|
1738
|
+
C(d).removeChild(d);
|
|
1739
1739
|
} catch {
|
|
1740
|
-
|
|
1740
|
+
N(d);
|
|
1741
1741
|
}
|
|
1742
|
-
}, Ue = function(
|
|
1742
|
+
}, Ue = function(d, _) {
|
|
1743
1743
|
try {
|
|
1744
|
-
|
|
1745
|
-
attribute:
|
|
1746
|
-
from:
|
|
1744
|
+
Je(e.removed, {
|
|
1745
|
+
attribute: _.getAttributeNode(d),
|
|
1746
|
+
from: _
|
|
1747
1747
|
});
|
|
1748
1748
|
} catch {
|
|
1749
|
-
|
|
1749
|
+
Je(e.removed, {
|
|
1750
1750
|
attribute: null,
|
|
1751
|
-
from:
|
|
1751
|
+
from: _
|
|
1752
1752
|
});
|
|
1753
1753
|
}
|
|
1754
|
-
if (
|
|
1755
|
-
if (Oe ||
|
|
1754
|
+
if (_.removeAttribute(d), d === "is")
|
|
1755
|
+
if (Oe || pt)
|
|
1756
1756
|
try {
|
|
1757
|
-
|
|
1757
|
+
_e(_);
|
|
1758
1758
|
} catch {
|
|
1759
1759
|
}
|
|
1760
1760
|
else
|
|
1761
1761
|
try {
|
|
1762
|
-
|
|
1762
|
+
_.setAttribute(d, "");
|
|
1763
1763
|
} catch {
|
|
1764
1764
|
}
|
|
1765
|
-
},
|
|
1766
|
-
let
|
|
1767
|
-
if (
|
|
1768
|
-
|
|
1765
|
+
}, Hi = function(d) {
|
|
1766
|
+
let _ = null, b = null;
|
|
1767
|
+
if (Bt)
|
|
1768
|
+
d = "<remove></remove>" + d;
|
|
1769
1769
|
else {
|
|
1770
|
-
const
|
|
1771
|
-
b =
|
|
1770
|
+
const q = Ji(d, /^[\r\n\t ]+/);
|
|
1771
|
+
b = q && q[0];
|
|
1772
1772
|
}
|
|
1773
|
-
|
|
1774
|
-
const
|
|
1775
|
-
if (Be ===
|
|
1773
|
+
Xe === "application/xhtml+xml" && Be === xe && (d = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + d + "</body></html>");
|
|
1774
|
+
const U = T ? T.createHTML(d) : d;
|
|
1775
|
+
if (Be === xe)
|
|
1776
1776
|
try {
|
|
1777
|
-
|
|
1777
|
+
_ = new c().parseFromString(U, Xe);
|
|
1778
1778
|
} catch {
|
|
1779
1779
|
}
|
|
1780
|
-
if (!
|
|
1781
|
-
|
|
1780
|
+
if (!_ || !_.documentElement) {
|
|
1781
|
+
_ = Q.createDocument(Be, "template", null);
|
|
1782
1782
|
try {
|
|
1783
|
-
|
|
1783
|
+
_.documentElement.innerHTML = Wt ? I : U;
|
|
1784
1784
|
} catch {
|
|
1785
1785
|
}
|
|
1786
1786
|
}
|
|
1787
|
-
const
|
|
1788
|
-
return
|
|
1789
|
-
}, Ii = function(
|
|
1790
|
-
return
|
|
1791
|
-
|
|
1792
|
-
|
|
1787
|
+
const J = _.body || _.documentElement;
|
|
1788
|
+
return d && b && J.insertBefore(t.createTextNode(b), J.childNodes[0] || null), Be === xe ? m.call(_, Le ? "html" : "body")[0] : Le ? _.documentElement : J;
|
|
1789
|
+
}, Ii = function(d) {
|
|
1790
|
+
return le.call(
|
|
1791
|
+
d.ownerDocument || d,
|
|
1792
|
+
d,
|
|
1793
1793
|
// eslint-disable-next-line no-bitwise
|
|
1794
1794
|
a.SHOW_ELEMENT | a.SHOW_COMMENT | a.SHOW_TEXT | a.SHOW_PROCESSING_INSTRUCTION | a.SHOW_CDATA_SECTION,
|
|
1795
1795
|
null
|
|
1796
1796
|
);
|
|
1797
|
-
},
|
|
1798
|
-
return
|
|
1799
|
-
},
|
|
1800
|
-
return typeof n == "function" &&
|
|
1797
|
+
}, qt = function(d) {
|
|
1798
|
+
return d instanceof p && (typeof d.nodeName != "string" || typeof d.textContent != "string" || typeof d.removeChild != "function" || !(d.attributes instanceof h) || typeof d.removeAttribute != "function" || typeof d.setAttribute != "function" || typeof d.namespaceURI != "string" || typeof d.insertBefore != "function" || typeof d.hasChildNodes != "function");
|
|
1799
|
+
}, Oi = function(d) {
|
|
1800
|
+
return typeof n == "function" && d instanceof n;
|
|
1801
1801
|
};
|
|
1802
|
-
function
|
|
1803
|
-
|
|
1804
|
-
b.call(e,
|
|
1802
|
+
function ke(w, d, _) {
|
|
1803
|
+
bt(w, (b) => {
|
|
1804
|
+
b.call(e, d, _, Fe);
|
|
1805
1805
|
});
|
|
1806
1806
|
}
|
|
1807
|
-
const
|
|
1808
|
-
let
|
|
1809
|
-
if (
|
|
1810
|
-
return
|
|
1811
|
-
const b =
|
|
1812
|
-
if (
|
|
1807
|
+
const Pi = function(d) {
|
|
1808
|
+
let _ = null;
|
|
1809
|
+
if (ke(z.beforeSanitizeElements, d, null), qt(d))
|
|
1810
|
+
return _e(d), !0;
|
|
1811
|
+
const b = Y(d.nodeName);
|
|
1812
|
+
if (ke(z.uponSanitizeElement, d, {
|
|
1813
1813
|
tagName: b,
|
|
1814
|
-
allowedTags:
|
|
1815
|
-
}),
|
|
1816
|
-
return
|
|
1817
|
-
if (!
|
|
1818
|
-
if (!
|
|
1814
|
+
allowedTags: j
|
|
1815
|
+
}), dt && d.hasChildNodes() && !Oi(d.firstElementChild) && ie(/<[/\w!]/g, d.innerHTML) && ie(/<[/\w!]/g, d.textContent) || d.nodeType === st.progressingInstruction || dt && d.nodeType === st.comment && ie(/<[/\w]/g, d.data))
|
|
1816
|
+
return _e(d), !0;
|
|
1817
|
+
if (!j[b] || je[b]) {
|
|
1818
|
+
if (!je[b] && Bi(b) && (V.tagNameCheck instanceof RegExp && ie(V.tagNameCheck, b) || V.tagNameCheck instanceof Function && V.tagNameCheck(b)))
|
|
1819
1819
|
return !1;
|
|
1820
|
-
if (
|
|
1821
|
-
const
|
|
1822
|
-
if (
|
|
1823
|
-
const
|
|
1824
|
-
for (let ae =
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1820
|
+
if (Ft && !$e[b]) {
|
|
1821
|
+
const U = C(d) || d.parentNode, J = S(d) || d.childNodes;
|
|
1822
|
+
if (J && U) {
|
|
1823
|
+
const q = J.length;
|
|
1824
|
+
for (let ae = q - 1; ae >= 0; --ae) {
|
|
1825
|
+
const Ee = R(J[ae], !0);
|
|
1826
|
+
Ee.__removalCount = (d.__removalCount || 0) + 1, U.insertBefore(Ee, x(d));
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
1829
|
}
|
|
1830
|
-
return
|
|
1830
|
+
return _e(d), !0;
|
|
1831
1831
|
}
|
|
1832
|
-
return
|
|
1833
|
-
|
|
1834
|
-
}),
|
|
1835
|
-
element:
|
|
1836
|
-
}),
|
|
1837
|
-
},
|
|
1838
|
-
if (
|
|
1832
|
+
return d instanceof u && !Ps(d) || (b === "noscript" || b === "noembed" || b === "noframes") && ie(/<\/no(script|embed|frames)/i, d.innerHTML) ? (_e(d), !0) : (Ie && d.nodeType === st.text && (_ = d.textContent, bt([he, Ce, H], (U) => {
|
|
1833
|
+
_ = et(_, U, " ");
|
|
1834
|
+
}), d.textContent !== _ && (Je(e.removed, {
|
|
1835
|
+
element: d.cloneNode()
|
|
1836
|
+
}), d.textContent = _)), ke(z.afterSanitizeElements, d, null), !1);
|
|
1837
|
+
}, $i = function(d, _, b) {
|
|
1838
|
+
if (Ri && (_ === "id" || _ === "name") && (b in t || b in Os))
|
|
1839
1839
|
return !1;
|
|
1840
|
-
if (!(
|
|
1841
|
-
if (!(
|
|
1842
|
-
if (!
|
|
1840
|
+
if (!(Pt && !Ot[_] && ie(Ve, _))) {
|
|
1841
|
+
if (!(ki && ie(ht, _))) {
|
|
1842
|
+
if (!X[_] || Ot[_]) {
|
|
1843
1843
|
if (
|
|
1844
1844
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1845
1845
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1846
1846
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
1847
|
-
!(
|
|
1847
|
+
!(Bi(d) && (V.tagNameCheck instanceof RegExp && ie(V.tagNameCheck, d) || V.tagNameCheck instanceof Function && V.tagNameCheck(d)) && (V.attributeNameCheck instanceof RegExp && ie(V.attributeNameCheck, _) || V.attributeNameCheck instanceof Function && V.attributeNameCheck(_)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
1848
1848
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1849
|
-
|
|
1849
|
+
_ === "is" && V.allowCustomizedBuiltInElements && (V.tagNameCheck instanceof RegExp && ie(V.tagNameCheck, b) || V.tagNameCheck instanceof Function && V.tagNameCheck(b)))
|
|
1850
1850
|
) return !1;
|
|
1851
|
-
} else if (!
|
|
1852
|
-
if (!
|
|
1853
|
-
if (!((
|
|
1854
|
-
if (!(
|
|
1851
|
+
} else if (!Ut[_]) {
|
|
1852
|
+
if (!ie(bi, et(b, qe, ""))) {
|
|
1853
|
+
if (!((_ === "src" || _ === "xlink:href" || _ === "href") && d !== "script" && ln(b, "data:") === 0 && Ai[d])) {
|
|
1854
|
+
if (!(Ei && !ie(ut, et(b, qe, "")))) {
|
|
1855
1855
|
if (b)
|
|
1856
1856
|
return !1;
|
|
1857
1857
|
}
|
|
@@ -1861,147 +1861,147 @@ function As() {
|
|
|
1861
1861
|
}
|
|
1862
1862
|
}
|
|
1863
1863
|
return !0;
|
|
1864
|
-
},
|
|
1865
|
-
return
|
|
1866
|
-
},
|
|
1867
|
-
|
|
1864
|
+
}, Bi = function(d) {
|
|
1865
|
+
return d !== "annotation-xml" && Ji(d, ct);
|
|
1866
|
+
}, Fi = function(d) {
|
|
1867
|
+
ke(z.beforeSanitizeAttributes, d, null);
|
|
1868
1868
|
const {
|
|
1869
|
-
attributes:
|
|
1870
|
-
} =
|
|
1871
|
-
if (!
|
|
1869
|
+
attributes: _
|
|
1870
|
+
} = d;
|
|
1871
|
+
if (!_ || qt(d))
|
|
1872
1872
|
return;
|
|
1873
1873
|
const b = {
|
|
1874
1874
|
attrName: "",
|
|
1875
1875
|
attrValue: "",
|
|
1876
1876
|
keepAttr: !0,
|
|
1877
|
-
allowedAttributes:
|
|
1877
|
+
allowedAttributes: X,
|
|
1878
1878
|
forceKeepAttr: void 0
|
|
1879
1879
|
};
|
|
1880
|
-
let
|
|
1881
|
-
for (;
|
|
1882
|
-
const
|
|
1883
|
-
name:
|
|
1880
|
+
let U = _.length;
|
|
1881
|
+
for (; U--; ) {
|
|
1882
|
+
const J = _[U], {
|
|
1883
|
+
name: q,
|
|
1884
1884
|
namespaceURI: ae,
|
|
1885
|
-
value:
|
|
1886
|
-
} =
|
|
1887
|
-
let
|
|
1888
|
-
if (b.attrName =
|
|
1889
|
-
Ue(
|
|
1885
|
+
value: Ee
|
|
1886
|
+
} = J, Ze = Y(q), jt = Ee;
|
|
1887
|
+
let ee = q === "value" ? jt : an(jt);
|
|
1888
|
+
if (b.attrName = Ze, b.attrValue = ee, b.keepAttr = !0, b.forceKeepAttr = void 0, ke(z.uponSanitizeAttribute, d, b), ee = b.attrValue, Si && (Ze === "id" || Ze === "name") && (Ue(q, d), ee = zs + ee), dt && ie(/((--!?|])>)|<\/(style|title)/i, ee)) {
|
|
1889
|
+
Ue(q, d);
|
|
1890
1890
|
continue;
|
|
1891
1891
|
}
|
|
1892
1892
|
if (b.forceKeepAttr)
|
|
1893
1893
|
continue;
|
|
1894
1894
|
if (!b.keepAttr) {
|
|
1895
|
-
Ue(
|
|
1895
|
+
Ue(q, d);
|
|
1896
1896
|
continue;
|
|
1897
1897
|
}
|
|
1898
|
-
if (!
|
|
1899
|
-
Ue(
|
|
1898
|
+
if (!Ti && ie(/\/>/i, ee)) {
|
|
1899
|
+
Ue(q, d);
|
|
1900
1900
|
continue;
|
|
1901
1901
|
}
|
|
1902
|
-
|
|
1903
|
-
|
|
1902
|
+
Ie && bt([he, Ce, H], (Wi) => {
|
|
1903
|
+
ee = et(ee, Wi, " ");
|
|
1904
1904
|
});
|
|
1905
|
-
const
|
|
1906
|
-
if (
|
|
1907
|
-
Ue(
|
|
1905
|
+
const Ui = Y(d.nodeName);
|
|
1906
|
+
if (!$i(Ui, Ze, ee)) {
|
|
1907
|
+
Ue(q, d);
|
|
1908
1908
|
continue;
|
|
1909
1909
|
}
|
|
1910
|
-
if (
|
|
1911
|
-
switch (
|
|
1910
|
+
if (T && typeof y == "object" && typeof y.getAttributeType == "function" && !ae)
|
|
1911
|
+
switch (y.getAttributeType(Ui, Ze)) {
|
|
1912
1912
|
case "TrustedHTML": {
|
|
1913
|
-
|
|
1913
|
+
ee = T.createHTML(ee);
|
|
1914
1914
|
break;
|
|
1915
1915
|
}
|
|
1916
1916
|
case "TrustedScriptURL": {
|
|
1917
|
-
|
|
1917
|
+
ee = T.createScriptURL(ee);
|
|
1918
1918
|
break;
|
|
1919
1919
|
}
|
|
1920
1920
|
}
|
|
1921
|
-
if (
|
|
1921
|
+
if (ee !== jt)
|
|
1922
1922
|
try {
|
|
1923
|
-
ae ?
|
|
1923
|
+
ae ? d.setAttributeNS(ae, q, ee) : d.setAttribute(q, ee), qt(d) ? _e(d) : Qi(e.removed);
|
|
1924
1924
|
} catch {
|
|
1925
|
-
Ue(
|
|
1925
|
+
Ue(q, d);
|
|
1926
1926
|
}
|
|
1927
1927
|
}
|
|
1928
|
-
|
|
1929
|
-
}, $s = function w(
|
|
1930
|
-
let
|
|
1931
|
-
const b = Ii(
|
|
1932
|
-
for (
|
|
1933
|
-
|
|
1934
|
-
|
|
1928
|
+
ke(z.afterSanitizeAttributes, d, null);
|
|
1929
|
+
}, $s = function w(d) {
|
|
1930
|
+
let _ = null;
|
|
1931
|
+
const b = Ii(d);
|
|
1932
|
+
for (ke(z.beforeSanitizeShadowDOM, d, null); _ = b.nextNode(); )
|
|
1933
|
+
ke(z.uponSanitizeShadowNode, _, null), Pi(_), Fi(_), _.content instanceof r && w(_.content);
|
|
1934
|
+
ke(z.afterSanitizeShadowDOM, d, null);
|
|
1935
1935
|
};
|
|
1936
1936
|
return e.sanitize = function(w) {
|
|
1937
|
-
let
|
|
1938
|
-
if (
|
|
1937
|
+
let d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ = null, b = null, U = null, J = null;
|
|
1938
|
+
if (Wt = !w, Wt && (w = "<!-->"), typeof w != "string" && !Oi(w))
|
|
1939
1939
|
if (typeof w.toString == "function") {
|
|
1940
1940
|
if (w = w.toString(), typeof w != "string")
|
|
1941
|
-
throw
|
|
1941
|
+
throw tt("dirty is not a string, aborting");
|
|
1942
1942
|
} else
|
|
1943
|
-
throw
|
|
1943
|
+
throw tt("toString is not a function");
|
|
1944
1944
|
if (!e.isSupported)
|
|
1945
1945
|
return w;
|
|
1946
|
-
if (
|
|
1946
|
+
if ($t || Vt(d), e.removed = [], typeof w == "string" && (Ye = !1), Ye) {
|
|
1947
1947
|
if (w.nodeName) {
|
|
1948
|
-
const
|
|
1949
|
-
if (!
|
|
1950
|
-
throw
|
|
1948
|
+
const Ee = Y(w.nodeName);
|
|
1949
|
+
if (!j[Ee] || je[Ee])
|
|
1950
|
+
throw tt("root node is forbidden and cannot be sanitized in-place");
|
|
1951
1951
|
}
|
|
1952
1952
|
} else if (w instanceof n)
|
|
1953
|
-
|
|
1953
|
+
_ = Hi("<!---->"), b = _.ownerDocument.importNode(w, !0), b.nodeType === st.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? _ = b : _.appendChild(b);
|
|
1954
1954
|
else {
|
|
1955
|
-
if (!Oe && !
|
|
1955
|
+
if (!Oe && !Ie && !Le && // eslint-disable-next-line unicorn/prefer-includes
|
|
1956
1956
|
w.indexOf("<") === -1)
|
|
1957
|
-
return
|
|
1958
|
-
if (
|
|
1959
|
-
return Oe ? null :
|
|
1957
|
+
return T && ft ? T.createHTML(w) : w;
|
|
1958
|
+
if (_ = Hi(w), !_)
|
|
1959
|
+
return Oe ? null : ft ? I : "";
|
|
1960
1960
|
}
|
|
1961
|
-
|
|
1962
|
-
const
|
|
1963
|
-
for (;
|
|
1964
|
-
|
|
1965
|
-
if (
|
|
1961
|
+
_ && Bt && _e(_.firstChild);
|
|
1962
|
+
const q = Ii(Ye ? w : _);
|
|
1963
|
+
for (; U = q.nextNode(); )
|
|
1964
|
+
Pi(U), Fi(U), U.content instanceof r && $s(U.content);
|
|
1965
|
+
if (Ye)
|
|
1966
1966
|
return w;
|
|
1967
1967
|
if (Oe) {
|
|
1968
|
-
if (
|
|
1969
|
-
for (
|
|
1970
|
-
|
|
1968
|
+
if (pt)
|
|
1969
|
+
for (J = g.call(_.ownerDocument); _.firstChild; )
|
|
1970
|
+
J.appendChild(_.firstChild);
|
|
1971
1971
|
else
|
|
1972
|
-
|
|
1973
|
-
return (
|
|
1972
|
+
J = _;
|
|
1973
|
+
return (X.shadowroot || X.shadowrootmode) && (J = F.call(i, J, !0)), J;
|
|
1974
1974
|
}
|
|
1975
|
-
let ae = Le ?
|
|
1976
|
-
return Le &&
|
|
1977
|
-
` + ae),
|
|
1978
|
-
ae =
|
|
1979
|
-
}),
|
|
1975
|
+
let ae = Le ? _.outerHTML : _.innerHTML;
|
|
1976
|
+
return Le && j["!doctype"] && _.ownerDocument && _.ownerDocument.doctype && _.ownerDocument.doctype.name && ie(As, _.ownerDocument.doctype.name) && (ae = "<!DOCTYPE " + _.ownerDocument.doctype.name + `>
|
|
1977
|
+
` + ae), Ie && bt([he, Ce, H], (Ee) => {
|
|
1978
|
+
ae = et(ae, Ee, " ");
|
|
1979
|
+
}), T && ft ? T.createHTML(ae) : ae;
|
|
1980
1980
|
}, e.setConfig = function() {
|
|
1981
1981
|
let w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1982
|
-
|
|
1982
|
+
Vt(w), $t = !0;
|
|
1983
1983
|
}, e.clearConfig = function() {
|
|
1984
|
-
Fe = null,
|
|
1985
|
-
}, e.isValidAttribute = function(w,
|
|
1986
|
-
Fe ||
|
|
1987
|
-
const b =
|
|
1988
|
-
return
|
|
1989
|
-
}, e.addHook = function(w,
|
|
1990
|
-
typeof
|
|
1991
|
-
}, e.removeHook = function(w,
|
|
1992
|
-
if (
|
|
1993
|
-
const
|
|
1994
|
-
return
|
|
1984
|
+
Fe = null, $t = !1;
|
|
1985
|
+
}, e.isValidAttribute = function(w, d, _) {
|
|
1986
|
+
Fe || Vt({});
|
|
1987
|
+
const b = Y(w), U = Y(d);
|
|
1988
|
+
return $i(b, U, _);
|
|
1989
|
+
}, e.addHook = function(w, d) {
|
|
1990
|
+
typeof d == "function" && Je(z[w], d);
|
|
1991
|
+
}, e.removeHook = function(w, d) {
|
|
1992
|
+
if (d !== void 0) {
|
|
1993
|
+
const _ = nn(z[w], d);
|
|
1994
|
+
return _ === -1 ? void 0 : on(z[w], _, 1)[0];
|
|
1995
1995
|
}
|
|
1996
|
-
return
|
|
1996
|
+
return Qi(z[w]);
|
|
1997
1997
|
}, e.removeHooks = function(w) {
|
|
1998
|
-
|
|
1998
|
+
z[w] = [];
|
|
1999
1999
|
}, e.removeAllHooks = function() {
|
|
2000
|
-
|
|
2000
|
+
z = ns();
|
|
2001
2001
|
}, e;
|
|
2002
2002
|
}
|
|
2003
|
-
var kn =
|
|
2004
|
-
const En = ["innerHTML"], Tn = "Markdown", Rn = /* @__PURE__ */
|
|
2003
|
+
var kn = Ds();
|
|
2004
|
+
const En = ["innerHTML"], Tn = "Markdown", Rn = /* @__PURE__ */ ce({
|
|
2005
2005
|
inheritAttrs: !1,
|
|
2006
2006
|
__name: "Markdown",
|
|
2007
2007
|
props: {
|
|
@@ -2012,21 +2012,21 @@ const En = ["innerHTML"], Tn = "Markdown", Rn = /* @__PURE__ */ ue({
|
|
|
2012
2012
|
},
|
|
2013
2013
|
emits: ["update:markdownText", "changeMode"],
|
|
2014
2014
|
setup(o, { emit: e }) {
|
|
2015
|
-
const t = o, i = e, s =
|
|
2016
|
-
|
|
2015
|
+
const t = o, i = e, s = as([{ comp: fs, event: a, tooltip: "Edit Markdown" }]);
|
|
2016
|
+
O.setOptions({
|
|
2017
2017
|
gfm: !0,
|
|
2018
2018
|
breaks: !0
|
|
2019
2019
|
});
|
|
2020
|
-
const r =
|
|
2021
|
-
|
|
2020
|
+
const r = $(t.markdownText ?? "");
|
|
2021
|
+
pe(() => t.markdownText, (h) => {
|
|
2022
2022
|
h !== void 0 && h !== r.value && (r.value = h);
|
|
2023
2023
|
});
|
|
2024
|
-
const l =
|
|
2025
|
-
|
|
2024
|
+
const l = $(t.mode ? t.mode === "edit" : !1);
|
|
2025
|
+
pe(() => t.mode, (h) => {
|
|
2026
2026
|
h && (l.value = h === "edit");
|
|
2027
2027
|
});
|
|
2028
|
-
const n =
|
|
2029
|
-
const h = t.inputFormat === "html" ? r.value ?? "" :
|
|
2028
|
+
const n = de(() => {
|
|
2029
|
+
const h = t.inputFormat === "html" ? r.value ?? "" : O.parse(r.value ?? "");
|
|
2030
2030
|
return t.sanitize === !1 ? h : kn.sanitize(h);
|
|
2031
2031
|
});
|
|
2032
2032
|
function u() {
|
|
@@ -2035,21 +2035,21 @@ const En = ["innerHTML"], Tn = "Markdown", Rn = /* @__PURE__ */ ue({
|
|
|
2035
2035
|
function a() {
|
|
2036
2036
|
l.value = !l.value, i("changeMode", l.value ? "edit" : "preview");
|
|
2037
2037
|
}
|
|
2038
|
-
return (h, p) => (
|
|
2039
|
-
|
|
2038
|
+
return (h, p) => (E(), M(Ae, null, [
|
|
2039
|
+
Et(h.$slots, "default", {
|
|
2040
2040
|
widgetName: Tn,
|
|
2041
2041
|
childIcons: s.value
|
|
2042
2042
|
}, void 0, !0),
|
|
2043
|
-
|
|
2044
|
-
l.value ?
|
|
2043
|
+
D("div", ai({ class: "markdown-widget-wrap" }, h.$attrs), [
|
|
2044
|
+
l.value ? Ne((E(), M("textarea", {
|
|
2045
2045
|
key: 0,
|
|
2046
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
2046
|
+
"onUpdate:modelValue": p[0] || (p[0] = (c) => r.value = c),
|
|
2047
2047
|
onInput: u,
|
|
2048
2048
|
class: "markdown-input",
|
|
2049
2049
|
placeholder: "Write markdown here…"
|
|
2050
2050
|
}, null, 544)), [
|
|
2051
2051
|
[qs, r.value]
|
|
2052
|
-
]) : (
|
|
2052
|
+
]) : (E(), M("div", {
|
|
2053
2053
|
key: 1,
|
|
2054
2054
|
class: "markdown-output",
|
|
2055
2055
|
innerHTML: n.value
|
|
@@ -2057,7 +2057,7 @@ const En = ["innerHTML"], Tn = "Markdown", Rn = /* @__PURE__ */ ue({
|
|
|
2057
2057
|
], 16)
|
|
2058
2058
|
], 64));
|
|
2059
2059
|
}
|
|
2060
|
-
}), yo = /* @__PURE__ */
|
|
2060
|
+
}), yo = /* @__PURE__ */ De(Rn, [["__scopeId", "data-v-5bf532d5"]]);
|
|
2061
2061
|
function Sn(o, e, t, i, s) {
|
|
2062
2062
|
let r = (...l) => (console.warn("gridstack.js: Function `" + t + "` is deprecated in " + s + " and has been replaced with `" + i + "`. It will be **removed** in a future release"), e.apply(o, l));
|
|
2063
2063
|
return r.prototype = e.prototype, r;
|
|
@@ -2359,7 +2359,7 @@ class f {
|
|
|
2359
2359
|
), (i || e.target).dispatchEvent(s);
|
|
2360
2360
|
}
|
|
2361
2361
|
}
|
|
2362
|
-
class
|
|
2362
|
+
class ve {
|
|
2363
2363
|
constructor(e = {}) {
|
|
2364
2364
|
this.addedNodes = [], this.removedNodes = [], this.column = e.column || 12, this.maxRow = e.maxRow, this._float = e.float, this.nodes = e.nodes || [], this.onChange = e.onChange;
|
|
2365
2365
|
}
|
|
@@ -2410,8 +2410,8 @@ class _e {
|
|
|
2410
2410
|
return;
|
|
2411
2411
|
let a = u._rect, h = Number.MAX_VALUE, p = Number.MAX_VALUE;
|
|
2412
2412
|
s.y < a.y ? h = (r.y + r.h - a.y) / a.h : s.y + s.h > a.y + a.h && (h = (a.y + a.h - r.y) / a.h), s.x < a.x ? p = (r.x + r.w - a.x) / a.w : s.x + s.w > a.x + a.w && (p = (a.x + a.w - r.x) / a.w);
|
|
2413
|
-
let
|
|
2414
|
-
|
|
2413
|
+
let c = Math.min(p, h);
|
|
2414
|
+
c > n && (n = c, l = u);
|
|
2415
2415
|
}), t.collide = l, l;
|
|
2416
2416
|
}
|
|
2417
2417
|
/** does a pixel coverage returning the node that has the most coverage by area */
|
|
@@ -2525,7 +2525,7 @@ class _e {
|
|
|
2525
2525
|
* @param resizing if out of bound, resize down or move into the grid to fit ?
|
|
2526
2526
|
*/
|
|
2527
2527
|
prepareNode(e, t) {
|
|
2528
|
-
e._id = e._id ??
|
|
2528
|
+
e._id = e._id ?? ve._idSeq++, (e.x === void 0 || e.y === void 0 || e.x === null || e.y === null) && (e.autoPosition = !0);
|
|
2529
2529
|
let i = { x: 0, y: 0, w: 1, h: 1 };
|
|
2530
2530
|
return f.defaults(e, i), e.autoPosition || delete e.autoPosition, e.noResize || delete e.noResize, e.noMove || delete e.noMove, f.sanitizeMinMax(e), typeof e.x == "string" && (e.x = Number(e.x)), typeof e.y == "string" && (e.y = Number(e.y)), typeof e.w == "string" && (e.w = Number(e.w)), typeof e.h == "string" && (e.h = Number(e.h)), isNaN(e.x) && (e.x = i.x, e.autoPosition = !0), isNaN(e.y) && (e.y = i.y, e.autoPosition = !0), isNaN(e.w) && (e.w = i.w), isNaN(e.h) && (e.h = i.h), this.nodeBoundFix(e, t), e;
|
|
2531
2531
|
}
|
|
@@ -2607,7 +2607,7 @@ class _e {
|
|
|
2607
2607
|
return !1;
|
|
2608
2608
|
if (t.pack = !0, !this.maxRow)
|
|
2609
2609
|
return this.moveNode(e, t);
|
|
2610
|
-
let i, s = new
|
|
2610
|
+
let i, s = new ve({
|
|
2611
2611
|
column: this.column,
|
|
2612
2612
|
float: this.float,
|
|
2613
2613
|
nodes: this.nodes.map((l) => l._id === e._id ? (i = { ...l }, i) : { ...l })
|
|
@@ -2629,7 +2629,7 @@ class _e {
|
|
|
2629
2629
|
willItFit(e) {
|
|
2630
2630
|
if (delete e._willFitPos, !this.maxRow)
|
|
2631
2631
|
return !0;
|
|
2632
|
-
let t = new
|
|
2632
|
+
let t = new ve({
|
|
2633
2633
|
column: this.column,
|
|
2634
2634
|
float: this.float,
|
|
2635
2635
|
nodes: this.nodes.map((s) => ({ ...s }))
|
|
@@ -2653,12 +2653,12 @@ class _e {
|
|
|
2653
2653
|
return !1;
|
|
2654
2654
|
let l = f.copyPos({}, e), n = this.collideAll(e, r, t.skip), u = !0;
|
|
2655
2655
|
if (n.length) {
|
|
2656
|
-
let p = e._moving && !t.nested,
|
|
2657
|
-
if (p &&
|
|
2658
|
-
let
|
|
2659
|
-
|
|
2656
|
+
let p = e._moving && !t.nested, c = p ? this.directionCollideCoverage(e, t, n) : n[0];
|
|
2657
|
+
if (p && c && ((h = (a = e.grid) == null ? void 0 : a.opts) != null && h.subGridDynamic) && !e.grid._isTemp) {
|
|
2658
|
+
let y = f.areaIntercept(t.rect, c._rect), v = f.area(t.rect), R = f.area(c._rect);
|
|
2659
|
+
y / (v < R ? v : R) > 0.8 && (c.grid.makeSubGrid(c.el, void 0, e), c = void 0);
|
|
2660
2660
|
}
|
|
2661
|
-
|
|
2661
|
+
c ? u = !this._fixCollisions(e, r, c, t) : (u = !1, i && delete t.pack);
|
|
2662
2662
|
}
|
|
2663
2663
|
return u && (e._dirty = !0, f.copyPos(e, r)), t.pack && this._packNodes()._notify(), !f.samePos(e, l);
|
|
2664
2664
|
}
|
|
@@ -2730,17 +2730,17 @@ class _e {
|
|
|
2730
2730
|
const a = this._layouts[t] || [];
|
|
2731
2731
|
let h = this._layouts.length - 1;
|
|
2732
2732
|
!a.length && e !== h && ((u = this._layouts[h]) != null && u.length) && (e = h, this._layouts[h].forEach((p) => {
|
|
2733
|
-
let
|
|
2734
|
-
|
|
2733
|
+
let c = i.find((y) => y._id === p._id);
|
|
2734
|
+
c && (!r && !p.autoPosition && (c.x = p.x ?? c.x, c.y = p.y ?? c.y), c.w = p.w ?? c.w, (p.x == null || p.y === void 0) && (c.autoPosition = !0));
|
|
2735
2735
|
})), a.forEach((p) => {
|
|
2736
|
-
let
|
|
2737
|
-
if (
|
|
2738
|
-
const
|
|
2736
|
+
let c = i.findIndex((y) => y._id === p._id);
|
|
2737
|
+
if (c !== -1) {
|
|
2738
|
+
const y = i[c];
|
|
2739
2739
|
if (r) {
|
|
2740
|
-
|
|
2740
|
+
y.w = p.w;
|
|
2741
2741
|
return;
|
|
2742
2742
|
}
|
|
2743
|
-
(p.autoPosition || isNaN(p.x) || isNaN(p.y)) && this.findEmptyPosition(p, l), p.autoPosition || (
|
|
2743
|
+
(p.autoPosition || isNaN(p.x) || isNaN(p.y)) && this.findEmptyPosition(p, l), p.autoPosition || (y.x = p.x ?? y.x, y.y = p.y ?? y.y, y.w = p.w ?? y.w, l.push(y)), i.splice(c, 1);
|
|
2744
2744
|
}
|
|
2745
2745
|
});
|
|
2746
2746
|
}
|
|
@@ -2752,8 +2752,8 @@ class _e {
|
|
|
2752
2752
|
s(t, e, l, i);
|
|
2753
2753
|
else if (!n) {
|
|
2754
2754
|
let a = r || s === "none" ? 1 : t / e, h = s === "move" || s === "moveScale", p = s === "scale" || s === "moveScale";
|
|
2755
|
-
i.forEach((
|
|
2756
|
-
|
|
2755
|
+
i.forEach((c) => {
|
|
2756
|
+
c.x = t === 1 ? 0 : h ? Math.round(c.x * a) : Math.min(c.x, t - 1), c.w = t === 1 || e === 1 ? 1 : p ? Math.round(c.w * a) || 1 : Math.min(c.w, t), l.push(c);
|
|
2757
2757
|
}), i = [];
|
|
2758
2758
|
}
|
|
2759
2759
|
}
|
|
@@ -2774,7 +2774,7 @@ class _e {
|
|
|
2774
2774
|
return e.forEach((r, l) => {
|
|
2775
2775
|
if (r._id === void 0) {
|
|
2776
2776
|
const n = r.id ? this.nodes.find((u) => u.id === r.id) : void 0;
|
|
2777
|
-
r._id = (n == null ? void 0 : n._id) ??
|
|
2777
|
+
r._id = (n == null ? void 0 : n._id) ?? ve._idSeq++;
|
|
2778
2778
|
}
|
|
2779
2779
|
s[l] = { x: r.x, y: r.y, w: r.w, _id: r._id };
|
|
2780
2780
|
}), this._layouts = i ? [] : this._layouts || [], this._layouts[t] = s, this;
|
|
@@ -2785,7 +2785,7 @@ class _e {
|
|
|
2785
2785
|
* @param column corresponding column index to save it under
|
|
2786
2786
|
*/
|
|
2787
2787
|
cacheOneLayout(e, t) {
|
|
2788
|
-
e._id = e._id ??
|
|
2788
|
+
e._id = e._id ?? ve._idSeq++;
|
|
2789
2789
|
let i = { x: e.x, y: e.y, w: e.w, _id: e._id };
|
|
2790
2790
|
(e.autoPosition || e.x === void 0) && (delete i.x, delete i.y, e.autoPosition && (i.autoPosition = !0)), this._layouts = this._layouts || [], this._layouts[t] = this._layouts[t] || [];
|
|
2791
2791
|
let s = this.findCacheLayout(e, t);
|
|
@@ -2809,8 +2809,8 @@ class _e {
|
|
|
2809
2809
|
return this;
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
|
-
|
|
2813
|
-
const
|
|
2812
|
+
ve._idSeq = 0;
|
|
2813
|
+
const ue = {
|
|
2814
2814
|
alwaysShowResizeHandle: "mobile",
|
|
2815
2815
|
animate: !0,
|
|
2816
2816
|
auto: !0,
|
|
@@ -2850,10 +2850,10 @@ const he = {
|
|
|
2850
2850
|
};
|
|
2851
2851
|
class k {
|
|
2852
2852
|
}
|
|
2853
|
-
const
|
|
2854
|
-
class
|
|
2853
|
+
const me = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2854
|
+
class be {
|
|
2855
2855
|
}
|
|
2856
|
-
function
|
|
2856
|
+
function At(o, e) {
|
|
2857
2857
|
if (o.touches.length > 1)
|
|
2858
2858
|
return;
|
|
2859
2859
|
o.cancelable && o.preventDefault();
|
|
@@ -2891,7 +2891,7 @@ function St(o, e) {
|
|
|
2891
2891
|
// relatedTarget
|
|
2892
2892
|
), o.target.dispatchEvent(i);
|
|
2893
2893
|
}
|
|
2894
|
-
function
|
|
2894
|
+
function Ls(o, e) {
|
|
2895
2895
|
o.cancelable && o.preventDefault();
|
|
2896
2896
|
const t = document.createEvent("MouseEvents");
|
|
2897
2897
|
t.initMouseEvent(
|
|
@@ -2927,46 +2927,46 @@ function Ds(o, e) {
|
|
|
2927
2927
|
// relatedTarget
|
|
2928
2928
|
), o.target.dispatchEvent(t);
|
|
2929
2929
|
}
|
|
2930
|
-
function
|
|
2931
|
-
|
|
2930
|
+
function Dt(o) {
|
|
2931
|
+
be.touchHandled || (be.touchHandled = !0, At(o, "mousedown"));
|
|
2932
2932
|
}
|
|
2933
|
-
function
|
|
2934
|
-
|
|
2933
|
+
function Lt(o) {
|
|
2934
|
+
be.touchHandled && At(o, "mousemove");
|
|
2935
2935
|
}
|
|
2936
|
-
function
|
|
2937
|
-
if (!
|
|
2936
|
+
function zt(o) {
|
|
2937
|
+
if (!be.touchHandled)
|
|
2938
2938
|
return;
|
|
2939
|
-
|
|
2939
|
+
be.pointerLeaveTimeout && (window.clearTimeout(be.pointerLeaveTimeout), delete be.pointerLeaveTimeout);
|
|
2940
2940
|
const e = !!k.dragElement;
|
|
2941
|
-
|
|
2941
|
+
At(o, "mouseup"), e || At(o, "click"), be.touchHandled = !1;
|
|
2942
2942
|
}
|
|
2943
|
-
function
|
|
2943
|
+
function Nt(o) {
|
|
2944
2944
|
o.pointerType !== "mouse" && o.target.releasePointerCapture(o.pointerId);
|
|
2945
2945
|
}
|
|
2946
|
-
function ns(o) {
|
|
2947
|
-
k.dragElement && o.pointerType !== "mouse" && Ds(o, "mouseenter");
|
|
2948
|
-
}
|
|
2949
2946
|
function os(o) {
|
|
2950
|
-
k.dragElement && o.pointerType !== "mouse" && (
|
|
2951
|
-
|
|
2947
|
+
k.dragElement && o.pointerType !== "mouse" && Ls(o, "mouseenter");
|
|
2948
|
+
}
|
|
2949
|
+
function ls(o) {
|
|
2950
|
+
k.dragElement && o.pointerType !== "mouse" && (be.pointerLeaveTimeout = window.setTimeout(() => {
|
|
2951
|
+
delete be.pointerLeaveTimeout, Ls(o, "mouseleave");
|
|
2952
2952
|
}, 10));
|
|
2953
2953
|
}
|
|
2954
|
-
class
|
|
2954
|
+
class It {
|
|
2955
2955
|
constructor(e, t, i) {
|
|
2956
2956
|
this.moving = !1, this.host = e, this.dir = t, this.option = i, this._mouseDown = this._mouseDown.bind(this), this._mouseMove = this._mouseMove.bind(this), this._mouseUp = this._mouseUp.bind(this), this._init();
|
|
2957
2957
|
}
|
|
2958
2958
|
/** @internal */
|
|
2959
2959
|
_init() {
|
|
2960
2960
|
const e = document.createElement("div");
|
|
2961
|
-
return e.classList.add("ui-resizable-handle"), e.classList.add(`${
|
|
2961
|
+
return e.classList.add("ui-resizable-handle"), e.classList.add(`${It.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.el = e, this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), me && (this.el.addEventListener("touchstart", Dt), this.el.addEventListener("pointerdown", Nt)), this;
|
|
2962
2962
|
}
|
|
2963
2963
|
/** call this when resize handle needs to be removed and cleaned up */
|
|
2964
2964
|
destroy() {
|
|
2965
|
-
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown),
|
|
2965
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), me && (this.el.removeEventListener("touchstart", Dt), this.el.removeEventListener("pointerdown", Nt)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
2966
2966
|
}
|
|
2967
2967
|
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
|
|
2968
2968
|
_mouseDown(e) {
|
|
2969
|
-
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
2969
|
+
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0), me && (this.el.addEventListener("touchmove", Lt), this.el.addEventListener("touchend", zt)), e.stopPropagation(), e.preventDefault();
|
|
2970
2970
|
}
|
|
2971
2971
|
/** @internal */
|
|
2972
2972
|
_mouseMove(e) {
|
|
@@ -2975,15 +2975,15 @@ class Mt {
|
|
|
2975
2975
|
}
|
|
2976
2976
|
/** @internal */
|
|
2977
2977
|
_mouseUp(e) {
|
|
2978
|
-
this.moving && this._triggerEvent("stop", e), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
2978
|
+
this.moving && this._triggerEvent("stop", e), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), me && (this.el.removeEventListener("touchmove", Lt), this.el.removeEventListener("touchend", zt)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
|
|
2979
2979
|
}
|
|
2980
2980
|
/** @internal */
|
|
2981
2981
|
_triggerEvent(e, t) {
|
|
2982
2982
|
return this.option[e] && this.option[e](t), this;
|
|
2983
2983
|
}
|
|
2984
2984
|
}
|
|
2985
|
-
|
|
2986
|
-
class
|
|
2985
|
+
It.prefix = "ui-resizable-";
|
|
2986
|
+
class yi {
|
|
2987
2987
|
constructor() {
|
|
2988
2988
|
this._eventRegister = {};
|
|
2989
2989
|
}
|
|
@@ -3011,7 +3011,7 @@ class mi {
|
|
|
3011
3011
|
return this._eventRegister[e](t);
|
|
3012
3012
|
}
|
|
3013
3013
|
}
|
|
3014
|
-
class
|
|
3014
|
+
class nt extends yi {
|
|
3015
3015
|
constructor(e, t = {}) {
|
|
3016
3016
|
super(), this.rectScale = { x: 1, y: 1 }, this._ui = () => {
|
|
3017
3017
|
const s = this.el.parentElement.getBoundingClientRect(), r = {
|
|
@@ -3081,7 +3081,7 @@ class it extends mi {
|
|
|
3081
3081
|
/** @internal */
|
|
3082
3082
|
_setupHandlers() {
|
|
3083
3083
|
let e = this.option.handles || "e,s,se";
|
|
3084
|
-
return e === "all" && (e = "n,e,s,w,se,sw,ne,nw"), this.handlers = e.split(",").map((t) => t.trim()).map((t) => new
|
|
3084
|
+
return e === "all" && (e = "n,e,s,w,se,sw,ne,nw"), this.handlers = e.split(",").map((t) => t.trim()).map((t) => new It(this.el, t, {
|
|
3085
3085
|
start: (i) => {
|
|
3086
3086
|
this._resizeStart(i);
|
|
3087
3087
|
},
|
|
@@ -3112,7 +3112,7 @@ class it extends mi {
|
|
|
3112
3112
|
}
|
|
3113
3113
|
/** @internal */
|
|
3114
3114
|
_setupHelper() {
|
|
3115
|
-
this.elOriginStyleVal =
|
|
3115
|
+
this.elOriginStyleVal = nt._originStyleProp.map((s) => this.el.style[s]), this.parentOriginStylePosition = this.el.parentElement.style.position;
|
|
3116
3116
|
const e = this.el.parentElement, t = document.createElement("div");
|
|
3117
3117
|
f.addElStyles(t, {
|
|
3118
3118
|
opacity: "0",
|
|
@@ -3131,7 +3131,7 @@ class it extends mi {
|
|
|
3131
3131
|
}
|
|
3132
3132
|
/** @internal */
|
|
3133
3133
|
_cleanHelper() {
|
|
3134
|
-
return
|
|
3134
|
+
return nt._originStyleProp.forEach((e, t) => {
|
|
3135
3135
|
this.el.style[e] = this.elOriginStyleVal[t] || null;
|
|
3136
3136
|
}), this.el.parentElement.style.position = this.parentOriginStylePosition || null, this;
|
|
3137
3137
|
}
|
|
@@ -3169,9 +3169,9 @@ class it extends mi {
|
|
|
3169
3169
|
return this.handlers.forEach((e) => e.destroy()), delete this.handlers, this;
|
|
3170
3170
|
}
|
|
3171
3171
|
}
|
|
3172
|
-
|
|
3172
|
+
nt._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
|
|
3173
3173
|
const An = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
|
|
3174
|
-
class
|
|
3174
|
+
class ot extends yi {
|
|
3175
3175
|
constructor(e, t = {}) {
|
|
3176
3176
|
super(), this.dragScale = { x: 1, y: 1 }, this.el = e, this.option = t;
|
|
3177
3177
|
let i = t.handle.substring(1);
|
|
@@ -3184,10 +3184,10 @@ class st extends mi {
|
|
|
3184
3184
|
super.off(e);
|
|
3185
3185
|
}
|
|
3186
3186
|
enable() {
|
|
3187
|
-
this.disabled !== !1 && (super.enable(), this.dragEl.addEventListener("mousedown", this._mouseDown),
|
|
3187
|
+
this.disabled !== !1 && (super.enable(), this.dragEl.addEventListener("mousedown", this._mouseDown), me && (this.dragEl.addEventListener("touchstart", Dt), this.dragEl.addEventListener("pointerdown", Nt)), this.el.classList.remove("ui-draggable-disabled"));
|
|
3188
3188
|
}
|
|
3189
3189
|
disable(e = !1) {
|
|
3190
|
-
this.disabled !== !0 && (super.disable(), this.dragEl.removeEventListener("mousedown", this._mouseDown),
|
|
3190
|
+
this.disabled !== !0 && (super.disable(), this.dragEl.removeEventListener("mousedown", this._mouseDown), me && (this.dragEl.removeEventListener("touchstart", Dt), this.dragEl.removeEventListener("pointerdown", Nt)), e || this.el.classList.add("ui-draggable-disabled"));
|
|
3191
3191
|
}
|
|
3192
3192
|
destroy() {
|
|
3193
3193
|
this.dragTimeout && window.clearTimeout(this.dragTimeout), delete this.dragTimeout, this.mouseDownEvent && this._mouseUp(this.mouseDownEvent), this.disable(!0), delete this.el, delete this.helper, delete this.option, super.destroy();
|
|
@@ -3198,7 +3198,7 @@ class st extends mi {
|
|
|
3198
3198
|
/** @internal call when mouse goes down before a dragstart happens */
|
|
3199
3199
|
_mouseDown(e) {
|
|
3200
3200
|
if (!k.mouseHandled)
|
|
3201
|
-
return e.button !== 0 || e.target.closest(An) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete k.dragElement, delete k.dropElement, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
3201
|
+
return e.button !== 0 || e.target.closest(An) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete k.dragElement, delete k.dropElement, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0), me && (this.dragEl.addEventListener("touchmove", Lt), this.dragEl.addEventListener("touchend", zt)), e.preventDefault(), document.activeElement && document.activeElement.blur(), k.mouseHandled = !0), !0;
|
|
3202
3202
|
}
|
|
3203
3203
|
/** @internal method to call actual drag event */
|
|
3204
3204
|
_callDrag(e) {
|
|
@@ -3229,7 +3229,7 @@ class st extends mi {
|
|
|
3229
3229
|
/** @internal call when the mouse gets released to drop the item at current location */
|
|
3230
3230
|
_mouseUp(e) {
|
|
3231
3231
|
var t;
|
|
3232
|
-
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
3232
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), me && (this.dragEl.removeEventListener("touchmove", Lt, !0), this.dragEl.removeEventListener("touchend", zt, !0)), this.dragging) {
|
|
3233
3233
|
delete this.dragging, ((t = k.dropElement) == null ? void 0 : t.el) === this.el.parentElement && delete k.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper === this.el ? this._removeHelperStyle() : this.helper.remove();
|
|
3234
3234
|
const i = f.initEvent(e, { target: this.el, type: "dragstop" });
|
|
3235
3235
|
this.option.stop && this.option.stop(i), this.triggerEvent("dragstop", i), k.dropElement && k.dropElement.drop(e);
|
|
@@ -3239,7 +3239,7 @@ class st extends mi {
|
|
|
3239
3239
|
/** @internal create a clone copy (or user defined method) of the original drag item if set */
|
|
3240
3240
|
_createHelper(e) {
|
|
3241
3241
|
let t = this.el;
|
|
3242
|
-
return typeof this.option.helper == "function" ? t = this.option.helper(e) : this.option.helper === "clone" && (t = f.cloneNode(this.el)), document.body.contains(t) || f.appendTo(t, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), t === this.el && (this.dragElementOriginStyle =
|
|
3242
|
+
return typeof this.option.helper == "function" ? t = this.option.helper(e) : this.option.helper === "clone" && (t = f.cloneNode(this.el)), document.body.contains(t) || f.appendTo(t, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), t === this.el && (this.dragElementOriginStyle = ot.originStyleProp.map((i) => this.el.style[i])), t;
|
|
3243
3243
|
}
|
|
3244
3244
|
/** @internal set the fix position of the dragged item */
|
|
3245
3245
|
_setupHelperStyle(e) {
|
|
@@ -3256,7 +3256,7 @@ class st extends mi {
|
|
|
3256
3256
|
let e = (t = this.helper) == null ? void 0 : t.gridstackNode;
|
|
3257
3257
|
if (!(e != null && e._isAboutToRemove) && this.dragElementOriginStyle) {
|
|
3258
3258
|
let i = this.helper, s = this.dragElementOriginStyle.transition || null;
|
|
3259
|
-
i.style.transition = this.dragElementOriginStyle.transition = "none",
|
|
3259
|
+
i.style.transition = this.dragElementOriginStyle.transition = "none", ot.originStyleProp.forEach((r) => i.style[r] = this.dragElementOriginStyle[r] || null), setTimeout(() => i.style.transition = s, 50);
|
|
3260
3260
|
}
|
|
3261
3261
|
return delete this.dragElementOriginStyle, this;
|
|
3262
3262
|
}
|
|
@@ -3315,8 +3315,8 @@ class st extends mi {
|
|
|
3315
3315
|
};
|
|
3316
3316
|
}
|
|
3317
3317
|
}
|
|
3318
|
-
|
|
3319
|
-
class Dn extends
|
|
3318
|
+
ot.originStyleProp = ["transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
|
|
3319
|
+
class Dn extends yi {
|
|
3320
3320
|
constructor(e, t = {}) {
|
|
3321
3321
|
super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
3322
3322
|
}
|
|
@@ -3327,10 +3327,10 @@ class Dn extends mi {
|
|
|
3327
3327
|
super.off(e);
|
|
3328
3328
|
}
|
|
3329
3329
|
enable() {
|
|
3330
|
-
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave),
|
|
3330
|
+
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave), me && (this.el.addEventListener("pointerenter", os), this.el.addEventListener("pointerleave", ls)));
|
|
3331
3331
|
}
|
|
3332
3332
|
disable(e = !1) {
|
|
3333
|
-
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave),
|
|
3333
|
+
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave), me && (this.el.removeEventListener("pointerenter", os), this.el.removeEventListener("pointerleave", ls)));
|
|
3334
3334
|
}
|
|
3335
3335
|
destroy() {
|
|
3336
3336
|
this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
|
|
@@ -3383,9 +3383,9 @@ class Dn extends mi {
|
|
|
3383
3383
|
};
|
|
3384
3384
|
}
|
|
3385
3385
|
}
|
|
3386
|
-
class
|
|
3386
|
+
class vi {
|
|
3387
3387
|
static init(e) {
|
|
3388
|
-
return e.ddElement || (e.ddElement = new
|
|
3388
|
+
return e.ddElement || (e.ddElement = new vi(e)), e.ddElement;
|
|
3389
3389
|
}
|
|
3390
3390
|
constructor(e) {
|
|
3391
3391
|
this.el = e;
|
|
@@ -3397,13 +3397,13 @@ class _i {
|
|
|
3397
3397
|
return this.ddDraggable && ["drag", "dragstart", "dragstop"].indexOf(e) > -1 ? this.ddDraggable.off(e) : this.ddDroppable && ["drop", "dropover", "dropout"].indexOf(e) > -1 ? this.ddDroppable.off(e) : this.ddResizable && ["resizestart", "resize", "resizestop"].indexOf(e) > -1 && this.ddResizable.off(e), this;
|
|
3398
3398
|
}
|
|
3399
3399
|
setupDraggable(e) {
|
|
3400
|
-
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new
|
|
3400
|
+
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new ot(this.el, e), this;
|
|
3401
3401
|
}
|
|
3402
3402
|
cleanDraggable() {
|
|
3403
3403
|
return this.ddDraggable && (this.ddDraggable.destroy(), delete this.ddDraggable), this;
|
|
3404
3404
|
}
|
|
3405
3405
|
setupResizable(e) {
|
|
3406
|
-
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new
|
|
3406
|
+
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new nt(this.el, e), this;
|
|
3407
3407
|
}
|
|
3408
3408
|
cleanResizable() {
|
|
3409
3409
|
return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
|
|
@@ -3491,7 +3491,7 @@ class Ln {
|
|
|
3491
3491
|
let i = f.getElements(e);
|
|
3492
3492
|
if (!i.length)
|
|
3493
3493
|
return [];
|
|
3494
|
-
let s = i.map((r) => r.ddElement || (t ?
|
|
3494
|
+
let s = i.map((r) => r.ddElement || (t ? vi.init(r) : null));
|
|
3495
3495
|
return t || s.filter((r) => r), s;
|
|
3496
3496
|
}
|
|
3497
3497
|
}
|
|
@@ -3502,8 +3502,8 @@ class Ln {
|
|
|
3502
3502
|
* Copyright (c) 2021-2022 Alain Dumesny
|
|
3503
3503
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
3504
3504
|
*/
|
|
3505
|
-
const
|
|
3506
|
-
class
|
|
3505
|
+
const Z = new Ln();
|
|
3506
|
+
class A {
|
|
3507
3507
|
/**
|
|
3508
3508
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
3509
3509
|
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
|
|
@@ -3518,8 +3518,8 @@ class z {
|
|
|
3518
3518
|
* let grid = document.querySelector('.grid-stack').gridstack;
|
|
3519
3519
|
*/
|
|
3520
3520
|
static init(e = {}, t = ".grid-stack") {
|
|
3521
|
-
let i =
|
|
3522
|
-
return i ? (i.gridstack || (i.gridstack = new
|
|
3521
|
+
let i = A.getGridElement(t);
|
|
3522
|
+
return i ? (i.gridstack || (i.gridstack = new A(i, f.cloneDeep(e))), i.gridstack) : (console.error(typeof t == "string" ? 'GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
3523
3523
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.` : "GridStack.init() no grid element was passed."), null);
|
|
3524
3524
|
}
|
|
3525
3525
|
/**
|
|
@@ -3533,8 +3533,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3533
3533
|
*/
|
|
3534
3534
|
static initAll(e = {}, t = ".grid-stack") {
|
|
3535
3535
|
let i = [];
|
|
3536
|
-
return
|
|
3537
|
-
s.gridstack || (s.gridstack = new
|
|
3536
|
+
return A.getGridElements(t).forEach((s) => {
|
|
3537
|
+
s.gridstack || (s.gridstack = new A(s, f.cloneDeep(e))), i.push(s.gridstack);
|
|
3538
3538
|
}), i.length === 0 && console.error('GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
3539
3539
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`), i;
|
|
3540
3540
|
}
|
|
@@ -3553,27 +3553,27 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3553
3553
|
const l = i.gridstack;
|
|
3554
3554
|
return t && (l.opts = { ...l.opts, ...t }), t.children !== void 0 && l.load(t.children), l;
|
|
3555
3555
|
}
|
|
3556
|
-
if (!e.classList.contains("grid-stack") ||
|
|
3557
|
-
if (
|
|
3558
|
-
i =
|
|
3556
|
+
if (!e.classList.contains("grid-stack") || A.addRemoveCB)
|
|
3557
|
+
if (A.addRemoveCB)
|
|
3558
|
+
i = A.addRemoveCB(e, t, !0, !0);
|
|
3559
3559
|
else {
|
|
3560
3560
|
let l = document.implementation.createHTMLDocument("");
|
|
3561
3561
|
l.body.innerHTML = `<div class="grid-stack ${t.class || ""}"></div>`, i = l.body.children[0], e.appendChild(i);
|
|
3562
3562
|
}
|
|
3563
|
-
return
|
|
3563
|
+
return A.init(t, i);
|
|
3564
3564
|
}
|
|
3565
3565
|
/** call this method to register your engine instead of the default one.
|
|
3566
3566
|
* See instead `GridStackOptions.engineClass` if you only need to
|
|
3567
3567
|
* replace just one instance.
|
|
3568
3568
|
*/
|
|
3569
3569
|
static registerEngine(e) {
|
|
3570
|
-
|
|
3570
|
+
A.engineClass = e;
|
|
3571
3571
|
}
|
|
3572
3572
|
/** @internal create placeholder DIV as needed */
|
|
3573
3573
|
get placeholder() {
|
|
3574
3574
|
if (!this._placeholder) {
|
|
3575
3575
|
let e = document.createElement("div");
|
|
3576
|
-
e.className = "placeholder-content", this.opts.placeholderText && (e.innerHTML = this.opts.placeholderText), this._placeholder = document.createElement("div"), this._placeholder.classList.add(this.opts.placeholderClass,
|
|
3576
|
+
e.className = "placeholder-content", this.opts.placeholderText && (e.innerHTML = this.opts.placeholderText), this._placeholder = document.createElement("div"), this._placeholder.classList.add(this.opts.placeholderClass, ue.itemClass, this.opts.itemClass), this.placeholder.appendChild(e);
|
|
3577
3577
|
}
|
|
3578
3578
|
return this._placeholder;
|
|
3579
3579
|
}
|
|
@@ -3588,35 +3588,35 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3588
3588
|
let i = f.toNumber(e.getAttribute("gs-row"));
|
|
3589
3589
|
t.column === "auto" && delete t.column, t.alwaysShowResizeHandle !== void 0 && (t._alwaysShowResizeHandle = t.alwaysShowResizeHandle);
|
|
3590
3590
|
let s = {
|
|
3591
|
-
...f.cloneDeep(
|
|
3592
|
-
column: f.toNumber(e.getAttribute("gs-column")) ||
|
|
3593
|
-
minRow: i || f.toNumber(e.getAttribute("gs-min-row")) ||
|
|
3594
|
-
maxRow: i || f.toNumber(e.getAttribute("gs-max-row")) ||
|
|
3595
|
-
staticGrid: f.toBool(e.getAttribute("gs-static")) ||
|
|
3591
|
+
...f.cloneDeep(ue),
|
|
3592
|
+
column: f.toNumber(e.getAttribute("gs-column")) || ue.column,
|
|
3593
|
+
minRow: i || f.toNumber(e.getAttribute("gs-min-row")) || ue.minRow,
|
|
3594
|
+
maxRow: i || f.toNumber(e.getAttribute("gs-max-row")) || ue.maxRow,
|
|
3595
|
+
staticGrid: f.toBool(e.getAttribute("gs-static")) || ue.staticGrid,
|
|
3596
3596
|
draggable: {
|
|
3597
|
-
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") ||
|
|
3597
|
+
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") || ue.draggable.handle
|
|
3598
3598
|
},
|
|
3599
3599
|
removableOptions: {
|
|
3600
|
-
accept: t.itemClass ||
|
|
3601
|
-
decline:
|
|
3600
|
+
accept: t.itemClass || ue.removableOptions.accept,
|
|
3601
|
+
decline: ue.removableOptions.decline
|
|
3602
3602
|
}
|
|
3603
3603
|
};
|
|
3604
3604
|
e.getAttribute("gs-animate") && (s.animate = f.toBool(e.getAttribute("gs-animate"))), this.opts = f.defaults(t, s), t = null, this._initMargin(), this.opts.column !== 1 && !this.opts.disableOneColumnMode && this._widthOrContainer() <= this.opts.oneColumnSize && (this._prevColumn = this.getColumn(), this.opts.column = 1), this.opts.rtl === "auto" && (this.opts.rtl = e.style.direction === "rtl"), this.opts.rtl && this.el.classList.add("grid-stack-rtl");
|
|
3605
3605
|
const r = (u = this.el.parentElement) == null ? void 0 : u.parentElement;
|
|
3606
|
-
let l = r != null && r.classList.contains(
|
|
3607
|
-
l && (l.subGrid = this, this.parentGridItem = l, this.el.classList.add("grid-stack-nested"), l.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = this.opts.cellHeight === "auto", this._isAutoCellHeight || this.opts.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof this.opts.cellHeight == "number" && this.opts.cellHeightUnit && this.opts.cellHeightUnit !==
|
|
3608
|
-
let n = this.opts.engineClass ||
|
|
3606
|
+
let l = r != null && r.classList.contains(ue.itemClass) ? r.gridstackNode : void 0;
|
|
3607
|
+
l && (l.subGrid = this, this.parentGridItem = l, this.el.classList.add("grid-stack-nested"), l.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = this.opts.cellHeight === "auto", this._isAutoCellHeight || this.opts.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof this.opts.cellHeight == "number" && this.opts.cellHeightUnit && this.opts.cellHeightUnit !== ue.cellHeightUnit && (this.opts.cellHeight = this.opts.cellHeight + this.opts.cellHeightUnit, delete this.opts.cellHeightUnit), this.cellHeight(this.opts.cellHeight, !1)), this.opts.alwaysShowResizeHandle === "mobile" && (this.opts.alwaysShowResizeHandle = me), this._styleSheetClass = "gs-id-" + ve._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
3608
|
+
let n = this.opts.engineClass || A.engineClass || ve;
|
|
3609
3609
|
if (this.engine = new n({
|
|
3610
3610
|
column: this.getColumn(),
|
|
3611
3611
|
float: this.opts.float,
|
|
3612
3612
|
maxRow: this.opts.maxRow,
|
|
3613
3613
|
onChange: (h) => {
|
|
3614
3614
|
let p = 0;
|
|
3615
|
-
this.engine.nodes.forEach((
|
|
3616
|
-
p = Math.max(p,
|
|
3617
|
-
}), h.forEach((
|
|
3618
|
-
let
|
|
3619
|
-
|
|
3615
|
+
this.engine.nodes.forEach((c) => {
|
|
3616
|
+
p = Math.max(p, c.y + c.h);
|
|
3617
|
+
}), h.forEach((c) => {
|
|
3618
|
+
let y = c.el;
|
|
3619
|
+
y && (c._removeDOM ? (y && y.remove(), delete c._removeDOM) : this._writePosAttr(y, c));
|
|
3620
3620
|
}), this._updateStyles(!1, p);
|
|
3621
3621
|
}
|
|
3622
3622
|
}), this.opts.auto && (this.batchUpdate(), this.getGridItems().forEach((h) => this._prepareElement(h)), this.batchUpdate(!1)), this.opts.children) {
|
|
@@ -3651,8 +3651,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3651
3651
|
} else if (arguments.length === 0 || arguments.length === 1 && i(e))
|
|
3652
3652
|
if (r = t = e, r != null && r.el)
|
|
3653
3653
|
s = r.el;
|
|
3654
|
-
else if (
|
|
3655
|
-
s =
|
|
3654
|
+
else if (A.addRemoveCB)
|
|
3655
|
+
s = A.addRemoveCB(this.el, t, !0, !1);
|
|
3656
3656
|
else {
|
|
3657
3657
|
let n = (t == null ? void 0 : t.content) || "", u = document.implementation.createHTMLDocument("");
|
|
3658
3658
|
u.body.innerHTML = `<div class="grid-stack-item ${this.opts.itemClass || ""}"><div class="grid-stack-item-content">${n}</div></div>`, s = u.body.children[0];
|
|
@@ -3675,32 +3675,32 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3675
3675
|
* @returns newly created grid
|
|
3676
3676
|
*/
|
|
3677
3677
|
makeSubGrid(e, t, i, s = !0) {
|
|
3678
|
-
var
|
|
3678
|
+
var y, v, R;
|
|
3679
3679
|
let r = e.gridstackNode;
|
|
3680
|
-
if (r || (r = this.makeWidget(e).gridstackNode), (
|
|
3680
|
+
if (r || (r = this.makeWidget(e).gridstackNode), (y = r.subGrid) != null && y.el)
|
|
3681
3681
|
return r.subGrid;
|
|
3682
3682
|
let l, n = this;
|
|
3683
3683
|
for (; n && !l; )
|
|
3684
|
-
l = (v = n.opts) == null ? void 0 : v.subGridOpts, n = (
|
|
3684
|
+
l = (v = n.opts) == null ? void 0 : v.subGridOpts, n = (R = n.parentGridItem) == null ? void 0 : R.grid;
|
|
3685
3685
|
t = f.cloneDeep({ ...l || {}, children: void 0, ...t || r.subGridOpts }), r.subGridOpts = t;
|
|
3686
3686
|
let u;
|
|
3687
3687
|
t.column === "auto" && (u = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), t.disableOneColumnMode = !0);
|
|
3688
3688
|
let a = r.el.querySelector(".grid-stack-item-content"), h, p;
|
|
3689
3689
|
if (s) {
|
|
3690
|
-
if (this._removeDD(r.el), p = { ...r, x: 0, y: 0 }, f.removeInternalForSave(p), delete p.subGridOpts, r.content && (p.content = r.content, delete r.content),
|
|
3691
|
-
h =
|
|
3690
|
+
if (this._removeDD(r.el), p = { ...r, x: 0, y: 0 }, f.removeInternalForSave(p), delete p.subGridOpts, r.content && (p.content = r.content, delete r.content), A.addRemoveCB)
|
|
3691
|
+
h = A.addRemoveCB(this.el, p, !0, !1);
|
|
3692
3692
|
else {
|
|
3693
|
-
let
|
|
3694
|
-
|
|
3693
|
+
let N = document.implementation.createHTMLDocument("");
|
|
3694
|
+
N.body.innerHTML = '<div class="grid-stack-item"></div>', h = N.body.children[0], h.appendChild(a), N.body.innerHTML = '<div class="grid-stack-item-content"></div>', a = N.body.children[0], r.el.appendChild(a);
|
|
3695
3695
|
}
|
|
3696
3696
|
this._prepareDragDropByNode(r);
|
|
3697
3697
|
}
|
|
3698
3698
|
if (i) {
|
|
3699
|
-
let
|
|
3700
|
-
|
|
3699
|
+
let N = u ? t.column : r.w, x = r.h + i.h, S = r.el.style;
|
|
3700
|
+
S.transition = "none", this.update(r.el, { w: N, h: x }), setTimeout(() => S.transition = null);
|
|
3701
3701
|
}
|
|
3702
|
-
let
|
|
3703
|
-
return i != null && i._moving && (
|
|
3702
|
+
let c = r.subGrid = A.addGrid(a, t);
|
|
3703
|
+
return i != null && i._moving && (c._isTemp = !0), u && (c._autoColumn = !0), s && c.addWidget(h, p), i && (i._moving ? window.setTimeout(() => f.simulateMouseEvent(i._event, "mouseenter", c.el), 0) : c.addWidget(r.el, r)), c;
|
|
3704
3704
|
}
|
|
3705
3705
|
/**
|
|
3706
3706
|
* called when an item was converted into a nested grid to accommodate a dragged over item, but then item leaves - return back
|
|
@@ -3722,7 +3722,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3722
3722
|
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
3723
3723
|
* @returns list of widgets or full grid option, including .children list of widgets
|
|
3724
3724
|
*/
|
|
3725
|
-
save(e = !0, t = !1, i =
|
|
3725
|
+
save(e = !0, t = !1, i = A.saveCB) {
|
|
3726
3726
|
let s = this.engine.save(e, i);
|
|
3727
3727
|
if (s.forEach((r) => {
|
|
3728
3728
|
var l;
|
|
@@ -3738,7 +3738,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3738
3738
|
let r = f.cloneDeep(this.opts);
|
|
3739
3739
|
r.marginBottom === r.marginTop && r.marginRight === r.marginLeft && r.marginTop === r.marginRight && (r.margin = r.marginTop, delete r.marginTop, delete r.marginRight, delete r.marginBottom, delete r.marginLeft), r.rtl === (this.el.style.direction === "rtl") && (r.rtl = "auto"), this._isAutoCellHeight && (r.cellHeight = "auto"), this._autoColumn && (r.column = "auto", delete r.disableOneColumnMode);
|
|
3740
3740
|
const l = r._alwaysShowResizeHandle;
|
|
3741
|
-
return delete r._alwaysShowResizeHandle, l !== void 0 ? r.alwaysShowResizeHandle = l : delete r.alwaysShowResizeHandle, f.removeInternalAndSame(r,
|
|
3741
|
+
return delete r._alwaysShowResizeHandle, l !== void 0 ? r.alwaysShowResizeHandle = l : delete r.alwaysShowResizeHandle, f.removeInternalAndSame(r, ue), r.children = s, r;
|
|
3742
3742
|
}
|
|
3743
3743
|
return s;
|
|
3744
3744
|
}
|
|
@@ -3752,19 +3752,19 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3752
3752
|
* @example
|
|
3753
3753
|
* see http://gridstackjs.com/demo/serialization.html
|
|
3754
3754
|
*/
|
|
3755
|
-
load(e, t =
|
|
3755
|
+
load(e, t = A.addRemoveCB || !0) {
|
|
3756
3756
|
e = f.cloneDeep(e);
|
|
3757
3757
|
const i = e.some((a) => a.x !== void 0 || a.y !== void 0);
|
|
3758
3758
|
i && (e = f.sort(e, -1, this._prevColumn || this.getColumn())), this._insertNotAppend = i;
|
|
3759
3759
|
const s = this.opts.column;
|
|
3760
3760
|
this._prevColumn && this._prevColumn !== s && e.some((a) => (a.x || 0) + a.w > s) && (this._ignoreLayoutsNodeChange = !0, this.engine.cacheLayout(e, this._prevColumn, !0));
|
|
3761
|
-
const r =
|
|
3762
|
-
typeof t == "function" && (
|
|
3761
|
+
const r = A.addRemoveCB;
|
|
3762
|
+
typeof t == "function" && (A.addRemoveCB = t);
|
|
3763
3763
|
let l = [];
|
|
3764
3764
|
this.batchUpdate(), t && [...this.engine.nodes].forEach((h) => {
|
|
3765
3765
|
if (!h.id)
|
|
3766
3766
|
return;
|
|
3767
|
-
f.find(e, h.id) || (
|
|
3767
|
+
f.find(e, h.id) || (A.addRemoveCB && A.addRemoveCB(this.el, h, !1, !1), l.push(h), this.removeWidget(h.el, !0, !1));
|
|
3768
3768
|
});
|
|
3769
3769
|
let n = [];
|
|
3770
3770
|
this.engine.nodes = this.engine.nodes.filter((a) => f.find(e, a.id) ? (n.push(a), !1) : !0);
|
|
@@ -3774,11 +3774,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3774
3774
|
let h = f.find(n, a.id);
|
|
3775
3775
|
if (h) {
|
|
3776
3776
|
if (f.shouldSizeToContent(h) && (a.h = h.h), this.engine.nodeBoundFix(a), (a.autoPosition || a.x === void 0 || a.y === void 0) && (a.w = a.w || h.w, a.h = a.h || h.h, this.engine.findEmptyPosition(a)), u = u || a.w !== void 0 && a.w !== h.w, this.engine.nodes.push(h), f.samePos(h, a) && this.moveNode(h, { ...a, forceCollide: !0 }), this.update(h.el, a), (p = a.subGridOpts) != null && p.children) {
|
|
3777
|
-
let
|
|
3778
|
-
|
|
3777
|
+
let c = h.el.querySelector(".grid-stack");
|
|
3778
|
+
c && c.gridstack && (c.gridstack.load(a.subGridOpts.children), this._insertNotAppend = !0);
|
|
3779
3779
|
}
|
|
3780
3780
|
} else t && this.addWidget(a);
|
|
3781
|
-
}), this.engine.removedNodes = l, this.doContentResize(u, !0), this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this._insertNotAppend, r ?
|
|
3781
|
+
}), this.engine.removedNodes = l, this.doContentResize(u, !0), this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this._insertNotAppend, r ? A.addRemoveCB = r : delete A.addRemoveCB, this;
|
|
3782
3782
|
}
|
|
3783
3783
|
/**
|
|
3784
3784
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3934,7 +3934,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3934
3934
|
* grid.makeWidget('2', {w:2, content: 'hello'});
|
|
3935
3935
|
*/
|
|
3936
3936
|
makeWidget(e, t) {
|
|
3937
|
-
let i =
|
|
3937
|
+
let i = A.getElement(e);
|
|
3938
3938
|
this._prepareElement(i, !0, t);
|
|
3939
3939
|
const s = i.gridstackNode;
|
|
3940
3940
|
return this._updateContainerHeight(), this.doContentResize(!1, !1, s), s.subGridOpts && this.makeSubGrid(i, s.subGridOpts, void 0, !1), this._prevColumn && this.opts.column === 1 && (this._ignoreLayoutsNodeChange = !0), this._triggerAddEvent(), this._triggerChangeEvent(), delete this._ignoreLayoutsNodeChange, i;
|
|
@@ -3976,11 +3976,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3976
3976
|
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
3977
3977
|
*/
|
|
3978
3978
|
removeWidget(e, t = !0, i = !0) {
|
|
3979
|
-
return
|
|
3979
|
+
return A.getElements(e).forEach((s) => {
|
|
3980
3980
|
if (s.parentElement && s.parentElement !== this.el)
|
|
3981
3981
|
return;
|
|
3982
3982
|
let r = s.gridstackNode;
|
|
3983
|
-
r || (r = this.engine.nodes.find((l) => s === l.el)), r && (
|
|
3983
|
+
r || (r = this.engine.nodes.find((l) => s === l.el)), r && (A.addRemoveCB && A.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, t, i), t && s.parentElement && s.remove());
|
|
3984
3984
|
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this;
|
|
3985
3985
|
}
|
|
3986
3986
|
/**
|
|
@@ -4022,7 +4022,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4022
4022
|
let i = arguments, s = 1;
|
|
4023
4023
|
return t = { x: i[s++], y: i[s++], w: i[s++], h: i[s++] }, this.update(e, t);
|
|
4024
4024
|
}
|
|
4025
|
-
return
|
|
4025
|
+
return A.getElements(e).forEach((i) => {
|
|
4026
4026
|
var h;
|
|
4027
4027
|
let s = i == null ? void 0 : i.gridstackNode;
|
|
4028
4028
|
if (!s)
|
|
@@ -4063,30 +4063,30 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4063
4063
|
if (!r)
|
|
4064
4064
|
return;
|
|
4065
4065
|
let l = t && i.h ? i.h * r : e.clientHeight, n;
|
|
4066
|
-
if (i.resizeToContentParent && (n = e.querySelector(i.resizeToContentParent)), n || (n = e.querySelector(
|
|
4066
|
+
if (i.resizeToContentParent && (n = e.querySelector(i.resizeToContentParent)), n || (n = e.querySelector(A.resizeToContentParent)), !n)
|
|
4067
4067
|
return;
|
|
4068
4068
|
const u = e.clientHeight - n.clientHeight, a = t && i.h ? i.h * r - u : n.clientHeight;
|
|
4069
4069
|
let h;
|
|
4070
4070
|
if (i.subGrid)
|
|
4071
4071
|
h = i.subGrid.getRow() * i.subGrid.getCellHeight();
|
|
4072
4072
|
else {
|
|
4073
|
-
const
|
|
4074
|
-
if (!
|
|
4075
|
-
console.log(`Error: resizeToContent() '${
|
|
4073
|
+
const y = n.firstElementChild;
|
|
4074
|
+
if (!y) {
|
|
4075
|
+
console.log(`Error: resizeToContent() '${A.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
4076
4076
|
return;
|
|
4077
4077
|
}
|
|
4078
|
-
h =
|
|
4078
|
+
h = y.getBoundingClientRect().height || a;
|
|
4079
4079
|
}
|
|
4080
4080
|
if (a === h)
|
|
4081
4081
|
return;
|
|
4082
4082
|
l += h - a;
|
|
4083
4083
|
let p = Math.ceil(l / r);
|
|
4084
|
-
const
|
|
4085
|
-
|
|
4084
|
+
const c = Number.isInteger(i.sizeToContent) ? i.sizeToContent : 0;
|
|
4085
|
+
c && p > c && (p = c, e.classList.add("size-to-content-max")), i.minH && p < i.minH ? p = i.minH : i.maxH && p > i.maxH && (p = i.maxH), p !== i.h && (s._ignoreLayoutsNodeChange = !0, s.moveNode(i, { h: p }), delete s._ignoreLayoutsNodeChange);
|
|
4086
4086
|
}
|
|
4087
4087
|
/** call the user resize (so they can do extra work) else our build in version */
|
|
4088
4088
|
resizeToContentCheck(e, t = !1) {
|
|
4089
|
-
|
|
4089
|
+
A.resizeToContentCB ? A.resizeToContentCB(e, t) : this.resizeToContent(e, t);
|
|
4090
4090
|
}
|
|
4091
4091
|
/**
|
|
4092
4092
|
* Updates the margins which will set all 4 sides at once - see `GridStackOptions.margin` for format options (CSS string format of 1,2,4 values or single number).
|
|
@@ -4164,8 +4164,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4164
4164
|
}), !this._styles)
|
|
4165
4165
|
return this;
|
|
4166
4166
|
this._styles._max = 0, f.addCSSRule(this._styles, r, `height: ${i}${s}`);
|
|
4167
|
-
let n = this.opts.marginTop + this.opts.marginUnit, u = this.opts.marginBottom + this.opts.marginUnit, a = this.opts.marginRight + this.opts.marginUnit, h = this.opts.marginLeft + this.opts.marginUnit, p = `${r} > .grid-stack-item-content`,
|
|
4168
|
-
f.addCSSRule(this._styles, p, `top: ${n}; right: ${a}; bottom: ${u}; left: ${h};`), f.addCSSRule(this._styles,
|
|
4167
|
+
let n = this.opts.marginTop + this.opts.marginUnit, u = this.opts.marginBottom + this.opts.marginUnit, a = this.opts.marginRight + this.opts.marginUnit, h = this.opts.marginLeft + this.opts.marginUnit, p = `${r} > .grid-stack-item-content`, c = `.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;
|
|
4168
|
+
f.addCSSRule(this._styles, p, `top: ${n}; right: ${a}; bottom: ${u}; left: ${h};`), f.addCSSRule(this._styles, c, `top: ${n}; right: ${a}; bottom: ${u}; left: ${h};`), f.addCSSRule(this._styles, `${r} > .ui-resizable-ne`, `right: ${a}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-e`, `right: ${a}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-se`, `right: ${a}; bottom: ${u}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-nw`, `left: ${h}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-w`, `left: ${h}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-sw`, `left: ${h}; bottom: ${u}`);
|
|
4169
4169
|
}
|
|
4170
4170
|
if (t = t || this._styles._max, t > this._styles._max) {
|
|
4171
4171
|
let l = (n) => i * n + s;
|
|
@@ -4286,7 +4286,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4286
4286
|
}
|
|
4287
4287
|
/** @internal */
|
|
4288
4288
|
static getGridElement(e) {
|
|
4289
|
-
return
|
|
4289
|
+
return A.getElement(e);
|
|
4290
4290
|
}
|
|
4291
4291
|
/** @internal */
|
|
4292
4292
|
static getGridElements(e) {
|
|
@@ -4304,7 +4304,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4304
4304
|
*/
|
|
4305
4305
|
/** get the global (but static to this code) DD implementation */
|
|
4306
4306
|
static getDD() {
|
|
4307
|
-
return
|
|
4307
|
+
return Z;
|
|
4308
4308
|
}
|
|
4309
4309
|
/**
|
|
4310
4310
|
* call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
|
|
@@ -4318,7 +4318,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4318
4318
|
(t == null ? void 0 : t.pause) !== void 0 && (k.pauseDrag = t.pause), t = { ...Cn, ...t || {} };
|
|
4319
4319
|
let s = typeof e == "string" ? f.getElements(e, i) : e;
|
|
4320
4320
|
s.length && (s == null || s.forEach((r) => {
|
|
4321
|
-
|
|
4321
|
+
Z.isDraggable(r) || Z.dragIn(r, t);
|
|
4322
4322
|
}));
|
|
4323
4323
|
}
|
|
4324
4324
|
/**
|
|
@@ -4328,7 +4328,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4328
4328
|
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static.
|
|
4329
4329
|
*/
|
|
4330
4330
|
movable(e, t) {
|
|
4331
|
-
return this.opts.staticGrid ? this : (
|
|
4331
|
+
return this.opts.staticGrid ? this : (A.getElements(e).forEach((i) => {
|
|
4332
4332
|
let s = i.gridstackNode;
|
|
4333
4333
|
s && (t ? delete s.noMove : s.noMove = !0, this._prepareDragDropByNode(s));
|
|
4334
4334
|
}), this);
|
|
@@ -4339,7 +4339,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4339
4339
|
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static.
|
|
4340
4340
|
*/
|
|
4341
4341
|
resizable(e, t) {
|
|
4342
|
-
return this.opts.staticGrid ? this : (
|
|
4342
|
+
return this.opts.staticGrid ? this : (A.getElements(e).forEach((i) => {
|
|
4343
4343
|
let s = i.gridstackNode;
|
|
4344
4344
|
s && (t ? delete s.noResize : s.noResize = !0, this._prepareDragDropByNode(s));
|
|
4345
4345
|
}), this);
|
|
@@ -4391,12 +4391,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4391
4391
|
}
|
|
4392
4392
|
/** @internal removes any drag&drop present (called during destroy) */
|
|
4393
4393
|
_removeDD(e) {
|
|
4394
|
-
return
|
|
4394
|
+
return Z.draggable(e, "destroy").resizable(e, "destroy"), e.gridstackNode && delete e.gridstackNode._initDD, delete e.ddElement, this;
|
|
4395
4395
|
}
|
|
4396
4396
|
/** @internal called to add drag over to support widgets being added externally */
|
|
4397
4397
|
_setupAcceptWidget() {
|
|
4398
4398
|
if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable)
|
|
4399
|
-
return
|
|
4399
|
+
return Z.droppable(this.el, "destroy"), this;
|
|
4400
4400
|
let e, t, i = (s, r, l) => {
|
|
4401
4401
|
let n = r.gridstackNode;
|
|
4402
4402
|
if (!n)
|
|
@@ -4408,7 +4408,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4408
4408
|
if (n._temporaryRemoved) {
|
|
4409
4409
|
if (n.x = Math.max(0, Math.round(h / t)), n.y = Math.max(0, Math.round(a / e)), delete n.autoPosition, this.engine.nodeBoundFix(n), !this.engine.willItFit(n)) {
|
|
4410
4410
|
if (n.autoPosition = !0, !this.engine.willItFit(n)) {
|
|
4411
|
-
|
|
4411
|
+
Z.off(r, "drag");
|
|
4412
4412
|
return;
|
|
4413
4413
|
}
|
|
4414
4414
|
n._willFitPos && (f.copyPos(n, n._willFitPos), delete n._willFitPos);
|
|
@@ -4417,7 +4417,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4417
4417
|
} else
|
|
4418
4418
|
this._dragOrResize(l, s, p, n, t, e);
|
|
4419
4419
|
};
|
|
4420
|
-
return
|
|
4420
|
+
return Z.droppable(this.el, {
|
|
4421
4421
|
accept: (s) => {
|
|
4422
4422
|
let r = s.gridstackNode;
|
|
4423
4423
|
if ((r == null ? void 0 : r.grid) === this)
|
|
@@ -4444,12 +4444,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4444
4444
|
n != null && n.grid && n.grid !== this && !n._temporaryRemoved && n.grid._leave(r, l), t = this.cellWidth(), e = this.getCellHeight(!0), n || (n = this._readAttr(r, !1)), n.grid || (n._isExternal = !0, r.gridstackNode = n), l = l || r;
|
|
4445
4445
|
let u = n.w || Math.round(l.offsetWidth / t) || 1, a = n.h || Math.round(l.offsetHeight / e) || 1;
|
|
4446
4446
|
return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: u, h: a, grid: this }, delete n.x, delete n.y, this.engine.cleanupNode(n).nodeBoundFix(n), n._initDD = n._isExternal = // DOM needs to be re-parented on a drop
|
|
4447
|
-
n._temporaryRemoved = !0) : (n.w = u, n.h = a, n._temporaryRemoved = !0), this._itemRemoving(n.el, !1),
|
|
4447
|
+
n._temporaryRemoved = !0) : (n.w = u, n.h = a, n._temporaryRemoved = !0), this._itemRemoving(n.el, !1), Z.on(r, "drag", i), i(s, r, l), !1;
|
|
4448
4448
|
}).on(this.el, "dropout", (s, r, l) => {
|
|
4449
4449
|
let n = r.gridstackNode;
|
|
4450
4450
|
return n && (!n.grid || n.grid === this) && (this._leave(r, l), this._isTemp && this.removeAsSubGrid(n)), !1;
|
|
4451
4451
|
}).on(this.el, "drop", (s, r, l) => {
|
|
4452
|
-
var p,
|
|
4452
|
+
var p, c;
|
|
4453
4453
|
let n = r.gridstackNode;
|
|
4454
4454
|
if ((n == null ? void 0 : n.grid) === this && !n._isExternal)
|
|
4455
4455
|
return !1;
|
|
@@ -4457,14 +4457,14 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4457
4457
|
this.placeholder.remove();
|
|
4458
4458
|
let a = r._gridstackNodeOrig;
|
|
4459
4459
|
if (delete r._gridstackNodeOrig, u && (a != null && a.grid) && a.grid !== this) {
|
|
4460
|
-
let
|
|
4461
|
-
|
|
4460
|
+
let y = a.grid;
|
|
4461
|
+
y.engine.removeNodeFromLayoutCache(a), y.engine.removedNodes.push(a), y._triggerRemoveEvent()._triggerChangeEvent(), y.parentGridItem && !y.engine.nodes.length && y.opts.subGridDynamic && y.removeAsSubGrid();
|
|
4462
4462
|
}
|
|
4463
|
-
if (!n || (u && (this.engine.cleanupNode(n), n.grid = this), delete n.grid._isTemp,
|
|
4463
|
+
if (!n || (u && (this.engine.cleanupNode(n), n.grid = this), delete n.grid._isTemp, Z.off(r, "drag"), l !== r ? (l.remove(), r.gridstackNode = a, u && (r = r.cloneNode(!0))) : (r.remove(), this._removeDD(r)), !u))
|
|
4464
4464
|
return !1;
|
|
4465
4465
|
r.gridstackNode = n, n.el = r;
|
|
4466
|
-
let h = (
|
|
4467
|
-
return f.copyPos(n, this._readAttr(this.placeholder)), f.removePositioningStyles(r), this._writeAttr(r, n), r.classList.add(
|
|
4466
|
+
let h = (c = (p = n.subGrid) == null ? void 0 : p.el) == null ? void 0 : c.gridstack;
|
|
4467
|
+
return f.copyPos(n, this._readAttr(this.placeholder)), f.removePositioningStyles(r), this._writeAttr(r, n), r.classList.add(ue.itemClass, this.opts.itemClass), this.el.appendChild(r), h && (h.parentGridItem = n, h.opts.styleInHead || h._updateStyles(!0)), this._prepareDragDropByNode(n), this._updateContainerHeight(), this.engine.addedNodes.push(n), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, a && a.grid ? a : void 0, n), !1;
|
|
4468
4468
|
}), this;
|
|
4469
4469
|
}
|
|
4470
4470
|
/** @internal mark item for removal */
|
|
@@ -4478,7 +4478,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4478
4478
|
let e = document.querySelector(this.opts.removable);
|
|
4479
4479
|
if (!e)
|
|
4480
4480
|
return this;
|
|
4481
|
-
|
|
4481
|
+
Z.isDroppable(e) || Z.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) => this._itemRemoving(i, !0)).on(e, "dropout", (t, i) => this._itemRemoving(i, !1));
|
|
4482
4482
|
}
|
|
4483
4483
|
return this;
|
|
4484
4484
|
}
|
|
@@ -4498,14 +4498,14 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4498
4498
|
let p = h.target;
|
|
4499
4499
|
if (!(!p.gridstackNode || p.gridstackNode.grid !== this)) {
|
|
4500
4500
|
if (e.el = p, e._isAboutToRemove) {
|
|
4501
|
-
let
|
|
4502
|
-
|
|
4501
|
+
let c = t.gridstackNode.grid;
|
|
4502
|
+
c._gsEventHandler[h.type] && c._gsEventHandler[h.type](h, p), c.engine.nodes.push(e), c.removeWidget(t, !0, !0);
|
|
4503
4503
|
} else
|
|
4504
4504
|
f.removePositioningStyles(p), e._temporaryRemoved ? (f.copyPos(e, e._orig), this._writePosAttr(p, e), this.engine.addNode(e)) : this._writePosAttr(p, e), this._gsEventHandler[h.type] && this._gsEventHandler[h.type](h, p);
|
|
4505
4505
|
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), h.type === "resizestop" && (Number.isInteger(e.sizeToContent) && (e.sizeToContent = e.h), this.doContentResize(!1, !0, e));
|
|
4506
4506
|
}
|
|
4507
4507
|
};
|
|
4508
|
-
|
|
4508
|
+
Z.draggable(t, {
|
|
4509
4509
|
start: n,
|
|
4510
4510
|
stop: a,
|
|
4511
4511
|
drag: u
|
|
@@ -4515,47 +4515,47 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4515
4515
|
resize: u
|
|
4516
4516
|
}), e._initDD = !0;
|
|
4517
4517
|
}
|
|
4518
|
-
return
|
|
4518
|
+
return Z.draggable(t, i ? "disable" : "enable").resizable(t, s ? "disable" : "enable"), this;
|
|
4519
4519
|
}
|
|
4520
4520
|
/** @internal handles actual drag/resize start */
|
|
4521
4521
|
_onStartMoving(e, t, i, s, r, l) {
|
|
4522
|
-
this.engine.cleanNodes().beginUpdate(s), this._writePosAttr(this.placeholder, s), this.el.appendChild(this.placeholder), s.el = this.placeholder, s._lastUiPosition = i.position, s._prevYPix = i.position.top, s._moving = t.type === "dragstart", delete s._lastTried, t.type === "dropover" && s._temporaryRemoved && (this.engine.addNode(s), s._moving = !0), this.engine.cacheRects(r, l, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), t.type === "resizestart" && (
|
|
4522
|
+
this.engine.cleanNodes().beginUpdate(s), this._writePosAttr(this.placeholder, s), this.el.appendChild(this.placeholder), s.el = this.placeholder, s._lastUiPosition = i.position, s._prevYPix = i.position.top, s._moving = t.type === "dragstart", delete s._lastTried, t.type === "dropover" && s._temporaryRemoved && (this.engine.addNode(s), s._moving = !0), this.engine.cacheRects(r, l, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), t.type === "resizestart" && (Z.resizable(e, "option", "minWidth", r * (s.minW || 1)).resizable(e, "option", "minHeight", l * (s.minH || 1)), s.maxW && Z.resizable(e, "option", "maxWidth", r * s.maxW), s.maxH && Z.resizable(e, "option", "maxHeight", l * s.maxH));
|
|
4523
4523
|
}
|
|
4524
4524
|
/** @internal handles actual drag/resize */
|
|
4525
4525
|
_dragOrResize(e, t, i, s, r, l) {
|
|
4526
|
-
let n = { ...s._orig }, u, a = this.opts.marginLeft, h = this.opts.marginRight, p = this.opts.marginTop,
|
|
4527
|
-
if (a = Math.min(a, v), h = Math.min(h, v), p = Math.min(p,
|
|
4526
|
+
let n = { ...s._orig }, u, a = this.opts.marginLeft, h = this.opts.marginRight, p = this.opts.marginTop, c = this.opts.marginBottom, y = Math.round(l * 0.1), v = Math.round(r * 0.1);
|
|
4527
|
+
if (a = Math.min(a, v), h = Math.min(h, v), p = Math.min(p, y), c = Math.min(c, y), t.type === "drag") {
|
|
4528
4528
|
if (s._temporaryRemoved)
|
|
4529
4529
|
return;
|
|
4530
|
-
let
|
|
4531
|
-
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && f.updateScrollPosition(e, i.position,
|
|
4532
|
-
let x = i.position.left + (i.position.left > s._lastUiPosition.left ? -h : a),
|
|
4533
|
-
n.x = Math.round(x / r), n.y = Math.round(
|
|
4534
|
-
let
|
|
4530
|
+
let N = i.position.top - s._prevYPix;
|
|
4531
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && f.updateScrollPosition(e, i.position, N);
|
|
4532
|
+
let x = i.position.left + (i.position.left > s._lastUiPosition.left ? -h : a), S = i.position.top + (i.position.top > s._lastUiPosition.top ? -c : p);
|
|
4533
|
+
n.x = Math.round(x / r), n.y = Math.round(S / l);
|
|
4534
|
+
let C = this._extraDragRow;
|
|
4535
4535
|
if (this.engine.collide(s, n)) {
|
|
4536
|
-
let
|
|
4537
|
-
this.opts.maxRow &&
|
|
4536
|
+
let T = this.getRow(), I = Math.max(0, n.y + s.h - T);
|
|
4537
|
+
this.opts.maxRow && T + I > this.opts.maxRow && (I = Math.max(0, this.opts.maxRow - T)), this._extraDragRow = I;
|
|
4538
4538
|
} else
|
|
4539
4539
|
this._extraDragRow = 0;
|
|
4540
|
-
if (this._extraDragRow !==
|
|
4540
|
+
if (this._extraDragRow !== C && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
|
|
4541
4541
|
return;
|
|
4542
4542
|
} else if (t.type === "resize") {
|
|
4543
4543
|
if (n.x < 0 || (f.updateScrollResize(t, e, l), n.w = Math.round((i.size.width - a) / r), n.h = Math.round((i.size.height - p) / l), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
|
|
4544
4544
|
return;
|
|
4545
|
-
let
|
|
4546
|
-
n.x = Math.round(
|
|
4545
|
+
let N = i.position.left + a, x = i.position.top + p;
|
|
4546
|
+
n.x = Math.round(N / r), n.y = Math.round(x / l), u = !0;
|
|
4547
4547
|
}
|
|
4548
4548
|
s._event = t, s._lastTried = n;
|
|
4549
|
-
let
|
|
4549
|
+
let R = {
|
|
4550
4550
|
x: i.position.left + a,
|
|
4551
4551
|
y: i.position.top + p,
|
|
4552
4552
|
w: (i.size ? i.size.width : s.w * r) - a - h,
|
|
4553
|
-
h: (i.size ? i.size.height : s.h * l) - p -
|
|
4553
|
+
h: (i.size ? i.size.height : s.h * l) - p - c
|
|
4554
4554
|
};
|
|
4555
|
-
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: l, rect:
|
|
4556
|
-
s._lastUiPosition = i.position, this.engine.cacheRects(r, l, p, h,
|
|
4557
|
-
let
|
|
4558
|
-
this._writePosAttr(
|
|
4555
|
+
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: l, rect: R, resizing: u })) {
|
|
4556
|
+
s._lastUiPosition = i.position, this.engine.cacheRects(r, l, p, h, c, a), delete s._skipDown, u && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
4557
|
+
let N = t.target;
|
|
4558
|
+
this._writePosAttr(N, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, N);
|
|
4559
4559
|
}
|
|
4560
4560
|
}
|
|
4561
4561
|
/** @internal called when item leaving our area by either cursor dropout event
|
|
@@ -4564,47 +4564,47 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4564
4564
|
*/
|
|
4565
4565
|
_leave(e, t) {
|
|
4566
4566
|
let i = e.gridstackNode;
|
|
4567
|
-
i && (
|
|
4567
|
+
i && (Z.off(e, "drag"), !i._temporaryRemoved && (i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && t ? t : e, this.opts.removable === !0 && this._itemRemoving(e, !0), e._gridstackNodeOrig ? (e.gridstackNode = e._gridstackNodeOrig, delete e._gridstackNodeOrig) : i._isExternal && (delete i.el, delete e.gridstackNode, this.engine.restoreInitial())));
|
|
4568
4568
|
}
|
|
4569
4569
|
// legacy method removed
|
|
4570
4570
|
commit() {
|
|
4571
4571
|
return Sn(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
4572
4572
|
}
|
|
4573
4573
|
}
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class: "color-primary" }, Mn = { class: "color-secondary" },
|
|
4574
|
+
A.resizeToContentParent = ".grid-stack-item-content";
|
|
4575
|
+
A.Utils = f;
|
|
4576
|
+
A.Engine = ve;
|
|
4577
|
+
A.GDRev = "9.5.1";
|
|
4578
|
+
const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class: "color-primary" }, Mn = { class: "color-secondary" }, Hn = {
|
|
4579
4579
|
key: 1,
|
|
4580
4580
|
class: "empty"
|
|
4581
|
-
},
|
|
4581
|
+
}, In = {
|
|
4582
4582
|
key: 0,
|
|
4583
4583
|
class: "clear-filter-div"
|
|
4584
|
-
}, On = /* @__PURE__ */
|
|
4584
|
+
}, On = /* @__PURE__ */ ce({
|
|
4585
4585
|
__name: "Filter",
|
|
4586
4586
|
props: {
|
|
4587
4587
|
order: {}
|
|
4588
4588
|
},
|
|
4589
4589
|
setup(o) {
|
|
4590
|
-
const e = o, t =
|
|
4590
|
+
const e = o, t = lt(), i = de(() => ({ ...t.Filters })), s = de(() => ({ ...t.displayFilters })), r = de(() => {
|
|
4591
4591
|
const h = i.value;
|
|
4592
4592
|
return Object.keys(h).map((p) => ({ key: p, value: h[p] })).filter(({ value: p }) => !(p == null || typeof p == "string" && p.trim() === "" || Array.isArray(p) && p.length === 0));
|
|
4593
|
-
}), l =
|
|
4593
|
+
}), l = de(() => {
|
|
4594
4594
|
var p;
|
|
4595
|
-
const h = r.value.filter((
|
|
4595
|
+
const h = r.value.filter((c) => s.value.hasOwnProperty(c.key) && s.value[c.key]);
|
|
4596
4596
|
if ((p = e.order) != null && p.length) {
|
|
4597
|
-
const
|
|
4598
|
-
h.sort((
|
|
4599
|
-
const
|
|
4600
|
-
return
|
|
4597
|
+
const c = new Map(e.order.map((y, v) => [y, v]));
|
|
4598
|
+
h.sort((y, v) => {
|
|
4599
|
+
const R = c.has(y.key) ? c.get(y.key) : Number.MAX_SAFE_INTEGER, N = c.has(v.key) ? c.get(v.key) : Number.MAX_SAFE_INTEGER;
|
|
4600
|
+
return R - N || y.key.localeCompare(v.key);
|
|
4601
4601
|
});
|
|
4602
4602
|
} else
|
|
4603
|
-
h.sort((
|
|
4603
|
+
h.sort((c, y) => c.key.localeCompare(y.key));
|
|
4604
4604
|
return h;
|
|
4605
4605
|
});
|
|
4606
4606
|
function n(h) {
|
|
4607
|
-
return Array.isArray(h) ? js(h).map((
|
|
4607
|
+
return Array.isArray(h) ? js(h).map((c) => c && typeof c == "object" ? c.name ?? JSON.stringify(c).replace(/[{}"]/g, "") : String(c ?? "")).join(", ") : h && typeof h == "object" ? JSON.stringify(h).replace(/[{}"]/g, "") : String(h ?? "");
|
|
4608
4608
|
}
|
|
4609
4609
|
function u(h) {
|
|
4610
4610
|
const p = t;
|
|
@@ -4614,54 +4614,54 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
4614
4614
|
t.resetFilters({});
|
|
4615
4615
|
}
|
|
4616
4616
|
return (h, p) => {
|
|
4617
|
-
const
|
|
4618
|
-
return
|
|
4617
|
+
const c = se("el-icon"), y = se("el-row");
|
|
4618
|
+
return E(), te(y, {
|
|
4619
4619
|
class: "filter-wrapper tw-m-1",
|
|
4620
4620
|
align: "middle",
|
|
4621
4621
|
justify: "space-between"
|
|
4622
4622
|
}, {
|
|
4623
|
-
default:
|
|
4624
|
-
|
|
4625
|
-
l.value.length ? (
|
|
4623
|
+
default: W(() => [
|
|
4624
|
+
D("div", zn, [
|
|
4625
|
+
l.value.length ? (E(!0), M(Ae, { key: 0 }, Ge(l.value, (v) => (E(), te(K(Qs), {
|
|
4626
4626
|
class: "color-background",
|
|
4627
4627
|
key: v.key,
|
|
4628
4628
|
closable: "",
|
|
4629
|
-
onClose: (
|
|
4629
|
+
onClose: (R) => u(v.key),
|
|
4630
4630
|
effect: "dark",
|
|
4631
4631
|
type: "info"
|
|
4632
4632
|
}, {
|
|
4633
|
-
default:
|
|
4634
|
-
|
|
4635
|
-
|
|
4633
|
+
default: W(() => [
|
|
4634
|
+
D("b", Nn, we(v.key) + ": ", 1),
|
|
4635
|
+
D("span", Mn, we(n(v.value)), 1)
|
|
4636
4636
|
]),
|
|
4637
4637
|
_: 2
|
|
4638
|
-
}, 1032, ["onClose"]))), 128)) : (
|
|
4638
|
+
}, 1032, ["onClose"]))), 128)) : (E(), M("span", Hn))
|
|
4639
4639
|
]),
|
|
4640
|
-
l.value.length ? (
|
|
4641
|
-
|
|
4640
|
+
l.value.length ? (E(), M("div", In, [
|
|
4641
|
+
G(K(ii), {
|
|
4642
4642
|
placement: "top-start",
|
|
4643
4643
|
content: "Clear All Filters"
|
|
4644
4644
|
}, {
|
|
4645
|
-
default:
|
|
4646
|
-
|
|
4645
|
+
default: W(() => [
|
|
4646
|
+
G(c, {
|
|
4647
4647
|
color: "#FFFF",
|
|
4648
4648
|
onClick: a
|
|
4649
4649
|
}, {
|
|
4650
|
-
default:
|
|
4651
|
-
|
|
4650
|
+
default: W(() => [
|
|
4651
|
+
G(K(er))
|
|
4652
4652
|
]),
|
|
4653
4653
|
_: 1
|
|
4654
4654
|
})
|
|
4655
4655
|
]),
|
|
4656
4656
|
_: 1
|
|
4657
4657
|
})
|
|
4658
|
-
])) :
|
|
4658
|
+
])) : We("", !0)
|
|
4659
4659
|
]),
|
|
4660
4660
|
_: 1
|
|
4661
4661
|
});
|
|
4662
4662
|
};
|
|
4663
4663
|
}
|
|
4664
|
-
}), Pn = /* @__PURE__ */
|
|
4664
|
+
}), Pn = /* @__PURE__ */ De(On, [["__scopeId", "data-v-55b985b8"]]), $n = {
|
|
4665
4665
|
key: 0,
|
|
4666
4666
|
class: "content-header dash-header-visible stick-to-top tw-flex tw-flex-row tw-items-center tw-justify-between tw-h-10"
|
|
4667
4667
|
}, Bn = { class: "editing-div" }, Fn = { class: "tw-m-4 tw-leading-none tw-pl-1 widget-name" }, Un = { class: "header-slot-icon" }, Wn = {
|
|
@@ -4682,11 +4682,11 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
4682
4682
|
hideHeader: Boolean
|
|
4683
4683
|
},
|
|
4684
4684
|
setup(o) {
|
|
4685
|
-
const e =
|
|
4686
|
-
|
|
4685
|
+
const e = lt(), t = o, i = $(null);
|
|
4686
|
+
pe(() => t.widgetName, (u) => {
|
|
4687
4687
|
i.value = u;
|
|
4688
4688
|
}, { immediate: !0 });
|
|
4689
|
-
const s =
|
|
4689
|
+
const s = $(!1), r = $(null);
|
|
4690
4690
|
function l() {
|
|
4691
4691
|
s.value = !0, r.value && r.value.focus();
|
|
4692
4692
|
}
|
|
@@ -4698,47 +4698,47 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
4698
4698
|
u.componentName = i;
|
|
4699
4699
|
}
|
|
4700
4700
|
return (u, a) => {
|
|
4701
|
-
const h =
|
|
4702
|
-
return o.hideHeader ? (
|
|
4703
|
-
|
|
4704
|
-
|
|
4701
|
+
const h = se("el-input"), p = hs("click-out");
|
|
4702
|
+
return o.hideHeader ? (E(), M("div", Wn, [
|
|
4703
|
+
D("div", Gn, [
|
|
4704
|
+
Et(u.$slots, "default", {}, void 0, !0)
|
|
4705
4705
|
])
|
|
4706
|
-
])) : (
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
onKeyup:
|
|
4706
|
+
])) : (E(), M("div", $n, [
|
|
4707
|
+
D("div", null, [
|
|
4708
|
+
Ne((E(), M("div", {
|
|
4709
|
+
onKeyup: us(n, ["enter"]),
|
|
4710
4710
|
class: "tw-flex"
|
|
4711
4711
|
}, [
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
onFocus: a[0] || (a[0] = (
|
|
4712
|
+
Ne(D("div", Bn, [
|
|
4713
|
+
G(h, {
|
|
4714
|
+
onFocus: a[0] || (a[0] = (c) => c.target.select()),
|
|
4715
4715
|
ref_key: "textUserInput",
|
|
4716
4716
|
ref: r,
|
|
4717
4717
|
modelValue: i.value,
|
|
4718
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
4718
|
+
"onUpdate:modelValue": a[1] || (a[1] = (c) => i.value = c)
|
|
4719
4719
|
}, null, 8, ["modelValue"])
|
|
4720
4720
|
], 512), [
|
|
4721
|
-
[
|
|
4721
|
+
[Tt, s.value]
|
|
4722
4722
|
]),
|
|
4723
|
-
|
|
4724
|
-
onClick: a[2] || (a[2] = (
|
|
4723
|
+
Ne(D("div", {
|
|
4724
|
+
onClick: a[2] || (a[2] = (c) => l()),
|
|
4725
4725
|
class: "visible-div"
|
|
4726
4726
|
}, [
|
|
4727
|
-
|
|
4727
|
+
D("div", Fn, we(i.value), 1)
|
|
4728
4728
|
], 512), [
|
|
4729
|
-
[
|
|
4729
|
+
[Tt, !s.value]
|
|
4730
4730
|
])
|
|
4731
4731
|
], 32)), [
|
|
4732
4732
|
[p, n]
|
|
4733
4733
|
])
|
|
4734
4734
|
]),
|
|
4735
|
-
|
|
4736
|
-
|
|
4735
|
+
D("div", Un, [
|
|
4736
|
+
Et(u.$slots, "default", {}, void 0, !0)
|
|
4737
4737
|
])
|
|
4738
4738
|
]));
|
|
4739
4739
|
};
|
|
4740
4740
|
}
|
|
4741
|
-
}, qn = /* @__PURE__ */
|
|
4741
|
+
}, qn = /* @__PURE__ */ De(Vn, [["__scopeId", "data-v-4f4aa869"]]), jn = { class: "tw-flex" }, Yn = {
|
|
4742
4742
|
__name: "WidgetWrapper",
|
|
4743
4743
|
props: {
|
|
4744
4744
|
widgetID: { type: String, required: !0 },
|
|
@@ -4751,11 +4751,11 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
4751
4751
|
},
|
|
4752
4752
|
emits: ["removeWidget", "toggle-lock"],
|
|
4753
4753
|
setup(o, { emit: e }) {
|
|
4754
|
-
const t = e, i = o, s =
|
|
4755
|
-
|
|
4756
|
-
const l =
|
|
4757
|
-
|
|
4758
|
-
const n =
|
|
4754
|
+
const t = e, i = o, s = $(null), r = $(!1);
|
|
4755
|
+
pe(() => i.isLocked, (x) => r.value = x, { immediate: !0 });
|
|
4756
|
+
const l = $(null);
|
|
4757
|
+
pe(() => i.hideWidgetsHeader, (x) => l.value = x, { immediate: !0 });
|
|
4758
|
+
const n = $(!1), u = $(!1), a = () => document.fullscreenElement === s.value;
|
|
4759
4759
|
async function h() {
|
|
4760
4760
|
const x = s.value;
|
|
4761
4761
|
if (x) {
|
|
@@ -4765,7 +4765,7 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
4765
4765
|
return;
|
|
4766
4766
|
} catch {
|
|
4767
4767
|
}
|
|
4768
|
-
u.value = !1, n.value = !0,
|
|
4768
|
+
u.value = !1, n.value = !0, R(!0);
|
|
4769
4769
|
}
|
|
4770
4770
|
}
|
|
4771
4771
|
async function p() {
|
|
@@ -4773,40 +4773,40 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
4773
4773
|
try {
|
|
4774
4774
|
await document.exitFullscreen();
|
|
4775
4775
|
} catch {
|
|
4776
|
-
u.value = !1, n.value = !1,
|
|
4776
|
+
u.value = !1, n.value = !1, R(!1);
|
|
4777
4777
|
}
|
|
4778
4778
|
return;
|
|
4779
4779
|
}
|
|
4780
|
-
u.value = !1, n.value = !1,
|
|
4780
|
+
u.value = !1, n.value = !1, R(!1);
|
|
4781
4781
|
}
|
|
4782
|
-
function
|
|
4782
|
+
function c() {
|
|
4783
4783
|
n.value ? p() : h();
|
|
4784
4784
|
}
|
|
4785
|
-
function
|
|
4785
|
+
function y() {
|
|
4786
4786
|
t("toggle-lock", { id: i.widgetID, isLocked: r.value });
|
|
4787
4787
|
}
|
|
4788
4788
|
let v = "";
|
|
4789
|
-
function
|
|
4789
|
+
function R(x) {
|
|
4790
4790
|
x ? (v = document.body.style.overflow || "", document.body.style.overflow = "hidden") : document.body.style.overflow = v;
|
|
4791
4791
|
}
|
|
4792
|
-
function
|
|
4793
|
-
u.value = !!document.fullscreenElement, u.value ? (n.value = a(), n.value ||
|
|
4792
|
+
function N() {
|
|
4793
|
+
u.value = !!document.fullscreenElement, u.value ? (n.value = a(), n.value || R(!1)) : (n.value = !1, R(!1));
|
|
4794
4794
|
}
|
|
4795
|
-
return
|
|
4796
|
-
document.addEventListener("fullscreenchange",
|
|
4797
|
-
}),
|
|
4798
|
-
document.removeEventListener("fullscreenchange",
|
|
4799
|
-
}), (x,
|
|
4800
|
-
const
|
|
4801
|
-
return
|
|
4795
|
+
return cs(() => {
|
|
4796
|
+
document.addEventListener("fullscreenchange", N);
|
|
4797
|
+
}), ds(() => {
|
|
4798
|
+
document.removeEventListener("fullscreenchange", N), R(!1);
|
|
4799
|
+
}), (x, S) => {
|
|
4800
|
+
const C = se("el-icon");
|
|
4801
|
+
return E(), M("div", {
|
|
4802
4802
|
ref_key: "instance",
|
|
4803
4803
|
ref: s,
|
|
4804
|
-
class:
|
|
4804
|
+
class: ps(["grid-stack-item-content", {
|
|
4805
4805
|
"locked-widget": o.isLocked,
|
|
4806
4806
|
"gs-fullscreen": n.value && !u.value
|
|
4807
4807
|
}])
|
|
4808
4808
|
}, [
|
|
4809
|
-
(
|
|
4809
|
+
(E(), te(Gi(o.componentTag), ai({
|
|
4810
4810
|
class: ["widget-body", { "widget-body-no-head": l.value }],
|
|
4811
4811
|
widgetID: o.widgetID,
|
|
4812
4812
|
hideHeader: l.value
|
|
@@ -4814,113 +4814,128 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
4814
4814
|
style: { pointerEvents: r.value ? "none" : "auto" },
|
|
4815
4815
|
isLocked: r.value
|
|
4816
4816
|
}), {
|
|
4817
|
-
default:
|
|
4818
|
-
|
|
4817
|
+
default: W((T) => [
|
|
4818
|
+
T ? (E(), te(qn, {
|
|
4819
4819
|
key: 0,
|
|
4820
4820
|
widgetName: i.componentName,
|
|
4821
4821
|
widgetID: o.widgetID,
|
|
4822
4822
|
staticMode: o.staticMode,
|
|
4823
4823
|
hideHeader: l.value
|
|
4824
4824
|
}, {
|
|
4825
|
-
default:
|
|
4826
|
-
|
|
4827
|
-
(
|
|
4828
|
-
content:
|
|
4829
|
-
|
|
4825
|
+
default: W(() => [
|
|
4826
|
+
D("div", jn, [
|
|
4827
|
+
(E(!0), M(Ae, null, Ge(T.childIcons, (I) => (E(), te(K(ii), { placement: "bottom-start" }, {
|
|
4828
|
+
content: W(() => [
|
|
4829
|
+
ze(we(I.tooltip), 1)
|
|
4830
4830
|
]),
|
|
4831
|
-
default:
|
|
4832
|
-
(
|
|
4831
|
+
default: W(() => [
|
|
4832
|
+
(E(), te(Gi(I.comp), {
|
|
4833
4833
|
class: "tw-w-4 header-icon",
|
|
4834
|
-
onClick:
|
|
4834
|
+
onClick: I.event
|
|
4835
4835
|
}, null, 8, ["onClick"]))
|
|
4836
4836
|
]),
|
|
4837
4837
|
_: 2
|
|
4838
4838
|
}, 1024))), 256)),
|
|
4839
|
-
|
|
4840
|
-
content:
|
|
4841
|
-
|
|
4839
|
+
G(K(ii), { placement: "bottom-start" }, {
|
|
4840
|
+
content: W(() => [
|
|
4841
|
+
ze(we(n.value ? "Exit Fullscreen" : "Fullscreen"), 1)
|
|
4842
4842
|
]),
|
|
4843
|
-
default:
|
|
4844
|
-
|
|
4843
|
+
default: W(() => [
|
|
4844
|
+
G(C, {
|
|
4845
4845
|
class: "header-icon",
|
|
4846
|
-
onClick:
|
|
4846
|
+
onClick: c
|
|
4847
4847
|
}, {
|
|
4848
|
-
default:
|
|
4849
|
-
n.value ? (
|
|
4848
|
+
default: W(() => [
|
|
4849
|
+
n.value ? (E(), te(K(hr), { key: 0 })) : (E(), te(K(nr), { key: 1 }))
|
|
4850
4850
|
]),
|
|
4851
4851
|
_: 1
|
|
4852
4852
|
})
|
|
4853
4853
|
]),
|
|
4854
4854
|
_: 1
|
|
4855
4855
|
}),
|
|
4856
|
-
|
|
4856
|
+
G(C, {
|
|
4857
4857
|
class: "header-icon lock-toggle",
|
|
4858
|
-
onClick:
|
|
4858
|
+
onClick: S[0] || (S[0] = (I) => y())
|
|
4859
4859
|
}, {
|
|
4860
|
-
default:
|
|
4861
|
-
r.value ? (
|
|
4860
|
+
default: W(() => [
|
|
4861
|
+
r.value ? (E(), te(K(lr), { key: 0 })) : (E(), te(K(cr), { key: 1 }))
|
|
4862
4862
|
]),
|
|
4863
4863
|
_: 1
|
|
4864
4864
|
}),
|
|
4865
|
-
!o.staticMode && !o.isLocked ? (
|
|
4865
|
+
!o.staticMode && !o.isLocked ? (E(), te(C, {
|
|
4866
4866
|
key: 0,
|
|
4867
4867
|
class: "item-widget-button",
|
|
4868
|
-
onClick:
|
|
4868
|
+
onClick: S[1] || (S[1] = (I) => x.$emit("removeWidget"))
|
|
4869
4869
|
}, {
|
|
4870
|
-
default:
|
|
4871
|
-
|
|
4870
|
+
default: W(() => [
|
|
4871
|
+
G(K(ir))
|
|
4872
4872
|
]),
|
|
4873
4873
|
_: 1
|
|
4874
|
-
})) :
|
|
4874
|
+
})) : We("", !0)
|
|
4875
4875
|
])
|
|
4876
4876
|
]),
|
|
4877
4877
|
_: 2
|
|
4878
|
-
}, 1032, ["widgetName", "widgetID", "staticMode", "hideHeader"])) :
|
|
4878
|
+
}, 1032, ["widgetName", "widgetID", "staticMode", "hideHeader"])) : We("", !0)
|
|
4879
4879
|
]),
|
|
4880
4880
|
_: 1
|
|
4881
4881
|
}, 16, ["class", "widgetID", "hideHeader", "style", "isLocked"]))
|
|
4882
4882
|
], 2);
|
|
4883
4883
|
};
|
|
4884
4884
|
}
|
|
4885
|
-
}, Xn = /* @__PURE__ */
|
|
4885
|
+
}, Xn = /* @__PURE__ */ De(Yn, [["__scopeId", "data-v-6b7fdde8"]]), Zn = { class: "dashboard-app" }, Kn = {
|
|
4886
|
+
key: 0,
|
|
4887
|
+
class: "dash-header tw-flex tw-flex-col"
|
|
4888
|
+
}, Qn = {
|
|
4886
4889
|
key: 0,
|
|
4887
|
-
class: "
|
|
4888
|
-
},
|
|
4890
|
+
class: "tw-float-left tw-m-1 button"
|
|
4891
|
+
}, Jn = {
|
|
4889
4892
|
key: 1,
|
|
4890
4893
|
class: "tw-h-10 dash-header"
|
|
4891
|
-
}, eo = { class: "tw-float-left tw-m-1" }, to = { class: "tw-m-4 tw-w-50 tw-flex-row tw-flex" }, io = { class: "tw-m-w-4 tw-w-40" }, so = ["gs-x", "gs-y", "gs-w", "gs-h", "gs-id", "id", "props", "gs-locked", "gs-no-move", "gs-no-resize"], ro = /* @__PURE__ */
|
|
4894
|
+
}, eo = { class: "tw-float-left tw-m-1" }, to = { class: "tw-m-4 tw-w-50 tw-flex-row tw-flex" }, io = { class: "tw-m-w-4 tw-w-40" }, so = ["gs-x", "gs-y", "gs-w", "gs-h", "gs-id", "id", "props", "gs-locked", "gs-no-move", "gs-no-resize"], ro = /* @__PURE__ */ ce({
|
|
4892
4895
|
__name: "Dashboard",
|
|
4893
4896
|
props: {
|
|
4894
4897
|
hideHeader: {},
|
|
4895
4898
|
options: {}
|
|
4896
4899
|
},
|
|
4897
4900
|
setup(o) {
|
|
4898
|
-
const e = o, t =
|
|
4899
|
-
let s =
|
|
4900
|
-
const l =
|
|
4901
|
-
let n =
|
|
4902
|
-
const
|
|
4901
|
+
const e = o, t = lt(), { DASHBOARD_ITEMS: i } = ti(t);
|
|
4902
|
+
let s = $("Edit Grid"), r = null;
|
|
4903
|
+
const l = $(null);
|
|
4904
|
+
let n = 0;
|
|
4905
|
+
const u = de(
|
|
4906
|
+
() => {
|
|
4907
|
+
var g;
|
|
4908
|
+
return ((g = e.options) == null ? void 0 : g.hideEditGrid) ?? !1;
|
|
4909
|
+
}
|
|
4910
|
+
), a = de(
|
|
4911
|
+
() => {
|
|
4912
|
+
var g;
|
|
4913
|
+
return ((g = e.options) == null ? void 0 : g.hideHeader) !== void 0 ? e.options.hideHeader : e.hideHeader ?? !1;
|
|
4914
|
+
}
|
|
4915
|
+
);
|
|
4916
|
+
let h = $(!0);
|
|
4917
|
+
const p = $([]), { ComponentRegistry: c } = ti(t), y = ei({});
|
|
4903
4918
|
Ys(() => {
|
|
4904
|
-
var
|
|
4905
|
-
|
|
4906
|
-
}), us(() => {
|
|
4907
|
-
S(), x();
|
|
4919
|
+
var g;
|
|
4920
|
+
v(), R(), t.loadFromLocalStorage(), n = ((g = i.value) == null ? void 0 : g.length) + 1;
|
|
4908
4921
|
}), cs(() => {
|
|
4909
|
-
|
|
4922
|
+
x(), C();
|
|
4923
|
+
}), ds(() => {
|
|
4924
|
+
S(), t.unregisterGridProvider();
|
|
4910
4925
|
});
|
|
4911
|
-
function
|
|
4912
|
-
var
|
|
4913
|
-
t.DefaultLayout = (
|
|
4926
|
+
function v() {
|
|
4927
|
+
var g, m;
|
|
4928
|
+
t.DefaultLayout = (g = e.options) == null ? void 0 : g.defaultLayout, t.setOptionServices((m = e.options) == null ? void 0 : m.services);
|
|
4914
4929
|
}
|
|
4915
|
-
function
|
|
4916
|
-
const
|
|
4917
|
-
apiUrl:
|
|
4918
|
-
var
|
|
4919
|
-
return (
|
|
4930
|
+
function R() {
|
|
4931
|
+
const g = {
|
|
4932
|
+
apiUrl: de(() => {
|
|
4933
|
+
var m;
|
|
4934
|
+
return (m = t.Services) == null ? void 0 : m.ApiUrl;
|
|
4920
4935
|
}),
|
|
4921
|
-
s3Url:
|
|
4922
|
-
var
|
|
4923
|
-
return (
|
|
4936
|
+
s3Url: de(() => {
|
|
4937
|
+
var m;
|
|
4938
|
+
return (m = t.Services) == null ? void 0 : m.s3Url;
|
|
4924
4939
|
}),
|
|
4925
4940
|
services: t.Services,
|
|
4926
4941
|
filters: t.Filters,
|
|
@@ -4928,24 +4943,24 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
4928
4943
|
clearFilter: t.clearFilter,
|
|
4929
4944
|
resetFilters: t.resetFilters
|
|
4930
4945
|
};
|
|
4931
|
-
Xs("dashboard:globalVars",
|
|
4946
|
+
Xs("dashboard:globalVars", g);
|
|
4932
4947
|
}
|
|
4933
|
-
async function
|
|
4934
|
-
if (t.resetGridLayout(), await
|
|
4948
|
+
async function N() {
|
|
4949
|
+
if (t.resetGridLayout(), await Vi(), !!r) {
|
|
4935
4950
|
r.batchUpdate(), r.removeAll();
|
|
4936
|
-
for (const
|
|
4937
|
-
const
|
|
4938
|
-
if (!
|
|
4939
|
-
console.warn("makeWidget: element not found for id",
|
|
4951
|
+
for (const g of i.value) {
|
|
4952
|
+
const m = document.getElementById(g.id);
|
|
4953
|
+
if (!m) {
|
|
4954
|
+
console.warn("makeWidget: element not found for id", g.id);
|
|
4940
4955
|
continue;
|
|
4941
4956
|
}
|
|
4942
|
-
|
|
4957
|
+
m.classList.add("grid-stack-item"), g.w != null && m.setAttribute("gs-w", String(g.w)), g.h != null && m.setAttribute("gs-h", String(g.h)), g.x != null && m.setAttribute("gs-x", String(g.x)), g.y != null && m.setAttribute("gs-y", String(g.y)), g.x == null && g.y == null && g.autoPosition && m.setAttribute("gs-auto-position", "true"), !m.gridstackNode && r.makeWidget(m);
|
|
4943
4958
|
}
|
|
4944
4959
|
r.commit();
|
|
4945
4960
|
}
|
|
4946
4961
|
}
|
|
4947
|
-
function
|
|
4948
|
-
const
|
|
4962
|
+
function x() {
|
|
4963
|
+
const g = {
|
|
4949
4964
|
float: !0,
|
|
4950
4965
|
column: 12,
|
|
4951
4966
|
cellHeight: "70px",
|
|
@@ -4956,144 +4971,143 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
4956
4971
|
handles: "e,se,s,sw,w,n"
|
|
4957
4972
|
}
|
|
4958
4973
|
};
|
|
4959
|
-
r =
|
|
4974
|
+
r = A.init(g), t.registerGridProvider(() => r), r.setStatic(h.value);
|
|
4960
4975
|
}
|
|
4961
|
-
function
|
|
4976
|
+
function S() {
|
|
4962
4977
|
r && (r.destroy(!1), r = null);
|
|
4963
4978
|
}
|
|
4964
|
-
function
|
|
4965
|
-
const
|
|
4966
|
-
if (
|
|
4979
|
+
function C() {
|
|
4980
|
+
const g = e.options.globalData;
|
|
4981
|
+
if (g) {
|
|
4967
4982
|
t.clearOptionsDataItems();
|
|
4968
|
-
for (const
|
|
4969
|
-
t.addOptionsDataItems(
|
|
4983
|
+
for (const m in g)
|
|
4984
|
+
t.addOptionsDataItems(m, g[m]);
|
|
4970
4985
|
}
|
|
4971
4986
|
}
|
|
4972
|
-
|
|
4987
|
+
pe(
|
|
4973
4988
|
() => {
|
|
4974
|
-
var
|
|
4975
|
-
return (
|
|
4989
|
+
var g;
|
|
4990
|
+
return (g = e.options) == null ? void 0 : g.availableWidgets;
|
|
4976
4991
|
},
|
|
4977
|
-
(
|
|
4978
|
-
|
|
4979
|
-
let
|
|
4980
|
-
if (
|
|
4981
|
-
|
|
4982
|
-
else if (
|
|
4983
|
-
|
|
4984
|
-
const
|
|
4985
|
-
return
|
|
4992
|
+
(g) => {
|
|
4993
|
+
c.value = {}, p.value = [], g && g.forEach((m, F) => {
|
|
4994
|
+
let z, he;
|
|
4995
|
+
if (m && typeof m == "object" && "name" in m && "component" in m)
|
|
4996
|
+
z = m.name, he = m.component;
|
|
4997
|
+
else if (m && typeof m == "object" && "name" in m && "loader" in m)
|
|
4998
|
+
z = m.name, he = Zs(async () => {
|
|
4999
|
+
const Ce = await m.loader();
|
|
5000
|
+
return Ce.default ?? Ce;
|
|
4986
5001
|
});
|
|
4987
|
-
else if (
|
|
4988
|
-
|
|
4989
|
-
else if (typeof
|
|
5002
|
+
else if (m && (typeof m == "function" || typeof m == "object"))
|
|
5003
|
+
he = m, z = m.name || `Widget${F + 1}`;
|
|
5004
|
+
else if (typeof m == "function")
|
|
4990
5005
|
return;
|
|
4991
|
-
!
|
|
5006
|
+
!z || !he || c.value[z] || (c.value[z] = he, p.value.push(z));
|
|
4992
5007
|
});
|
|
4993
5008
|
},
|
|
4994
5009
|
{ immediate: !0, deep: !0 }
|
|
4995
|
-
),
|
|
4996
|
-
() =>
|
|
4997
|
-
(
|
|
4998
|
-
r.setStatic(
|
|
5010
|
+
), pe(
|
|
5011
|
+
() => h.value,
|
|
5012
|
+
(g) => {
|
|
5013
|
+
r.setStatic(g), s.value = g ? "Edit Grid" : "Save Grid";
|
|
4999
5014
|
}
|
|
5000
|
-
),
|
|
5015
|
+
), pe(
|
|
5001
5016
|
() => {
|
|
5002
|
-
var
|
|
5003
|
-
return (
|
|
5017
|
+
var g;
|
|
5018
|
+
return (g = e.options) == null ? void 0 : g.defaultLayout;
|
|
5004
5019
|
},
|
|
5005
|
-
(
|
|
5006
|
-
|
|
5020
|
+
(g) => {
|
|
5021
|
+
g && (t.DefaultLayout = g, t.DASHBOARD_ITEMS = [...g], t.resetFilters({}));
|
|
5007
5022
|
},
|
|
5008
5023
|
{ deep: !0 }
|
|
5009
5024
|
);
|
|
5010
|
-
function
|
|
5011
|
-
if (!
|
|
5025
|
+
function T(g) {
|
|
5026
|
+
if (!g)
|
|
5012
5027
|
return;
|
|
5013
|
-
const
|
|
5014
|
-
id:
|
|
5028
|
+
const m = `${g}-${n}`, F = {
|
|
5029
|
+
id: m,
|
|
5015
5030
|
w: 2,
|
|
5016
5031
|
h: 6,
|
|
5017
5032
|
autoPosition: !0,
|
|
5018
|
-
component:
|
|
5019
|
-
componentKey:
|
|
5020
|
-
componentName:
|
|
5033
|
+
component: c.value[g],
|
|
5034
|
+
componentKey: g,
|
|
5035
|
+
componentName: g,
|
|
5021
5036
|
Props: {}
|
|
5022
5037
|
};
|
|
5023
|
-
|
|
5024
|
-
r == null || r.makeWidget(`#${
|
|
5038
|
+
n++, i.value.push(F), Vi(() => {
|
|
5039
|
+
r == null || r.makeWidget(`#${m}`);
|
|
5025
5040
|
});
|
|
5026
5041
|
}
|
|
5027
|
-
function
|
|
5028
|
-
var
|
|
5029
|
-
i.value.splice(
|
|
5030
|
-
const
|
|
5031
|
-
r.removeWidget(
|
|
5042
|
+
function I(g) {
|
|
5043
|
+
var m = i.value.findIndex((z) => z.id == g);
|
|
5044
|
+
i.value.splice(m, 1);
|
|
5045
|
+
const F = `#${g}`;
|
|
5046
|
+
r.removeWidget(F, !1);
|
|
5032
5047
|
}
|
|
5033
|
-
function
|
|
5034
|
-
id:
|
|
5035
|
-
isLocked:
|
|
5048
|
+
function Q({
|
|
5049
|
+
id: g,
|
|
5050
|
+
isLocked: m
|
|
5036
5051
|
}) {
|
|
5037
|
-
const
|
|
5038
|
-
|
|
5039
|
-
locked: !
|
|
5040
|
-
noMove: !
|
|
5041
|
-
noResize: !
|
|
5042
|
-
}), t.toggleWidgetLock(
|
|
5052
|
+
const F = y[g];
|
|
5053
|
+
F && r && r.update(F, {
|
|
5054
|
+
locked: !m,
|
|
5055
|
+
noMove: !m,
|
|
5056
|
+
noResize: !m
|
|
5057
|
+
}), t.toggleWidgetLock(g);
|
|
5043
5058
|
}
|
|
5044
|
-
function
|
|
5045
|
-
|
|
5059
|
+
function le() {
|
|
5060
|
+
u.value || (h.value = !h.value, h.value);
|
|
5046
5061
|
}
|
|
5047
|
-
return (
|
|
5048
|
-
const
|
|
5049
|
-
return
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
V(L, {
|
|
5062
|
+
return (g, m) => {
|
|
5063
|
+
const F = se("el-button"), z = se("el-option"), he = se("el-select"), Ce = se("el-col");
|
|
5064
|
+
return E(), M("div", Zn, [
|
|
5065
|
+
a.value ? u.value ? We("", !0) : (E(), M("div", Jn, [
|
|
5066
|
+
D("span", eo, [
|
|
5067
|
+
G(F, {
|
|
5054
5068
|
class: "edit-button",
|
|
5055
|
-
onClick:
|
|
5069
|
+
onClick: m[1] || (m[1] = (H) => le())
|
|
5056
5070
|
}, {
|
|
5057
|
-
default:
|
|
5058
|
-
|
|
5071
|
+
default: W(() => [
|
|
5072
|
+
ze(we(K(s)), 1)
|
|
5059
5073
|
]),
|
|
5060
5074
|
_: 1
|
|
5061
5075
|
})
|
|
5062
5076
|
])
|
|
5063
|
-
])) : (
|
|
5064
|
-
|
|
5065
|
-
|
|
5077
|
+
])) : (E(), M("div", Kn, [
|
|
5078
|
+
u.value ? We("", !0) : (E(), M("span", Qn, [
|
|
5079
|
+
G(F, {
|
|
5066
5080
|
class: "edit-button",
|
|
5067
|
-
onClick:
|
|
5081
|
+
onClick: m[0] || (m[0] = (H) => le())
|
|
5068
5082
|
}, {
|
|
5069
|
-
default:
|
|
5070
|
-
|
|
5083
|
+
default: W(() => [
|
|
5084
|
+
ze(we(K(s)), 1)
|
|
5071
5085
|
]),
|
|
5072
5086
|
_: 1
|
|
5073
5087
|
})
|
|
5074
|
-
]),
|
|
5075
|
-
|
|
5088
|
+
])),
|
|
5089
|
+
G(Pn)
|
|
5076
5090
|
])),
|
|
5077
|
-
|
|
5078
|
-
default:
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
default:
|
|
5082
|
-
(
|
|
5083
|
-
key:
|
|
5084
|
-
label:
|
|
5085
|
-
value:
|
|
5086
|
-
onClick: (
|
|
5091
|
+
!K(h) && !u.value ? (E(), te(Ce, { key: 2 }, {
|
|
5092
|
+
default: W(() => [
|
|
5093
|
+
D("div", to, [
|
|
5094
|
+
G(he, { placeholder: "Add New Widget" }, {
|
|
5095
|
+
default: W(() => [
|
|
5096
|
+
(E(!0), M(Ae, null, Ge(p.value, (H) => (E(), te(z, {
|
|
5097
|
+
key: H,
|
|
5098
|
+
label: H,
|
|
5099
|
+
value: H,
|
|
5100
|
+
onClick: (Ve) => T(H)
|
|
5087
5101
|
}, null, 8, ["label", "value", "onClick"]))), 128))
|
|
5088
5102
|
]),
|
|
5089
5103
|
_: 1
|
|
5090
5104
|
}),
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
onClick:
|
|
5105
|
+
D("div", io, [
|
|
5106
|
+
G(F, {
|
|
5107
|
+
onClick: m[2] || (m[2] = (H) => N())
|
|
5094
5108
|
}, {
|
|
5095
|
-
default:
|
|
5096
|
-
|
|
5109
|
+
default: W(() => [...m[3] || (m[3] = [
|
|
5110
|
+
ze("Reset Grid Layout", -1)
|
|
5097
5111
|
])]),
|
|
5098
5112
|
_: 1
|
|
5099
5113
|
})
|
|
@@ -5101,40 +5115,40 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
5101
5115
|
])
|
|
5102
5116
|
]),
|
|
5103
5117
|
_: 1
|
|
5104
|
-
})),
|
|
5105
|
-
|
|
5118
|
+
})) : We("", !0),
|
|
5119
|
+
D("div", {
|
|
5106
5120
|
ref_key: "root",
|
|
5107
5121
|
ref: l,
|
|
5108
|
-
class: "grid-stack
|
|
5122
|
+
class: "grid-stack"
|
|
5109
5123
|
}, [
|
|
5110
|
-
(
|
|
5111
|
-
var
|
|
5112
|
-
return
|
|
5124
|
+
(E(!0), M(Ae, null, Ge(K(i), (H) => {
|
|
5125
|
+
var Ve, ht, ut, qe;
|
|
5126
|
+
return E(), M("div", {
|
|
5113
5127
|
class: "grid-stack-item",
|
|
5114
5128
|
ref_for: !0,
|
|
5115
|
-
ref: (
|
|
5116
|
-
"gs-x":
|
|
5117
|
-
"gs-y":
|
|
5118
|
-
"gs-w":
|
|
5119
|
-
"gs-h":
|
|
5120
|
-
"gs-id":
|
|
5121
|
-
id:
|
|
5122
|
-
key:
|
|
5123
|
-
props:
|
|
5124
|
-
"gs-locked": (
|
|
5125
|
-
"gs-no-move": (
|
|
5126
|
-
"gs-no-resize": (
|
|
5129
|
+
ref: (ct) => y[H.id] = ct,
|
|
5130
|
+
"gs-x": H.x,
|
|
5131
|
+
"gs-y": H.y,
|
|
5132
|
+
"gs-w": H.w,
|
|
5133
|
+
"gs-h": H.h,
|
|
5134
|
+
"gs-id": H.id,
|
|
5135
|
+
id: H.id,
|
|
5136
|
+
key: H.id,
|
|
5137
|
+
props: H.Props,
|
|
5138
|
+
"gs-locked": (Ve = H.Props) == null ? void 0 : Ve.locked,
|
|
5139
|
+
"gs-no-move": (ht = H.Props) == null ? void 0 : ht.locked,
|
|
5140
|
+
"gs-no-resize": (ut = H.Props) == null ? void 0 : ut.locked
|
|
5127
5141
|
}, [
|
|
5128
|
-
|
|
5129
|
-
widgetID:
|
|
5130
|
-
onRemoveWidget: (
|
|
5131
|
-
onToggleLock:
|
|
5132
|
-
"static-mode":
|
|
5133
|
-
componentTag:
|
|
5134
|
-
componentProperties:
|
|
5135
|
-
componentName:
|
|
5136
|
-
hideWidgetsHeader:
|
|
5137
|
-
"is-locked": (
|
|
5142
|
+
G(Xn, {
|
|
5143
|
+
widgetID: H.id,
|
|
5144
|
+
onRemoveWidget: (ct) => I(H.id),
|
|
5145
|
+
onToggleLock: Q,
|
|
5146
|
+
"static-mode": K(h),
|
|
5147
|
+
componentTag: H.component,
|
|
5148
|
+
componentProperties: H.Props,
|
|
5149
|
+
componentName: H.componentName,
|
|
5150
|
+
hideWidgetsHeader: H.hideHeader,
|
|
5151
|
+
"is-locked": (qe = H.Props) == null ? void 0 : qe.locked
|
|
5138
5152
|
}, null, 8, ["widgetID", "onRemoveWidget", "static-mode", "componentTag", "componentProperties", "componentName", "hideWidgetsHeader", "is-locked"])
|
|
5139
5153
|
], 8, so);
|
|
5140
5154
|
}), 128))
|
|
@@ -5142,45 +5156,45 @@ const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class:
|
|
|
5142
5156
|
]);
|
|
5143
5157
|
};
|
|
5144
5158
|
}
|
|
5145
|
-
}), no = /* @__PURE__ */
|
|
5159
|
+
}), no = /* @__PURE__ */ De(ro, [["__scopeId", "data-v-17d3197c"]]), oo = { class: "dashboard-multi-wrap" }, lo = { class: "dash-main-header" }, ao = { class: "button-group" }, ho = ["onClick"], uo = { class: "dashboard-content" }, co = /* @__PURE__ */ ce({
|
|
5146
5160
|
__name: "DashboardWrap",
|
|
5147
5161
|
props: {
|
|
5148
5162
|
dashboardOptions: {},
|
|
5149
5163
|
default: {}
|
|
5150
5164
|
},
|
|
5151
5165
|
setup(o) {
|
|
5152
|
-
const e = o, t =
|
|
5166
|
+
const e = o, t = $(
|
|
5153
5167
|
e.default || e.dashboardOptions && e.dashboardOptions[0] || {}
|
|
5154
|
-
), i =
|
|
5168
|
+
), i = $(e.dashboardOptions), s = (r) => {
|
|
5155
5169
|
t.value = r;
|
|
5156
5170
|
};
|
|
5157
|
-
return (r, l) => (
|
|
5158
|
-
|
|
5159
|
-
l[0] || (l[0] =
|
|
5160
|
-
l[1] || (l[1] =
|
|
5161
|
-
|
|
5162
|
-
(
|
|
5171
|
+
return (r, l) => (E(), M("div", oo, [
|
|
5172
|
+
D("div", lo, [
|
|
5173
|
+
l[0] || (l[0] = D("h4", { class: "header-title" }, "Precision Dashboard Selection", -1)),
|
|
5174
|
+
l[1] || (l[1] = D("p", { class: "header-description" }, " Select a dashboard view to explore different aspects of gene analysis. Choose between co-expression analysis or side-by-side cell/gene comparison. ", -1)),
|
|
5175
|
+
D("div", ao, [
|
|
5176
|
+
(E(!0), M(Ae, null, Ge(i.value, (n) => {
|
|
5163
5177
|
var u;
|
|
5164
|
-
return
|
|
5178
|
+
return E(), M("button", {
|
|
5165
5179
|
key: n.name,
|
|
5166
|
-
class:
|
|
5180
|
+
class: ps([
|
|
5167
5181
|
"dashboard-button",
|
|
5168
5182
|
{ active: ((u = t.value) == null ? void 0 : u.name) === n.name }
|
|
5169
5183
|
]),
|
|
5170
5184
|
onClick: (a) => s(n)
|
|
5171
|
-
},
|
|
5185
|
+
}, we(n.name), 11, ho);
|
|
5172
5186
|
}), 128))
|
|
5173
5187
|
])
|
|
5174
5188
|
]),
|
|
5175
|
-
|
|
5176
|
-
|
|
5189
|
+
D("div", uo, [
|
|
5190
|
+
G(K(no), {
|
|
5177
5191
|
class: "dashboard-app",
|
|
5178
5192
|
options: t.value
|
|
5179
5193
|
}, null, 8, ["options"])
|
|
5180
5194
|
])
|
|
5181
5195
|
]));
|
|
5182
5196
|
}
|
|
5183
|
-
}), vo = /* @__PURE__ */
|
|
5197
|
+
}), vo = /* @__PURE__ */ De(co, [["__scopeId", "data-v-a8282539"]]);
|
|
5184
5198
|
export {
|
|
5185
5199
|
yo as MarkdownWidget,
|
|
5186
5200
|
vo as MultiDashboard,
|