react-timelane 0.0.0 → 0.0.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/components/Timelane.d.ts +15 -0
- package/dist/components/TimelaneAside.d.ts +13 -0
- package/dist/components/TimelaneBackground.d.ts +5 -0
- package/dist/components/TimelaneBody.d.ts +6 -0
- package/dist/components/TimelaneBodyInner.d.ts +16 -0
- package/dist/components/TimelaneHeader/DaysHeader.d.ts +15 -0
- package/dist/components/TimelaneHeader/MonthsHeader.d.ts +15 -0
- package/dist/components/TimelaneHeader/TimelaneHeader.d.ts +24 -0
- package/dist/components/TimelaneHeader/WeeksHeader.d.ts +15 -0
- package/dist/components/TimelaneHeader/index.d.ts +5 -0
- package/dist/components/TimelaneHeader/renderingUtils.d.ts +4 -0
- package/dist/components/TimelaneSelectionLayer.d.ts +6 -0
- package/dist/components/TimelaneSettingsContext.d.ts +7 -0
- package/dist/components/TimelaneSettingsProvider.d.ts +7 -0
- package/dist/components/TimelaneWrapper.d.ts +20 -0
- package/dist/components/core/CoreItem/CoreItemComponent.d.ts +14 -0
- package/dist/components/core/CoreItem/DragResizeComponent.d.ts +20 -0
- package/dist/components/core/CoreSwimlane/AvailableSpaceIndicator.d.ts +21 -0
- package/dist/components/core/CoreSwimlane/CoreSwimlane.d.ts +16 -0
- package/dist/components/core/CoreSwimlane/DropPreview.d.ts +9 -0
- package/dist/components/core/CoreSwimlane/DropTarget.d.ts +11 -0
- package/dist/components/core/CoreSwimlane/OverlapIndicator.d.ts +6 -0
- package/dist/components/core/CoreSwimlane/utils.d.ts +13 -0
- package/dist/components/core/utils.d.ts +15 -0
- package/dist/components/layout/TimelaneLayout.d.ts +23 -0
- package/dist/hooks/useScroll.d.ts +10 -0
- package/dist/hooks/useTimelaneContext.d.ts +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/react-timelane.css +1 -0
- package/dist/react-timelane.js +4701 -0
- package/dist/types/AvailableSpace.d.ts +6 -0
- package/dist/types/CoreItem.d.ts +12 -0
- package/dist/types/DateBounds.d.ts +4 -0
- package/dist/types/Dimensions.d.ts +4 -0
- package/dist/types/GrabInfo.d.ts +5 -0
- package/dist/types/Grid.d.ts +6 -0
- package/dist/types/OffsetBounds.d.ts +4 -0
- package/dist/types/Pixels.d.ts +4 -0
- package/{src/types/Position.ts → dist/types/Position.d.ts} +2 -2
- package/dist/types/Rectangle.d.ts +6 -0
- package/dist/types/SwimlaneT.d.ts +5 -0
- package/dist/types/TimeRange.d.ts +4 -0
- package/dist/types/TimelaneSettings.d.ts +11 -0
- package/dist/types/index.d.ts +15 -0
- package/package.json +1 -1
- package/vite.config.ts +2 -2
- package/.github/workflows/static.yml +0 -55
- package/docs/README.md +0 -54
- package/docs/eslint.config.js +0 -28
- package/docs/index.html +0 -12
- package/docs/package-lock.json +0 -5101
- package/docs/package.json +0 -35
- package/docs/src/App.css +0 -5
- package/docs/src/App.tsx +0 -59
- package/docs/src/assets/react.svg +0 -1
- package/docs/src/components/AllocationComponent.tsx +0 -82
- package/docs/src/components/Timeline.tsx +0 -183
- package/docs/src/constants.ts +0 -42
- package/docs/src/hooks/useLocalStorage.ts +0 -21
- package/docs/src/main.tsx +0 -9
- package/docs/src/models/Allocation.ts +0 -11
- package/docs/src/models/AllocationId.ts +0 -1
- package/docs/src/models/Resource.ts +0 -8
- package/docs/src/models/ResourceId.ts +0 -1
- package/docs/src/vite-env.d.ts +0 -1
- package/docs/tsconfig.json +0 -27
- package/docs/vite.config.ts +0 -8
- package/src/components/Timeline.scss +0 -297
- package/src/components/TimelineAside.tsx +0 -81
- package/src/components/TimelineBackground.tsx +0 -53
- package/src/components/TimelineBody.tsx +0 -54
- package/src/components/TimelineHeader/DaysHeader.tsx +0 -44
- package/src/components/TimelineHeader/MonthsHeader.tsx +0 -62
- package/src/components/TimelineHeader/TimelineHeader.tsx +0 -64
- package/src/components/TimelineHeader/WeeksHeader.tsx +0 -63
- package/src/components/TimelineHeader/index.ts +0 -9
- package/src/components/TimelineHeader/renderingUtils.tsx +0 -57
- package/src/components/TimelineSelectionLayer.tsx +0 -179
- package/src/components/TimelineSettingsContext.tsx +0 -27
- package/src/components/TimelineSettingsProvider.tsx +0 -24
- package/src/components/TimelineWrapper.tsx +0 -51
- package/src/components/core/CoreItem/CoreItemComponent.tsx +0 -69
- package/src/components/core/CoreItem/DragResizeComponent.tsx +0 -180
- package/src/components/core/CoreSwimlane/AvailableSpaceIndicator.tsx +0 -156
- package/src/components/core/CoreSwimlane/CoreSwimlane.tsx +0 -245
- package/src/components/core/CoreSwimlane/DropPreview.tsx +0 -30
- package/src/components/core/CoreSwimlane/DropTarget.tsx +0 -83
- package/src/components/core/CoreSwimlane/OverlapIndicator.tsx +0 -22
- package/src/components/core/CoreSwimlane/utils.ts +0 -375
- package/src/components/core/utils.ts +0 -154
- package/src/components/layout/TimelineLayout.tsx +0 -93
- package/src/components/layout/layout.scss +0 -107
- package/src/global.d.ts +0 -9
- package/src/hooks/useScroll.tsx +0 -71
- package/src/hooks/useTimelineContext.tsx +0 -6
- package/src/index.ts +0 -15
- package/src/types/AvailableSpace.ts +0 -6
- package/src/types/CoreItem.ts +0 -23
- package/src/types/DateBounds.ts +0 -4
- package/src/types/Dimensions.ts +0 -4
- package/src/types/GrabInfo.ts +0 -6
- package/src/types/Grid.ts +0 -6
- package/src/types/OffsetBounds.ts +0 -4
- package/src/types/Pixels.ts +0 -4
- package/src/types/Rectangle.ts +0 -6
- package/src/types/SwimlaneT.ts +0 -6
- package/src/types/TimeRange.ts +0 -4
- package/src/types/TimelineSettings.ts +0 -11
- package/src/types/index.ts +0 -15
- package/tsconfig.json +0 -32
- /package/{src/types/ItemId.ts → dist/types/ItemId.d.ts} +0 -0
- /package/{src/types/SwimlaneId.ts → dist/types/SwimlaneId.d.ts} +0 -0
|
@@ -0,0 +1,4701 @@
|
|
|
1
|
+
import { jsx as y, jsxs as Q, Fragment as Oe } from "react/jsx-runtime";
|
|
2
|
+
import kt, { useRef as le, createContext as Qt, useContext as Jt, useEffect as re, memo as Zt, useCallback as Ve, useMemo as er, PureComponent as tr, useState as V } from "react";
|
|
3
|
+
function H({ children: e }) {
|
|
4
|
+
const t = le(null);
|
|
5
|
+
return /* @__PURE__ */ y(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: "timelane-layout",
|
|
9
|
+
onWheel: (r) => {
|
|
10
|
+
t.current && (r.ctrlKey || r.shiftKey) && (t.current.scrollLeft += r.deltaY, r.preventDefault());
|
|
11
|
+
},
|
|
12
|
+
ref: t,
|
|
13
|
+
children: /* @__PURE__ */ y("div", { className: "timelane-layout-inner", children: e })
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function rr({ children: e }) {
|
|
18
|
+
return /* @__PURE__ */ y("div", { className: "timelane-layout-header", children: e });
|
|
19
|
+
}
|
|
20
|
+
function nr({ children: e }) {
|
|
21
|
+
return /* @__PURE__ */ y("div", { className: "timelane-layout-background", children: e });
|
|
22
|
+
}
|
|
23
|
+
function ir({ children: e }) {
|
|
24
|
+
return /* @__PURE__ */ y("div", { className: "timelane-layout-body", children: e });
|
|
25
|
+
}
|
|
26
|
+
function ar({ children: e }) {
|
|
27
|
+
return /* @__PURE__ */ y("div", { className: "timelane-layout-footer", children: e });
|
|
28
|
+
}
|
|
29
|
+
function or({
|
|
30
|
+
side: e = "left",
|
|
31
|
+
children: t
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ y(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: `timelane-layout-aside ${e == "left" ? "timelane-layout-aside-left" : "timelane-layout-aside-right"}`,
|
|
37
|
+
children: t
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
function sr({
|
|
42
|
+
corner: e = "top left",
|
|
43
|
+
children: t
|
|
44
|
+
}) {
|
|
45
|
+
let r = "";
|
|
46
|
+
switch (e) {
|
|
47
|
+
case "top left":
|
|
48
|
+
r = "timelane-layout-corner-top-left";
|
|
49
|
+
break;
|
|
50
|
+
case "top right":
|
|
51
|
+
r = "timelane-layout-corner-top-right";
|
|
52
|
+
break;
|
|
53
|
+
case "bottom left":
|
|
54
|
+
r = "timelane-layout-corner-bottom-left";
|
|
55
|
+
break;
|
|
56
|
+
case "bottom right":
|
|
57
|
+
r = "timelane-layout-corner-bottom-right";
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
return /* @__PURE__ */ y("div", { className: `timelane-layout-corner ${r}`, children: t });
|
|
61
|
+
}
|
|
62
|
+
H.Header = rr;
|
|
63
|
+
H.Body = ir;
|
|
64
|
+
H.Background = nr;
|
|
65
|
+
H.Footer = ar;
|
|
66
|
+
H.Aside = or;
|
|
67
|
+
H.Corner = sr;
|
|
68
|
+
const ur = {
|
|
69
|
+
start: new Date(2025, 1, 1),
|
|
70
|
+
end: new Date(2025, 5, 1),
|
|
71
|
+
pixelsPerDay: 30,
|
|
72
|
+
pixelsPerResource: 100,
|
|
73
|
+
showMonths: !0,
|
|
74
|
+
showWeeks: !0,
|
|
75
|
+
showDays: !0,
|
|
76
|
+
allowOverlaps: !0,
|
|
77
|
+
focusedDate: null
|
|
78
|
+
}, cr = {
|
|
79
|
+
settings: ur,
|
|
80
|
+
setSettings: () => {
|
|
81
|
+
}
|
|
82
|
+
}, Nt = Qt(cr), pe = () => Jt(Nt);
|
|
83
|
+
function lr({
|
|
84
|
+
lanes: e,
|
|
85
|
+
focusedLane: t,
|
|
86
|
+
setFocusedLane: r = () => {
|
|
87
|
+
},
|
|
88
|
+
onLaneHeaderClick: n = () => {
|
|
89
|
+
},
|
|
90
|
+
onLaneHeaderDoubleClick: i = () => {
|
|
91
|
+
},
|
|
92
|
+
onLaneHeaderContextMenu: a = () => {
|
|
93
|
+
},
|
|
94
|
+
renderLaneHeader: u = fr
|
|
95
|
+
}) {
|
|
96
|
+
const { settings: c } = pe();
|
|
97
|
+
return /* @__PURE__ */ y(H.Aside, { children: /* @__PURE__ */ y("div", { className: "timelane-aside", children: e && e.map((s) => /* @__PURE__ */ y(
|
|
98
|
+
dr,
|
|
99
|
+
{
|
|
100
|
+
height: c.pixelsPerResource,
|
|
101
|
+
isFocused: t ? t.id === s.id : !1,
|
|
102
|
+
onClick: (o) => {
|
|
103
|
+
r(s), n(s, o);
|
|
104
|
+
},
|
|
105
|
+
onDoubleClick: (o) => i(s, o),
|
|
106
|
+
onContextMenu: (o) => a(s, o),
|
|
107
|
+
children: u(s)
|
|
108
|
+
},
|
|
109
|
+
s.id
|
|
110
|
+
)) }) });
|
|
111
|
+
}
|
|
112
|
+
function dr({
|
|
113
|
+
height: e,
|
|
114
|
+
isFocused: t,
|
|
115
|
+
onClick: r,
|
|
116
|
+
onDoubleClick: n,
|
|
117
|
+
onContextMenu: i,
|
|
118
|
+
children: a
|
|
119
|
+
}) {
|
|
120
|
+
return /* @__PURE__ */ y(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
className: `timelane-aside-swimlane-header ${t ? "timelane-aside-swimlane-header-focused" : ""}`,
|
|
124
|
+
style: { height: `${e}px` },
|
|
125
|
+
onClick: r,
|
|
126
|
+
onDoubleClick: n,
|
|
127
|
+
onContextMenu: i,
|
|
128
|
+
children: a
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
function fr(e) {
|
|
133
|
+
return /* @__PURE__ */ y("div", { children: e.id });
|
|
134
|
+
}
|
|
135
|
+
const At = 6048e5, hr = 864e5, Qe = Symbol.for("constructDateFrom");
|
|
136
|
+
function W(e, t) {
|
|
137
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && Qe in e ? e[Qe](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
138
|
+
}
|
|
139
|
+
function N(e, t) {
|
|
140
|
+
return W(t || e, e);
|
|
141
|
+
}
|
|
142
|
+
function de(e, t, r) {
|
|
143
|
+
const n = N(e, r == null ? void 0 : r.in);
|
|
144
|
+
return isNaN(t) ? W(e, NaN) : (t && n.setDate(n.getDate() + t), n);
|
|
145
|
+
}
|
|
146
|
+
function zt(e, t) {
|
|
147
|
+
return N(e, t == null ? void 0 : t.in).getDay() === 0;
|
|
148
|
+
}
|
|
149
|
+
let gr = {};
|
|
150
|
+
function Me() {
|
|
151
|
+
return gr;
|
|
152
|
+
}
|
|
153
|
+
function B(e, t) {
|
|
154
|
+
var c, s, o, f;
|
|
155
|
+
const r = Me(), n = (t == null ? void 0 : t.weekStartsOn) ?? ((s = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : s.weekStartsOn) ?? r.weekStartsOn ?? ((f = (o = r.locale) == null ? void 0 : o.options) == null ? void 0 : f.weekStartsOn) ?? 0, i = N(e, t == null ? void 0 : t.in), a = i.getDay(), u = (a < n ? 7 : 0) + a - n;
|
|
156
|
+
return i.setDate(i.getDate() - u), i.setHours(0, 0, 0, 0), i;
|
|
157
|
+
}
|
|
158
|
+
function De(e, t) {
|
|
159
|
+
return B(e, { ...t, weekStartsOn: 1 });
|
|
160
|
+
}
|
|
161
|
+
function _t(e, t) {
|
|
162
|
+
const r = N(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = W(r, 0);
|
|
163
|
+
i.setFullYear(n + 1, 0, 4), i.setHours(0, 0, 0, 0);
|
|
164
|
+
const a = De(i), u = W(r, 0);
|
|
165
|
+
u.setFullYear(n, 0, 4), u.setHours(0, 0, 0, 0);
|
|
166
|
+
const c = De(u);
|
|
167
|
+
return r.getTime() >= a.getTime() ? n + 1 : r.getTime() >= c.getTime() ? n : n - 1;
|
|
168
|
+
}
|
|
169
|
+
function Je(e) {
|
|
170
|
+
const t = N(e), r = new Date(
|
|
171
|
+
Date.UTC(
|
|
172
|
+
t.getFullYear(),
|
|
173
|
+
t.getMonth(),
|
|
174
|
+
t.getDate(),
|
|
175
|
+
t.getHours(),
|
|
176
|
+
t.getMinutes(),
|
|
177
|
+
t.getSeconds(),
|
|
178
|
+
t.getMilliseconds()
|
|
179
|
+
)
|
|
180
|
+
);
|
|
181
|
+
return r.setUTCFullYear(t.getFullYear()), +e - +r;
|
|
182
|
+
}
|
|
183
|
+
function je(e, ...t) {
|
|
184
|
+
const r = W.bind(
|
|
185
|
+
null,
|
|
186
|
+
e || t.find((n) => typeof n == "object")
|
|
187
|
+
);
|
|
188
|
+
return t.map(r);
|
|
189
|
+
}
|
|
190
|
+
function Te(e, t) {
|
|
191
|
+
const r = N(e, t == null ? void 0 : t.in);
|
|
192
|
+
return r.setHours(0, 0, 0, 0), r;
|
|
193
|
+
}
|
|
194
|
+
function q(e, t, r) {
|
|
195
|
+
const [n, i] = je(
|
|
196
|
+
r == null ? void 0 : r.in,
|
|
197
|
+
e,
|
|
198
|
+
t
|
|
199
|
+
), a = Te(n), u = Te(i), c = +a - Je(a), s = +u - Je(u);
|
|
200
|
+
return Math.round((c - s) / hr);
|
|
201
|
+
}
|
|
202
|
+
function pr(e, t) {
|
|
203
|
+
const r = _t(e, t), n = W(e, 0);
|
|
204
|
+
return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), De(n);
|
|
205
|
+
}
|
|
206
|
+
function mr(e, t, r) {
|
|
207
|
+
return de(e, t * 7, r);
|
|
208
|
+
}
|
|
209
|
+
function yr(e, t) {
|
|
210
|
+
let r, n = t == null ? void 0 : t.in;
|
|
211
|
+
return e.forEach((i) => {
|
|
212
|
+
!n && typeof i == "object" && (n = W.bind(null, i));
|
|
213
|
+
const a = N(i, n);
|
|
214
|
+
(!r || r < a || isNaN(+a)) && (r = a);
|
|
215
|
+
}), W(n, r || NaN);
|
|
216
|
+
}
|
|
217
|
+
function vr(e, t) {
|
|
218
|
+
let r, n = t == null ? void 0 : t.in;
|
|
219
|
+
return e.forEach((i) => {
|
|
220
|
+
!n && typeof i == "object" && (n = W.bind(null, i));
|
|
221
|
+
const a = N(i, n);
|
|
222
|
+
(!r || r > a || isNaN(+a)) && (r = a);
|
|
223
|
+
}), W(n, r || NaN);
|
|
224
|
+
}
|
|
225
|
+
function br(e, t, r) {
|
|
226
|
+
const [n, i] = je(
|
|
227
|
+
r == null ? void 0 : r.in,
|
|
228
|
+
e,
|
|
229
|
+
t
|
|
230
|
+
);
|
|
231
|
+
return +Te(n) == +Te(i);
|
|
232
|
+
}
|
|
233
|
+
function wr(e) {
|
|
234
|
+
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
235
|
+
}
|
|
236
|
+
function xr(e) {
|
|
237
|
+
return !(!wr(e) && typeof e != "number" || isNaN(+N(e)));
|
|
238
|
+
}
|
|
239
|
+
function Be(e, t) {
|
|
240
|
+
const [r, n] = je(e, t.start, t.end);
|
|
241
|
+
return { start: r, end: n };
|
|
242
|
+
}
|
|
243
|
+
function Ct(e, t) {
|
|
244
|
+
const { start: r, end: n } = Be(t == null ? void 0 : t.in, e);
|
|
245
|
+
let i = +r > +n;
|
|
246
|
+
const a = i ? +r : +n, u = i ? n : r;
|
|
247
|
+
u.setHours(0, 0, 0, 0);
|
|
248
|
+
let c = 1;
|
|
249
|
+
const s = [];
|
|
250
|
+
for (; +u <= a; )
|
|
251
|
+
s.push(W(r, u)), u.setDate(u.getDate() + c), u.setHours(0, 0, 0, 0);
|
|
252
|
+
return i ? s.reverse() : s;
|
|
253
|
+
}
|
|
254
|
+
function Sr(e, t) {
|
|
255
|
+
const { start: r, end: n } = Be(t == null ? void 0 : t.in, e);
|
|
256
|
+
let i = +r > +n;
|
|
257
|
+
const a = i ? +r : +n, u = i ? n : r;
|
|
258
|
+
u.setHours(0, 0, 0, 0), u.setDate(1);
|
|
259
|
+
let c = 1;
|
|
260
|
+
const s = [];
|
|
261
|
+
for (; +u <= a; )
|
|
262
|
+
s.push(W(r, u)), u.setMonth(u.getMonth() + c);
|
|
263
|
+
return i ? s.reverse() : s;
|
|
264
|
+
}
|
|
265
|
+
function Or(e, t) {
|
|
266
|
+
const { start: r, end: n } = Be(t == null ? void 0 : t.in, e);
|
|
267
|
+
let i = +r > +n;
|
|
268
|
+
const a = B(i ? n : r, t), u = B(i ? r : n, t);
|
|
269
|
+
a.setHours(15), u.setHours(15);
|
|
270
|
+
const c = +u.getTime();
|
|
271
|
+
let s = a, o = (t == null ? void 0 : t.step) ?? 1;
|
|
272
|
+
if (!o) return [];
|
|
273
|
+
o < 0 && (o = -o, i = !i);
|
|
274
|
+
const f = [];
|
|
275
|
+
for (; +s <= c; )
|
|
276
|
+
s.setHours(0), f.push(W(r, s)), s = mr(s, o), s.setHours(15);
|
|
277
|
+
return i ? f.reverse() : f;
|
|
278
|
+
}
|
|
279
|
+
function Dr(e, t) {
|
|
280
|
+
const r = N(e, t == null ? void 0 : t.in);
|
|
281
|
+
return r.setFullYear(r.getFullYear(), 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
282
|
+
}
|
|
283
|
+
const Tr = {
|
|
284
|
+
lessThanXSeconds: {
|
|
285
|
+
one: "less than a second",
|
|
286
|
+
other: "less than {{count}} seconds"
|
|
287
|
+
},
|
|
288
|
+
xSeconds: {
|
|
289
|
+
one: "1 second",
|
|
290
|
+
other: "{{count}} seconds"
|
|
291
|
+
},
|
|
292
|
+
halfAMinute: "half a minute",
|
|
293
|
+
lessThanXMinutes: {
|
|
294
|
+
one: "less than a minute",
|
|
295
|
+
other: "less than {{count}} minutes"
|
|
296
|
+
},
|
|
297
|
+
xMinutes: {
|
|
298
|
+
one: "1 minute",
|
|
299
|
+
other: "{{count}} minutes"
|
|
300
|
+
},
|
|
301
|
+
aboutXHours: {
|
|
302
|
+
one: "about 1 hour",
|
|
303
|
+
other: "about {{count}} hours"
|
|
304
|
+
},
|
|
305
|
+
xHours: {
|
|
306
|
+
one: "1 hour",
|
|
307
|
+
other: "{{count}} hours"
|
|
308
|
+
},
|
|
309
|
+
xDays: {
|
|
310
|
+
one: "1 day",
|
|
311
|
+
other: "{{count}} days"
|
|
312
|
+
},
|
|
313
|
+
aboutXWeeks: {
|
|
314
|
+
one: "about 1 week",
|
|
315
|
+
other: "about {{count}} weeks"
|
|
316
|
+
},
|
|
317
|
+
xWeeks: {
|
|
318
|
+
one: "1 week",
|
|
319
|
+
other: "{{count}} weeks"
|
|
320
|
+
},
|
|
321
|
+
aboutXMonths: {
|
|
322
|
+
one: "about 1 month",
|
|
323
|
+
other: "about {{count}} months"
|
|
324
|
+
},
|
|
325
|
+
xMonths: {
|
|
326
|
+
one: "1 month",
|
|
327
|
+
other: "{{count}} months"
|
|
328
|
+
},
|
|
329
|
+
aboutXYears: {
|
|
330
|
+
one: "about 1 year",
|
|
331
|
+
other: "about {{count}} years"
|
|
332
|
+
},
|
|
333
|
+
xYears: {
|
|
334
|
+
one: "1 year",
|
|
335
|
+
other: "{{count}} years"
|
|
336
|
+
},
|
|
337
|
+
overXYears: {
|
|
338
|
+
one: "over 1 year",
|
|
339
|
+
other: "over {{count}} years"
|
|
340
|
+
},
|
|
341
|
+
almostXYears: {
|
|
342
|
+
one: "almost 1 year",
|
|
343
|
+
other: "almost {{count}} years"
|
|
344
|
+
}
|
|
345
|
+
}, Mr = (e, t, r) => {
|
|
346
|
+
let n;
|
|
347
|
+
const i = Tr[e];
|
|
348
|
+
return typeof i == "string" ? n = i : t === 1 ? n = i.one : n = i.other.replace("{{count}}", t.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
349
|
+
};
|
|
350
|
+
function Ee(e) {
|
|
351
|
+
return (t = {}) => {
|
|
352
|
+
const r = t.width ? String(t.width) : e.defaultWidth;
|
|
353
|
+
return e.formats[r] || e.formats[e.defaultWidth];
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
const Er = {
|
|
357
|
+
full: "EEEE, MMMM do, y",
|
|
358
|
+
long: "MMMM do, y",
|
|
359
|
+
medium: "MMM d, y",
|
|
360
|
+
short: "MM/dd/yyyy"
|
|
361
|
+
}, Pr = {
|
|
362
|
+
full: "h:mm:ss a zzzz",
|
|
363
|
+
long: "h:mm:ss a z",
|
|
364
|
+
medium: "h:mm:ss a",
|
|
365
|
+
short: "h:mm a"
|
|
366
|
+
}, Rr = {
|
|
367
|
+
full: "{{date}} 'at' {{time}}",
|
|
368
|
+
long: "{{date}} 'at' {{time}}",
|
|
369
|
+
medium: "{{date}}, {{time}}",
|
|
370
|
+
short: "{{date}}, {{time}}"
|
|
371
|
+
}, kr = {
|
|
372
|
+
date: Ee({
|
|
373
|
+
formats: Er,
|
|
374
|
+
defaultWidth: "full"
|
|
375
|
+
}),
|
|
376
|
+
time: Ee({
|
|
377
|
+
formats: Pr,
|
|
378
|
+
defaultWidth: "full"
|
|
379
|
+
}),
|
|
380
|
+
dateTime: Ee({
|
|
381
|
+
formats: Rr,
|
|
382
|
+
defaultWidth: "full"
|
|
383
|
+
})
|
|
384
|
+
}, Nr = {
|
|
385
|
+
lastWeek: "'last' eeee 'at' p",
|
|
386
|
+
yesterday: "'yesterday at' p",
|
|
387
|
+
today: "'today at' p",
|
|
388
|
+
tomorrow: "'tomorrow at' p",
|
|
389
|
+
nextWeek: "eeee 'at' p",
|
|
390
|
+
other: "P"
|
|
391
|
+
}, Ar = (e, t, r, n) => Nr[e];
|
|
392
|
+
function ae(e) {
|
|
393
|
+
return (t, r) => {
|
|
394
|
+
const n = r != null && r.context ? String(r.context) : "standalone";
|
|
395
|
+
let i;
|
|
396
|
+
if (n === "formatting" && e.formattingValues) {
|
|
397
|
+
const u = e.defaultFormattingWidth || e.defaultWidth, c = r != null && r.width ? String(r.width) : u;
|
|
398
|
+
i = e.formattingValues[c] || e.formattingValues[u];
|
|
399
|
+
} else {
|
|
400
|
+
const u = e.defaultWidth, c = r != null && r.width ? String(r.width) : e.defaultWidth;
|
|
401
|
+
i = e.values[c] || e.values[u];
|
|
402
|
+
}
|
|
403
|
+
const a = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
404
|
+
return i[a];
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
const zr = {
|
|
408
|
+
narrow: ["B", "A"],
|
|
409
|
+
abbreviated: ["BC", "AD"],
|
|
410
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
411
|
+
}, _r = {
|
|
412
|
+
narrow: ["1", "2", "3", "4"],
|
|
413
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
414
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
415
|
+
}, Cr = {
|
|
416
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
417
|
+
abbreviated: [
|
|
418
|
+
"Jan",
|
|
419
|
+
"Feb",
|
|
420
|
+
"Mar",
|
|
421
|
+
"Apr",
|
|
422
|
+
"May",
|
|
423
|
+
"Jun",
|
|
424
|
+
"Jul",
|
|
425
|
+
"Aug",
|
|
426
|
+
"Sep",
|
|
427
|
+
"Oct",
|
|
428
|
+
"Nov",
|
|
429
|
+
"Dec"
|
|
430
|
+
],
|
|
431
|
+
wide: [
|
|
432
|
+
"January",
|
|
433
|
+
"February",
|
|
434
|
+
"March",
|
|
435
|
+
"April",
|
|
436
|
+
"May",
|
|
437
|
+
"June",
|
|
438
|
+
"July",
|
|
439
|
+
"August",
|
|
440
|
+
"September",
|
|
441
|
+
"October",
|
|
442
|
+
"November",
|
|
443
|
+
"December"
|
|
444
|
+
]
|
|
445
|
+
}, Wr = {
|
|
446
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
447
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
448
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
449
|
+
wide: [
|
|
450
|
+
"Sunday",
|
|
451
|
+
"Monday",
|
|
452
|
+
"Tuesday",
|
|
453
|
+
"Wednesday",
|
|
454
|
+
"Thursday",
|
|
455
|
+
"Friday",
|
|
456
|
+
"Saturday"
|
|
457
|
+
]
|
|
458
|
+
}, Lr = {
|
|
459
|
+
narrow: {
|
|
460
|
+
am: "a",
|
|
461
|
+
pm: "p",
|
|
462
|
+
midnight: "mi",
|
|
463
|
+
noon: "n",
|
|
464
|
+
morning: "morning",
|
|
465
|
+
afternoon: "afternoon",
|
|
466
|
+
evening: "evening",
|
|
467
|
+
night: "night"
|
|
468
|
+
},
|
|
469
|
+
abbreviated: {
|
|
470
|
+
am: "AM",
|
|
471
|
+
pm: "PM",
|
|
472
|
+
midnight: "midnight",
|
|
473
|
+
noon: "noon",
|
|
474
|
+
morning: "morning",
|
|
475
|
+
afternoon: "afternoon",
|
|
476
|
+
evening: "evening",
|
|
477
|
+
night: "night"
|
|
478
|
+
},
|
|
479
|
+
wide: {
|
|
480
|
+
am: "a.m.",
|
|
481
|
+
pm: "p.m.",
|
|
482
|
+
midnight: "midnight",
|
|
483
|
+
noon: "noon",
|
|
484
|
+
morning: "morning",
|
|
485
|
+
afternoon: "afternoon",
|
|
486
|
+
evening: "evening",
|
|
487
|
+
night: "night"
|
|
488
|
+
}
|
|
489
|
+
}, Hr = {
|
|
490
|
+
narrow: {
|
|
491
|
+
am: "a",
|
|
492
|
+
pm: "p",
|
|
493
|
+
midnight: "mi",
|
|
494
|
+
noon: "n",
|
|
495
|
+
morning: "in the morning",
|
|
496
|
+
afternoon: "in the afternoon",
|
|
497
|
+
evening: "in the evening",
|
|
498
|
+
night: "at night"
|
|
499
|
+
},
|
|
500
|
+
abbreviated: {
|
|
501
|
+
am: "AM",
|
|
502
|
+
pm: "PM",
|
|
503
|
+
midnight: "midnight",
|
|
504
|
+
noon: "noon",
|
|
505
|
+
morning: "in the morning",
|
|
506
|
+
afternoon: "in the afternoon",
|
|
507
|
+
evening: "in the evening",
|
|
508
|
+
night: "at night"
|
|
509
|
+
},
|
|
510
|
+
wide: {
|
|
511
|
+
am: "a.m.",
|
|
512
|
+
pm: "p.m.",
|
|
513
|
+
midnight: "midnight",
|
|
514
|
+
noon: "noon",
|
|
515
|
+
morning: "in the morning",
|
|
516
|
+
afternoon: "in the afternoon",
|
|
517
|
+
evening: "in the evening",
|
|
518
|
+
night: "at night"
|
|
519
|
+
}
|
|
520
|
+
}, Ir = (e, t) => {
|
|
521
|
+
const r = Number(e), n = r % 100;
|
|
522
|
+
if (n > 20 || n < 10)
|
|
523
|
+
switch (n % 10) {
|
|
524
|
+
case 1:
|
|
525
|
+
return r + "st";
|
|
526
|
+
case 2:
|
|
527
|
+
return r + "nd";
|
|
528
|
+
case 3:
|
|
529
|
+
return r + "rd";
|
|
530
|
+
}
|
|
531
|
+
return r + "th";
|
|
532
|
+
}, jr = {
|
|
533
|
+
ordinalNumber: Ir,
|
|
534
|
+
era: ae({
|
|
535
|
+
values: zr,
|
|
536
|
+
defaultWidth: "wide"
|
|
537
|
+
}),
|
|
538
|
+
quarter: ae({
|
|
539
|
+
values: _r,
|
|
540
|
+
defaultWidth: "wide",
|
|
541
|
+
argumentCallback: (e) => e - 1
|
|
542
|
+
}),
|
|
543
|
+
month: ae({
|
|
544
|
+
values: Cr,
|
|
545
|
+
defaultWidth: "wide"
|
|
546
|
+
}),
|
|
547
|
+
day: ae({
|
|
548
|
+
values: Wr,
|
|
549
|
+
defaultWidth: "wide"
|
|
550
|
+
}),
|
|
551
|
+
dayPeriod: ae({
|
|
552
|
+
values: Lr,
|
|
553
|
+
defaultWidth: "wide",
|
|
554
|
+
formattingValues: Hr,
|
|
555
|
+
defaultFormattingWidth: "wide"
|
|
556
|
+
})
|
|
557
|
+
};
|
|
558
|
+
function oe(e) {
|
|
559
|
+
return (t, r = {}) => {
|
|
560
|
+
const n = r.width, i = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], a = t.match(i);
|
|
561
|
+
if (!a)
|
|
562
|
+
return null;
|
|
563
|
+
const u = a[0], c = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], s = Array.isArray(c) ? Yr(c, (l) => l.test(u)) : (
|
|
564
|
+
// [TODO] -- I challenge you to fix the type
|
|
565
|
+
Br(c, (l) => l.test(u))
|
|
566
|
+
);
|
|
567
|
+
let o;
|
|
568
|
+
o = e.valueCallback ? e.valueCallback(s) : s, o = r.valueCallback ? (
|
|
569
|
+
// [TODO] -- I challenge you to fix the type
|
|
570
|
+
r.valueCallback(o)
|
|
571
|
+
) : o;
|
|
572
|
+
const f = t.slice(u.length);
|
|
573
|
+
return { value: o, rest: f };
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
function Br(e, t) {
|
|
577
|
+
for (const r in e)
|
|
578
|
+
if (Object.prototype.hasOwnProperty.call(e, r) && t(e[r]))
|
|
579
|
+
return r;
|
|
580
|
+
}
|
|
581
|
+
function Yr(e, t) {
|
|
582
|
+
for (let r = 0; r < e.length; r++)
|
|
583
|
+
if (t(e[r]))
|
|
584
|
+
return r;
|
|
585
|
+
}
|
|
586
|
+
function Fr(e) {
|
|
587
|
+
return (t, r = {}) => {
|
|
588
|
+
const n = t.match(e.matchPattern);
|
|
589
|
+
if (!n) return null;
|
|
590
|
+
const i = n[0], a = t.match(e.parsePattern);
|
|
591
|
+
if (!a) return null;
|
|
592
|
+
let u = e.valueCallback ? e.valueCallback(a[0]) : a[0];
|
|
593
|
+
u = r.valueCallback ? r.valueCallback(u) : u;
|
|
594
|
+
const c = t.slice(i.length);
|
|
595
|
+
return { value: u, rest: c };
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
const $r = /^(\d+)(th|st|nd|rd)?/i, qr = /\d+/i, Xr = {
|
|
599
|
+
narrow: /^(b|a)/i,
|
|
600
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
601
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
602
|
+
}, Ur = {
|
|
603
|
+
any: [/^b/i, /^(a|c)/i]
|
|
604
|
+
}, Gr = {
|
|
605
|
+
narrow: /^[1234]/i,
|
|
606
|
+
abbreviated: /^q[1234]/i,
|
|
607
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
608
|
+
}, Kr = {
|
|
609
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
610
|
+
}, Vr = {
|
|
611
|
+
narrow: /^[jfmasond]/i,
|
|
612
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
613
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
614
|
+
}, Qr = {
|
|
615
|
+
narrow: [
|
|
616
|
+
/^j/i,
|
|
617
|
+
/^f/i,
|
|
618
|
+
/^m/i,
|
|
619
|
+
/^a/i,
|
|
620
|
+
/^m/i,
|
|
621
|
+
/^j/i,
|
|
622
|
+
/^j/i,
|
|
623
|
+
/^a/i,
|
|
624
|
+
/^s/i,
|
|
625
|
+
/^o/i,
|
|
626
|
+
/^n/i,
|
|
627
|
+
/^d/i
|
|
628
|
+
],
|
|
629
|
+
any: [
|
|
630
|
+
/^ja/i,
|
|
631
|
+
/^f/i,
|
|
632
|
+
/^mar/i,
|
|
633
|
+
/^ap/i,
|
|
634
|
+
/^may/i,
|
|
635
|
+
/^jun/i,
|
|
636
|
+
/^jul/i,
|
|
637
|
+
/^au/i,
|
|
638
|
+
/^s/i,
|
|
639
|
+
/^o/i,
|
|
640
|
+
/^n/i,
|
|
641
|
+
/^d/i
|
|
642
|
+
]
|
|
643
|
+
}, Jr = {
|
|
644
|
+
narrow: /^[smtwf]/i,
|
|
645
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
646
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
647
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
648
|
+
}, Zr = {
|
|
649
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
650
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
651
|
+
}, en = {
|
|
652
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
653
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
654
|
+
}, tn = {
|
|
655
|
+
any: {
|
|
656
|
+
am: /^a/i,
|
|
657
|
+
pm: /^p/i,
|
|
658
|
+
midnight: /^mi/i,
|
|
659
|
+
noon: /^no/i,
|
|
660
|
+
morning: /morning/i,
|
|
661
|
+
afternoon: /afternoon/i,
|
|
662
|
+
evening: /evening/i,
|
|
663
|
+
night: /night/i
|
|
664
|
+
}
|
|
665
|
+
}, rn = {
|
|
666
|
+
ordinalNumber: Fr({
|
|
667
|
+
matchPattern: $r,
|
|
668
|
+
parsePattern: qr,
|
|
669
|
+
valueCallback: (e) => parseInt(e, 10)
|
|
670
|
+
}),
|
|
671
|
+
era: oe({
|
|
672
|
+
matchPatterns: Xr,
|
|
673
|
+
defaultMatchWidth: "wide",
|
|
674
|
+
parsePatterns: Ur,
|
|
675
|
+
defaultParseWidth: "any"
|
|
676
|
+
}),
|
|
677
|
+
quarter: oe({
|
|
678
|
+
matchPatterns: Gr,
|
|
679
|
+
defaultMatchWidth: "wide",
|
|
680
|
+
parsePatterns: Kr,
|
|
681
|
+
defaultParseWidth: "any",
|
|
682
|
+
valueCallback: (e) => e + 1
|
|
683
|
+
}),
|
|
684
|
+
month: oe({
|
|
685
|
+
matchPatterns: Vr,
|
|
686
|
+
defaultMatchWidth: "wide",
|
|
687
|
+
parsePatterns: Qr,
|
|
688
|
+
defaultParseWidth: "any"
|
|
689
|
+
}),
|
|
690
|
+
day: oe({
|
|
691
|
+
matchPatterns: Jr,
|
|
692
|
+
defaultMatchWidth: "wide",
|
|
693
|
+
parsePatterns: Zr,
|
|
694
|
+
defaultParseWidth: "any"
|
|
695
|
+
}),
|
|
696
|
+
dayPeriod: oe({
|
|
697
|
+
matchPatterns: en,
|
|
698
|
+
defaultMatchWidth: "any",
|
|
699
|
+
parsePatterns: tn,
|
|
700
|
+
defaultParseWidth: "any"
|
|
701
|
+
})
|
|
702
|
+
}, nn = {
|
|
703
|
+
code: "en-US",
|
|
704
|
+
formatDistance: Mr,
|
|
705
|
+
formatLong: kr,
|
|
706
|
+
formatRelative: Ar,
|
|
707
|
+
localize: jr,
|
|
708
|
+
match: rn,
|
|
709
|
+
options: {
|
|
710
|
+
weekStartsOn: 0,
|
|
711
|
+
firstWeekContainsDate: 1
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
function an(e, t) {
|
|
715
|
+
const r = N(e, t == null ? void 0 : t.in);
|
|
716
|
+
return q(r, Dr(r)) + 1;
|
|
717
|
+
}
|
|
718
|
+
function on(e, t) {
|
|
719
|
+
const r = N(e, t == null ? void 0 : t.in), n = +De(r) - +pr(r);
|
|
720
|
+
return Math.round(n / At) + 1;
|
|
721
|
+
}
|
|
722
|
+
function Wt(e, t) {
|
|
723
|
+
var f, l, d, h;
|
|
724
|
+
const r = N(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = Me(), a = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((l = (f = t == null ? void 0 : t.locale) == null ? void 0 : f.options) == null ? void 0 : l.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((h = (d = i.locale) == null ? void 0 : d.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, u = W((t == null ? void 0 : t.in) || e, 0);
|
|
725
|
+
u.setFullYear(n + 1, 0, a), u.setHours(0, 0, 0, 0);
|
|
726
|
+
const c = B(u, t), s = W((t == null ? void 0 : t.in) || e, 0);
|
|
727
|
+
s.setFullYear(n, 0, a), s.setHours(0, 0, 0, 0);
|
|
728
|
+
const o = B(s, t);
|
|
729
|
+
return +r >= +c ? n + 1 : +r >= +o ? n : n - 1;
|
|
730
|
+
}
|
|
731
|
+
function sn(e, t) {
|
|
732
|
+
var c, s, o, f;
|
|
733
|
+
const r = Me(), n = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((s = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : s.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((f = (o = r.locale) == null ? void 0 : o.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, i = Wt(e, t), a = W((t == null ? void 0 : t.in) || e, 0);
|
|
734
|
+
return a.setFullYear(i, 0, n), a.setHours(0, 0, 0, 0), B(a, t);
|
|
735
|
+
}
|
|
736
|
+
function un(e, t) {
|
|
737
|
+
const r = N(e, t == null ? void 0 : t.in), n = +B(r, t) - +sn(r, t);
|
|
738
|
+
return Math.round(n / At) + 1;
|
|
739
|
+
}
|
|
740
|
+
function T(e, t) {
|
|
741
|
+
const r = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
|
|
742
|
+
return r + n;
|
|
743
|
+
}
|
|
744
|
+
const Y = {
|
|
745
|
+
// Year
|
|
746
|
+
y(e, t) {
|
|
747
|
+
const r = e.getFullYear(), n = r > 0 ? r : 1 - r;
|
|
748
|
+
return T(t === "yy" ? n % 100 : n, t.length);
|
|
749
|
+
},
|
|
750
|
+
// Month
|
|
751
|
+
M(e, t) {
|
|
752
|
+
const r = e.getMonth();
|
|
753
|
+
return t === "M" ? String(r + 1) : T(r + 1, 2);
|
|
754
|
+
},
|
|
755
|
+
// Day of the month
|
|
756
|
+
d(e, t) {
|
|
757
|
+
return T(e.getDate(), t.length);
|
|
758
|
+
},
|
|
759
|
+
// AM or PM
|
|
760
|
+
a(e, t) {
|
|
761
|
+
const r = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
762
|
+
switch (t) {
|
|
763
|
+
case "a":
|
|
764
|
+
case "aa":
|
|
765
|
+
return r.toUpperCase();
|
|
766
|
+
case "aaa":
|
|
767
|
+
return r;
|
|
768
|
+
case "aaaaa":
|
|
769
|
+
return r[0];
|
|
770
|
+
case "aaaa":
|
|
771
|
+
default:
|
|
772
|
+
return r === "am" ? "a.m." : "p.m.";
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
// Hour [1-12]
|
|
776
|
+
h(e, t) {
|
|
777
|
+
return T(e.getHours() % 12 || 12, t.length);
|
|
778
|
+
},
|
|
779
|
+
// Hour [0-23]
|
|
780
|
+
H(e, t) {
|
|
781
|
+
return T(e.getHours(), t.length);
|
|
782
|
+
},
|
|
783
|
+
// Minute
|
|
784
|
+
m(e, t) {
|
|
785
|
+
return T(e.getMinutes(), t.length);
|
|
786
|
+
},
|
|
787
|
+
// Second
|
|
788
|
+
s(e, t) {
|
|
789
|
+
return T(e.getSeconds(), t.length);
|
|
790
|
+
},
|
|
791
|
+
// Fraction of second
|
|
792
|
+
S(e, t) {
|
|
793
|
+
const r = t.length, n = e.getMilliseconds(), i = Math.trunc(
|
|
794
|
+
n * Math.pow(10, r - 3)
|
|
795
|
+
);
|
|
796
|
+
return T(i, t.length);
|
|
797
|
+
}
|
|
798
|
+
}, Z = {
|
|
799
|
+
midnight: "midnight",
|
|
800
|
+
noon: "noon",
|
|
801
|
+
morning: "morning",
|
|
802
|
+
afternoon: "afternoon",
|
|
803
|
+
evening: "evening",
|
|
804
|
+
night: "night"
|
|
805
|
+
}, Ze = {
|
|
806
|
+
// Era
|
|
807
|
+
G: function(e, t, r) {
|
|
808
|
+
const n = e.getFullYear() > 0 ? 1 : 0;
|
|
809
|
+
switch (t) {
|
|
810
|
+
// AD, BC
|
|
811
|
+
case "G":
|
|
812
|
+
case "GG":
|
|
813
|
+
case "GGG":
|
|
814
|
+
return r.era(n, { width: "abbreviated" });
|
|
815
|
+
// A, B
|
|
816
|
+
case "GGGGG":
|
|
817
|
+
return r.era(n, { width: "narrow" });
|
|
818
|
+
// Anno Domini, Before Christ
|
|
819
|
+
case "GGGG":
|
|
820
|
+
default:
|
|
821
|
+
return r.era(n, { width: "wide" });
|
|
822
|
+
}
|
|
823
|
+
},
|
|
824
|
+
// Year
|
|
825
|
+
y: function(e, t, r) {
|
|
826
|
+
if (t === "yo") {
|
|
827
|
+
const n = e.getFullYear(), i = n > 0 ? n : 1 - n;
|
|
828
|
+
return r.ordinalNumber(i, { unit: "year" });
|
|
829
|
+
}
|
|
830
|
+
return Y.y(e, t);
|
|
831
|
+
},
|
|
832
|
+
// Local week-numbering year
|
|
833
|
+
Y: function(e, t, r, n) {
|
|
834
|
+
const i = Wt(e, n), a = i > 0 ? i : 1 - i;
|
|
835
|
+
if (t === "YY") {
|
|
836
|
+
const u = a % 100;
|
|
837
|
+
return T(u, 2);
|
|
838
|
+
}
|
|
839
|
+
return t === "Yo" ? r.ordinalNumber(a, { unit: "year" }) : T(a, t.length);
|
|
840
|
+
},
|
|
841
|
+
// ISO week-numbering year
|
|
842
|
+
R: function(e, t) {
|
|
843
|
+
const r = _t(e);
|
|
844
|
+
return T(r, t.length);
|
|
845
|
+
},
|
|
846
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
847
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
848
|
+
// | Year | `y` | `u` |
|
|
849
|
+
// |------|-----|-----|
|
|
850
|
+
// | AC 1 | 1 | 1 |
|
|
851
|
+
// | BC 1 | 1 | 0 |
|
|
852
|
+
// | BC 2 | 2 | -1 |
|
|
853
|
+
// Also `yy` always returns the last two digits of a year,
|
|
854
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
855
|
+
u: function(e, t) {
|
|
856
|
+
const r = e.getFullYear();
|
|
857
|
+
return T(r, t.length);
|
|
858
|
+
},
|
|
859
|
+
// Quarter
|
|
860
|
+
Q: function(e, t, r) {
|
|
861
|
+
const n = Math.ceil((e.getMonth() + 1) / 3);
|
|
862
|
+
switch (t) {
|
|
863
|
+
// 1, 2, 3, 4
|
|
864
|
+
case "Q":
|
|
865
|
+
return String(n);
|
|
866
|
+
// 01, 02, 03, 04
|
|
867
|
+
case "QQ":
|
|
868
|
+
return T(n, 2);
|
|
869
|
+
// 1st, 2nd, 3rd, 4th
|
|
870
|
+
case "Qo":
|
|
871
|
+
return r.ordinalNumber(n, { unit: "quarter" });
|
|
872
|
+
// Q1, Q2, Q3, Q4
|
|
873
|
+
case "QQQ":
|
|
874
|
+
return r.quarter(n, {
|
|
875
|
+
width: "abbreviated",
|
|
876
|
+
context: "formatting"
|
|
877
|
+
});
|
|
878
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
879
|
+
case "QQQQQ":
|
|
880
|
+
return r.quarter(n, {
|
|
881
|
+
width: "narrow",
|
|
882
|
+
context: "formatting"
|
|
883
|
+
});
|
|
884
|
+
// 1st quarter, 2nd quarter, ...
|
|
885
|
+
case "QQQQ":
|
|
886
|
+
default:
|
|
887
|
+
return r.quarter(n, {
|
|
888
|
+
width: "wide",
|
|
889
|
+
context: "formatting"
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
},
|
|
893
|
+
// Stand-alone quarter
|
|
894
|
+
q: function(e, t, r) {
|
|
895
|
+
const n = Math.ceil((e.getMonth() + 1) / 3);
|
|
896
|
+
switch (t) {
|
|
897
|
+
// 1, 2, 3, 4
|
|
898
|
+
case "q":
|
|
899
|
+
return String(n);
|
|
900
|
+
// 01, 02, 03, 04
|
|
901
|
+
case "qq":
|
|
902
|
+
return T(n, 2);
|
|
903
|
+
// 1st, 2nd, 3rd, 4th
|
|
904
|
+
case "qo":
|
|
905
|
+
return r.ordinalNumber(n, { unit: "quarter" });
|
|
906
|
+
// Q1, Q2, Q3, Q4
|
|
907
|
+
case "qqq":
|
|
908
|
+
return r.quarter(n, {
|
|
909
|
+
width: "abbreviated",
|
|
910
|
+
context: "standalone"
|
|
911
|
+
});
|
|
912
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
913
|
+
case "qqqqq":
|
|
914
|
+
return r.quarter(n, {
|
|
915
|
+
width: "narrow",
|
|
916
|
+
context: "standalone"
|
|
917
|
+
});
|
|
918
|
+
// 1st quarter, 2nd quarter, ...
|
|
919
|
+
case "qqqq":
|
|
920
|
+
default:
|
|
921
|
+
return r.quarter(n, {
|
|
922
|
+
width: "wide",
|
|
923
|
+
context: "standalone"
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
},
|
|
927
|
+
// Month
|
|
928
|
+
M: function(e, t, r) {
|
|
929
|
+
const n = e.getMonth();
|
|
930
|
+
switch (t) {
|
|
931
|
+
case "M":
|
|
932
|
+
case "MM":
|
|
933
|
+
return Y.M(e, t);
|
|
934
|
+
// 1st, 2nd, ..., 12th
|
|
935
|
+
case "Mo":
|
|
936
|
+
return r.ordinalNumber(n + 1, { unit: "month" });
|
|
937
|
+
// Jan, Feb, ..., Dec
|
|
938
|
+
case "MMM":
|
|
939
|
+
return r.month(n, {
|
|
940
|
+
width: "abbreviated",
|
|
941
|
+
context: "formatting"
|
|
942
|
+
});
|
|
943
|
+
// J, F, ..., D
|
|
944
|
+
case "MMMMM":
|
|
945
|
+
return r.month(n, {
|
|
946
|
+
width: "narrow",
|
|
947
|
+
context: "formatting"
|
|
948
|
+
});
|
|
949
|
+
// January, February, ..., December
|
|
950
|
+
case "MMMM":
|
|
951
|
+
default:
|
|
952
|
+
return r.month(n, { width: "wide", context: "formatting" });
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
// Stand-alone month
|
|
956
|
+
L: function(e, t, r) {
|
|
957
|
+
const n = e.getMonth();
|
|
958
|
+
switch (t) {
|
|
959
|
+
// 1, 2, ..., 12
|
|
960
|
+
case "L":
|
|
961
|
+
return String(n + 1);
|
|
962
|
+
// 01, 02, ..., 12
|
|
963
|
+
case "LL":
|
|
964
|
+
return T(n + 1, 2);
|
|
965
|
+
// 1st, 2nd, ..., 12th
|
|
966
|
+
case "Lo":
|
|
967
|
+
return r.ordinalNumber(n + 1, { unit: "month" });
|
|
968
|
+
// Jan, Feb, ..., Dec
|
|
969
|
+
case "LLL":
|
|
970
|
+
return r.month(n, {
|
|
971
|
+
width: "abbreviated",
|
|
972
|
+
context: "standalone"
|
|
973
|
+
});
|
|
974
|
+
// J, F, ..., D
|
|
975
|
+
case "LLLLL":
|
|
976
|
+
return r.month(n, {
|
|
977
|
+
width: "narrow",
|
|
978
|
+
context: "standalone"
|
|
979
|
+
});
|
|
980
|
+
// January, February, ..., December
|
|
981
|
+
case "LLLL":
|
|
982
|
+
default:
|
|
983
|
+
return r.month(n, { width: "wide", context: "standalone" });
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
// Local week of year
|
|
987
|
+
w: function(e, t, r, n) {
|
|
988
|
+
const i = un(e, n);
|
|
989
|
+
return t === "wo" ? r.ordinalNumber(i, { unit: "week" }) : T(i, t.length);
|
|
990
|
+
},
|
|
991
|
+
// ISO week of year
|
|
992
|
+
I: function(e, t, r) {
|
|
993
|
+
const n = on(e);
|
|
994
|
+
return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : T(n, t.length);
|
|
995
|
+
},
|
|
996
|
+
// Day of the month
|
|
997
|
+
d: function(e, t, r) {
|
|
998
|
+
return t === "do" ? r.ordinalNumber(e.getDate(), { unit: "date" }) : Y.d(e, t);
|
|
999
|
+
},
|
|
1000
|
+
// Day of year
|
|
1001
|
+
D: function(e, t, r) {
|
|
1002
|
+
const n = an(e);
|
|
1003
|
+
return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : T(n, t.length);
|
|
1004
|
+
},
|
|
1005
|
+
// Day of week
|
|
1006
|
+
E: function(e, t, r) {
|
|
1007
|
+
const n = e.getDay();
|
|
1008
|
+
switch (t) {
|
|
1009
|
+
// Tue
|
|
1010
|
+
case "E":
|
|
1011
|
+
case "EE":
|
|
1012
|
+
case "EEE":
|
|
1013
|
+
return r.day(n, {
|
|
1014
|
+
width: "abbreviated",
|
|
1015
|
+
context: "formatting"
|
|
1016
|
+
});
|
|
1017
|
+
// T
|
|
1018
|
+
case "EEEEE":
|
|
1019
|
+
return r.day(n, {
|
|
1020
|
+
width: "narrow",
|
|
1021
|
+
context: "formatting"
|
|
1022
|
+
});
|
|
1023
|
+
// Tu
|
|
1024
|
+
case "EEEEEE":
|
|
1025
|
+
return r.day(n, {
|
|
1026
|
+
width: "short",
|
|
1027
|
+
context: "formatting"
|
|
1028
|
+
});
|
|
1029
|
+
// Tuesday
|
|
1030
|
+
case "EEEE":
|
|
1031
|
+
default:
|
|
1032
|
+
return r.day(n, {
|
|
1033
|
+
width: "wide",
|
|
1034
|
+
context: "formatting"
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
// Local day of week
|
|
1039
|
+
e: function(e, t, r, n) {
|
|
1040
|
+
const i = e.getDay(), a = (i - n.weekStartsOn + 8) % 7 || 7;
|
|
1041
|
+
switch (t) {
|
|
1042
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1043
|
+
case "e":
|
|
1044
|
+
return String(a);
|
|
1045
|
+
// Padded numerical value
|
|
1046
|
+
case "ee":
|
|
1047
|
+
return T(a, 2);
|
|
1048
|
+
// 1st, 2nd, ..., 7th
|
|
1049
|
+
case "eo":
|
|
1050
|
+
return r.ordinalNumber(a, { unit: "day" });
|
|
1051
|
+
case "eee":
|
|
1052
|
+
return r.day(i, {
|
|
1053
|
+
width: "abbreviated",
|
|
1054
|
+
context: "formatting"
|
|
1055
|
+
});
|
|
1056
|
+
// T
|
|
1057
|
+
case "eeeee":
|
|
1058
|
+
return r.day(i, {
|
|
1059
|
+
width: "narrow",
|
|
1060
|
+
context: "formatting"
|
|
1061
|
+
});
|
|
1062
|
+
// Tu
|
|
1063
|
+
case "eeeeee":
|
|
1064
|
+
return r.day(i, {
|
|
1065
|
+
width: "short",
|
|
1066
|
+
context: "formatting"
|
|
1067
|
+
});
|
|
1068
|
+
// Tuesday
|
|
1069
|
+
case "eeee":
|
|
1070
|
+
default:
|
|
1071
|
+
return r.day(i, {
|
|
1072
|
+
width: "wide",
|
|
1073
|
+
context: "formatting"
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
// Stand-alone local day of week
|
|
1078
|
+
c: function(e, t, r, n) {
|
|
1079
|
+
const i = e.getDay(), a = (i - n.weekStartsOn + 8) % 7 || 7;
|
|
1080
|
+
switch (t) {
|
|
1081
|
+
// Numerical value (same as in `e`)
|
|
1082
|
+
case "c":
|
|
1083
|
+
return String(a);
|
|
1084
|
+
// Padded numerical value
|
|
1085
|
+
case "cc":
|
|
1086
|
+
return T(a, t.length);
|
|
1087
|
+
// 1st, 2nd, ..., 7th
|
|
1088
|
+
case "co":
|
|
1089
|
+
return r.ordinalNumber(a, { unit: "day" });
|
|
1090
|
+
case "ccc":
|
|
1091
|
+
return r.day(i, {
|
|
1092
|
+
width: "abbreviated",
|
|
1093
|
+
context: "standalone"
|
|
1094
|
+
});
|
|
1095
|
+
// T
|
|
1096
|
+
case "ccccc":
|
|
1097
|
+
return r.day(i, {
|
|
1098
|
+
width: "narrow",
|
|
1099
|
+
context: "standalone"
|
|
1100
|
+
});
|
|
1101
|
+
// Tu
|
|
1102
|
+
case "cccccc":
|
|
1103
|
+
return r.day(i, {
|
|
1104
|
+
width: "short",
|
|
1105
|
+
context: "standalone"
|
|
1106
|
+
});
|
|
1107
|
+
// Tuesday
|
|
1108
|
+
case "cccc":
|
|
1109
|
+
default:
|
|
1110
|
+
return r.day(i, {
|
|
1111
|
+
width: "wide",
|
|
1112
|
+
context: "standalone"
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
},
|
|
1116
|
+
// ISO day of week
|
|
1117
|
+
i: function(e, t, r) {
|
|
1118
|
+
const n = e.getDay(), i = n === 0 ? 7 : n;
|
|
1119
|
+
switch (t) {
|
|
1120
|
+
// 2
|
|
1121
|
+
case "i":
|
|
1122
|
+
return String(i);
|
|
1123
|
+
// 02
|
|
1124
|
+
case "ii":
|
|
1125
|
+
return T(i, t.length);
|
|
1126
|
+
// 2nd
|
|
1127
|
+
case "io":
|
|
1128
|
+
return r.ordinalNumber(i, { unit: "day" });
|
|
1129
|
+
// Tue
|
|
1130
|
+
case "iii":
|
|
1131
|
+
return r.day(n, {
|
|
1132
|
+
width: "abbreviated",
|
|
1133
|
+
context: "formatting"
|
|
1134
|
+
});
|
|
1135
|
+
// T
|
|
1136
|
+
case "iiiii":
|
|
1137
|
+
return r.day(n, {
|
|
1138
|
+
width: "narrow",
|
|
1139
|
+
context: "formatting"
|
|
1140
|
+
});
|
|
1141
|
+
// Tu
|
|
1142
|
+
case "iiiiii":
|
|
1143
|
+
return r.day(n, {
|
|
1144
|
+
width: "short",
|
|
1145
|
+
context: "formatting"
|
|
1146
|
+
});
|
|
1147
|
+
// Tuesday
|
|
1148
|
+
case "iiii":
|
|
1149
|
+
default:
|
|
1150
|
+
return r.day(n, {
|
|
1151
|
+
width: "wide",
|
|
1152
|
+
context: "formatting"
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
// AM or PM
|
|
1157
|
+
a: function(e, t, r) {
|
|
1158
|
+
const i = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1159
|
+
switch (t) {
|
|
1160
|
+
case "a":
|
|
1161
|
+
case "aa":
|
|
1162
|
+
return r.dayPeriod(i, {
|
|
1163
|
+
width: "abbreviated",
|
|
1164
|
+
context: "formatting"
|
|
1165
|
+
});
|
|
1166
|
+
case "aaa":
|
|
1167
|
+
return r.dayPeriod(i, {
|
|
1168
|
+
width: "abbreviated",
|
|
1169
|
+
context: "formatting"
|
|
1170
|
+
}).toLowerCase();
|
|
1171
|
+
case "aaaaa":
|
|
1172
|
+
return r.dayPeriod(i, {
|
|
1173
|
+
width: "narrow",
|
|
1174
|
+
context: "formatting"
|
|
1175
|
+
});
|
|
1176
|
+
case "aaaa":
|
|
1177
|
+
default:
|
|
1178
|
+
return r.dayPeriod(i, {
|
|
1179
|
+
width: "wide",
|
|
1180
|
+
context: "formatting"
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
},
|
|
1184
|
+
// AM, PM, midnight, noon
|
|
1185
|
+
b: function(e, t, r) {
|
|
1186
|
+
const n = e.getHours();
|
|
1187
|
+
let i;
|
|
1188
|
+
switch (n === 12 ? i = Z.noon : n === 0 ? i = Z.midnight : i = n / 12 >= 1 ? "pm" : "am", t) {
|
|
1189
|
+
case "b":
|
|
1190
|
+
case "bb":
|
|
1191
|
+
return r.dayPeriod(i, {
|
|
1192
|
+
width: "abbreviated",
|
|
1193
|
+
context: "formatting"
|
|
1194
|
+
});
|
|
1195
|
+
case "bbb":
|
|
1196
|
+
return r.dayPeriod(i, {
|
|
1197
|
+
width: "abbreviated",
|
|
1198
|
+
context: "formatting"
|
|
1199
|
+
}).toLowerCase();
|
|
1200
|
+
case "bbbbb":
|
|
1201
|
+
return r.dayPeriod(i, {
|
|
1202
|
+
width: "narrow",
|
|
1203
|
+
context: "formatting"
|
|
1204
|
+
});
|
|
1205
|
+
case "bbbb":
|
|
1206
|
+
default:
|
|
1207
|
+
return r.dayPeriod(i, {
|
|
1208
|
+
width: "wide",
|
|
1209
|
+
context: "formatting"
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
1214
|
+
B: function(e, t, r) {
|
|
1215
|
+
const n = e.getHours();
|
|
1216
|
+
let i;
|
|
1217
|
+
switch (n >= 17 ? i = Z.evening : n >= 12 ? i = Z.afternoon : n >= 4 ? i = Z.morning : i = Z.night, t) {
|
|
1218
|
+
case "B":
|
|
1219
|
+
case "BB":
|
|
1220
|
+
case "BBB":
|
|
1221
|
+
return r.dayPeriod(i, {
|
|
1222
|
+
width: "abbreviated",
|
|
1223
|
+
context: "formatting"
|
|
1224
|
+
});
|
|
1225
|
+
case "BBBBB":
|
|
1226
|
+
return r.dayPeriod(i, {
|
|
1227
|
+
width: "narrow",
|
|
1228
|
+
context: "formatting"
|
|
1229
|
+
});
|
|
1230
|
+
case "BBBB":
|
|
1231
|
+
default:
|
|
1232
|
+
return r.dayPeriod(i, {
|
|
1233
|
+
width: "wide",
|
|
1234
|
+
context: "formatting"
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1238
|
+
// Hour [1-12]
|
|
1239
|
+
h: function(e, t, r) {
|
|
1240
|
+
if (t === "ho") {
|
|
1241
|
+
let n = e.getHours() % 12;
|
|
1242
|
+
return n === 0 && (n = 12), r.ordinalNumber(n, { unit: "hour" });
|
|
1243
|
+
}
|
|
1244
|
+
return Y.h(e, t);
|
|
1245
|
+
},
|
|
1246
|
+
// Hour [0-23]
|
|
1247
|
+
H: function(e, t, r) {
|
|
1248
|
+
return t === "Ho" ? r.ordinalNumber(e.getHours(), { unit: "hour" }) : Y.H(e, t);
|
|
1249
|
+
},
|
|
1250
|
+
// Hour [0-11]
|
|
1251
|
+
K: function(e, t, r) {
|
|
1252
|
+
const n = e.getHours() % 12;
|
|
1253
|
+
return t === "Ko" ? r.ordinalNumber(n, { unit: "hour" }) : T(n, t.length);
|
|
1254
|
+
},
|
|
1255
|
+
// Hour [1-24]
|
|
1256
|
+
k: function(e, t, r) {
|
|
1257
|
+
let n = e.getHours();
|
|
1258
|
+
return n === 0 && (n = 24), t === "ko" ? r.ordinalNumber(n, { unit: "hour" }) : T(n, t.length);
|
|
1259
|
+
},
|
|
1260
|
+
// Minute
|
|
1261
|
+
m: function(e, t, r) {
|
|
1262
|
+
return t === "mo" ? r.ordinalNumber(e.getMinutes(), { unit: "minute" }) : Y.m(e, t);
|
|
1263
|
+
},
|
|
1264
|
+
// Second
|
|
1265
|
+
s: function(e, t, r) {
|
|
1266
|
+
return t === "so" ? r.ordinalNumber(e.getSeconds(), { unit: "second" }) : Y.s(e, t);
|
|
1267
|
+
},
|
|
1268
|
+
// Fraction of second
|
|
1269
|
+
S: function(e, t) {
|
|
1270
|
+
return Y.S(e, t);
|
|
1271
|
+
},
|
|
1272
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1273
|
+
X: function(e, t, r) {
|
|
1274
|
+
const n = e.getTimezoneOffset();
|
|
1275
|
+
if (n === 0)
|
|
1276
|
+
return "Z";
|
|
1277
|
+
switch (t) {
|
|
1278
|
+
// Hours and optional minutes
|
|
1279
|
+
case "X":
|
|
1280
|
+
return tt(n);
|
|
1281
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1282
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1283
|
+
// so this token always has the same output as `XX`
|
|
1284
|
+
case "XXXX":
|
|
1285
|
+
case "XX":
|
|
1286
|
+
return K(n);
|
|
1287
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
1288
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1289
|
+
// so this token always has the same output as `XXX`
|
|
1290
|
+
case "XXXXX":
|
|
1291
|
+
case "XXX":
|
|
1292
|
+
// Hours and minutes with `:` delimiter
|
|
1293
|
+
default:
|
|
1294
|
+
return K(n, ":");
|
|
1295
|
+
}
|
|
1296
|
+
},
|
|
1297
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1298
|
+
x: function(e, t, r) {
|
|
1299
|
+
const n = e.getTimezoneOffset();
|
|
1300
|
+
switch (t) {
|
|
1301
|
+
// Hours and optional minutes
|
|
1302
|
+
case "x":
|
|
1303
|
+
return tt(n);
|
|
1304
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1305
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1306
|
+
// so this token always has the same output as `xx`
|
|
1307
|
+
case "xxxx":
|
|
1308
|
+
case "xx":
|
|
1309
|
+
return K(n);
|
|
1310
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
1311
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1312
|
+
// so this token always has the same output as `xxx`
|
|
1313
|
+
case "xxxxx":
|
|
1314
|
+
case "xxx":
|
|
1315
|
+
// Hours and minutes with `:` delimiter
|
|
1316
|
+
default:
|
|
1317
|
+
return K(n, ":");
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1320
|
+
// Timezone (GMT)
|
|
1321
|
+
O: function(e, t, r) {
|
|
1322
|
+
const n = e.getTimezoneOffset();
|
|
1323
|
+
switch (t) {
|
|
1324
|
+
// Short
|
|
1325
|
+
case "O":
|
|
1326
|
+
case "OO":
|
|
1327
|
+
case "OOO":
|
|
1328
|
+
return "GMT" + et(n, ":");
|
|
1329
|
+
// Long
|
|
1330
|
+
case "OOOO":
|
|
1331
|
+
default:
|
|
1332
|
+
return "GMT" + K(n, ":");
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
// Timezone (specific non-location)
|
|
1336
|
+
z: function(e, t, r) {
|
|
1337
|
+
const n = e.getTimezoneOffset();
|
|
1338
|
+
switch (t) {
|
|
1339
|
+
// Short
|
|
1340
|
+
case "z":
|
|
1341
|
+
case "zz":
|
|
1342
|
+
case "zzz":
|
|
1343
|
+
return "GMT" + et(n, ":");
|
|
1344
|
+
// Long
|
|
1345
|
+
case "zzzz":
|
|
1346
|
+
default:
|
|
1347
|
+
return "GMT" + K(n, ":");
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
// Seconds timestamp
|
|
1351
|
+
t: function(e, t, r) {
|
|
1352
|
+
const n = Math.trunc(+e / 1e3);
|
|
1353
|
+
return T(n, t.length);
|
|
1354
|
+
},
|
|
1355
|
+
// Milliseconds timestamp
|
|
1356
|
+
T: function(e, t, r) {
|
|
1357
|
+
return T(+e, t.length);
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1360
|
+
function et(e, t = "") {
|
|
1361
|
+
const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Math.trunc(n / 60), a = n % 60;
|
|
1362
|
+
return a === 0 ? r + String(i) : r + String(i) + t + T(a, 2);
|
|
1363
|
+
}
|
|
1364
|
+
function tt(e, t) {
|
|
1365
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + T(Math.abs(e) / 60, 2) : K(e, t);
|
|
1366
|
+
}
|
|
1367
|
+
function K(e, t = "") {
|
|
1368
|
+
const r = e > 0 ? "-" : "+", n = Math.abs(e), i = T(Math.trunc(n / 60), 2), a = T(n % 60, 2);
|
|
1369
|
+
return r + i + t + a;
|
|
1370
|
+
}
|
|
1371
|
+
const rt = (e, t) => {
|
|
1372
|
+
switch (e) {
|
|
1373
|
+
case "P":
|
|
1374
|
+
return t.date({ width: "short" });
|
|
1375
|
+
case "PP":
|
|
1376
|
+
return t.date({ width: "medium" });
|
|
1377
|
+
case "PPP":
|
|
1378
|
+
return t.date({ width: "long" });
|
|
1379
|
+
case "PPPP":
|
|
1380
|
+
default:
|
|
1381
|
+
return t.date({ width: "full" });
|
|
1382
|
+
}
|
|
1383
|
+
}, Lt = (e, t) => {
|
|
1384
|
+
switch (e) {
|
|
1385
|
+
case "p":
|
|
1386
|
+
return t.time({ width: "short" });
|
|
1387
|
+
case "pp":
|
|
1388
|
+
return t.time({ width: "medium" });
|
|
1389
|
+
case "ppp":
|
|
1390
|
+
return t.time({ width: "long" });
|
|
1391
|
+
case "pppp":
|
|
1392
|
+
default:
|
|
1393
|
+
return t.time({ width: "full" });
|
|
1394
|
+
}
|
|
1395
|
+
}, cn = (e, t) => {
|
|
1396
|
+
const r = e.match(/(P+)(p+)?/) || [], n = r[1], i = r[2];
|
|
1397
|
+
if (!i)
|
|
1398
|
+
return rt(e, t);
|
|
1399
|
+
let a;
|
|
1400
|
+
switch (n) {
|
|
1401
|
+
case "P":
|
|
1402
|
+
a = t.dateTime({ width: "short" });
|
|
1403
|
+
break;
|
|
1404
|
+
case "PP":
|
|
1405
|
+
a = t.dateTime({ width: "medium" });
|
|
1406
|
+
break;
|
|
1407
|
+
case "PPP":
|
|
1408
|
+
a = t.dateTime({ width: "long" });
|
|
1409
|
+
break;
|
|
1410
|
+
case "PPPP":
|
|
1411
|
+
default:
|
|
1412
|
+
a = t.dateTime({ width: "full" });
|
|
1413
|
+
break;
|
|
1414
|
+
}
|
|
1415
|
+
return a.replace("{{date}}", rt(n, t)).replace("{{time}}", Lt(i, t));
|
|
1416
|
+
}, ln = {
|
|
1417
|
+
p: Lt,
|
|
1418
|
+
P: cn
|
|
1419
|
+
}, dn = /^D+$/, fn = /^Y+$/, hn = ["D", "DD", "YY", "YYYY"];
|
|
1420
|
+
function gn(e) {
|
|
1421
|
+
return dn.test(e);
|
|
1422
|
+
}
|
|
1423
|
+
function pn(e) {
|
|
1424
|
+
return fn.test(e);
|
|
1425
|
+
}
|
|
1426
|
+
function mn(e, t, r) {
|
|
1427
|
+
const n = yn(e, t, r);
|
|
1428
|
+
if (console.warn(n), hn.includes(e)) throw new RangeError(n);
|
|
1429
|
+
}
|
|
1430
|
+
function yn(e, t, r) {
|
|
1431
|
+
const n = e[0] === "Y" ? "years" : "days of the month";
|
|
1432
|
+
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1433
|
+
}
|
|
1434
|
+
const vn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, bn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, wn = /^'([^]*?)'?$/, xn = /''/g, Sn = /[a-zA-Z]/;
|
|
1435
|
+
function j(e, t, r) {
|
|
1436
|
+
var f, l, d, h;
|
|
1437
|
+
const n = Me(), i = n.locale ?? nn, a = n.firstWeekContainsDate ?? ((l = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, u = n.weekStartsOn ?? ((h = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : h.weekStartsOn) ?? 0, c = N(e, r == null ? void 0 : r.in);
|
|
1438
|
+
if (!xr(c))
|
|
1439
|
+
throw new RangeError("Invalid time value");
|
|
1440
|
+
let s = t.match(bn).map((g) => {
|
|
1441
|
+
const p = g[0];
|
|
1442
|
+
if (p === "p" || p === "P") {
|
|
1443
|
+
const m = ln[p];
|
|
1444
|
+
return m(g, i.formatLong);
|
|
1445
|
+
}
|
|
1446
|
+
return g;
|
|
1447
|
+
}).join("").match(vn).map((g) => {
|
|
1448
|
+
if (g === "''")
|
|
1449
|
+
return { isToken: !1, value: "'" };
|
|
1450
|
+
const p = g[0];
|
|
1451
|
+
if (p === "'")
|
|
1452
|
+
return { isToken: !1, value: On(g) };
|
|
1453
|
+
if (Ze[p])
|
|
1454
|
+
return { isToken: !0, value: g };
|
|
1455
|
+
if (p.match(Sn))
|
|
1456
|
+
throw new RangeError(
|
|
1457
|
+
"Format string contains an unescaped latin alphabet character `" + p + "`"
|
|
1458
|
+
);
|
|
1459
|
+
return { isToken: !1, value: g };
|
|
1460
|
+
});
|
|
1461
|
+
i.localize.preprocessor && (s = i.localize.preprocessor(c, s));
|
|
1462
|
+
const o = {
|
|
1463
|
+
firstWeekContainsDate: a,
|
|
1464
|
+
weekStartsOn: u,
|
|
1465
|
+
locale: i
|
|
1466
|
+
};
|
|
1467
|
+
return s.map((g) => {
|
|
1468
|
+
if (!g.isToken) return g.value;
|
|
1469
|
+
const p = g.value;
|
|
1470
|
+
(pn(p) || gn(p)) && mn(p, t, String(e));
|
|
1471
|
+
const m = Ze[p[0]];
|
|
1472
|
+
return m(c, p, i.localize, o);
|
|
1473
|
+
}).join("");
|
|
1474
|
+
}
|
|
1475
|
+
function On(e) {
|
|
1476
|
+
const t = e.match(wn);
|
|
1477
|
+
return t ? t[1].replace(xn, "'") : e;
|
|
1478
|
+
}
|
|
1479
|
+
function Dn(e, t) {
|
|
1480
|
+
return N(e, t == null ? void 0 : t.in).getDay();
|
|
1481
|
+
}
|
|
1482
|
+
function Tn(e, t) {
|
|
1483
|
+
const r = N(e, t == null ? void 0 : t.in), n = r.getMonth();
|
|
1484
|
+
return r.setFullYear(r.getFullYear(), n + 1, 0), r.setHours(0, 0, 0, 0), N(r, t == null ? void 0 : t.in);
|
|
1485
|
+
}
|
|
1486
|
+
function Mn(e, t, r) {
|
|
1487
|
+
let n = t - Dn(e, r);
|
|
1488
|
+
return n <= 0 && (n += 7), de(e, n, r);
|
|
1489
|
+
}
|
|
1490
|
+
function En(e, t) {
|
|
1491
|
+
return Mn(e, 0, t);
|
|
1492
|
+
}
|
|
1493
|
+
function _e(e, t, r) {
|
|
1494
|
+
const n = N(e, r == null ? void 0 : r.in);
|
|
1495
|
+
return n.setHours(t), n;
|
|
1496
|
+
}
|
|
1497
|
+
function Ye(e, t, r) {
|
|
1498
|
+
const n = Rn(e, t, r), i = Pn(e, t);
|
|
1499
|
+
return { width: n, height: i };
|
|
1500
|
+
}
|
|
1501
|
+
function Pn(e, t) {
|
|
1502
|
+
return t.pixelsPerResource;
|
|
1503
|
+
}
|
|
1504
|
+
function Rn(e, t, r) {
|
|
1505
|
+
return Math.abs(
|
|
1506
|
+
(q(r.end, r.start) + 1) * t.pixelsPerDay
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
function Fe(e, t, r, n) {
|
|
1510
|
+
const i = Ht(e, t, n), a = Nn(e, t, r.start, n);
|
|
1511
|
+
return {
|
|
1512
|
+
...i,
|
|
1513
|
+
...a
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
function Ht(e, t, r) {
|
|
1517
|
+
const n = q(e.end, e.start) * r.pixelsPerDay, i = e.size / t.capacity * r.pixelsPerResource;
|
|
1518
|
+
return { width: n, height: i };
|
|
1519
|
+
}
|
|
1520
|
+
function $e(e, t, r) {
|
|
1521
|
+
return q(e, t) * r.pixelsPerDay + r.pixelsPerDay / 2;
|
|
1522
|
+
}
|
|
1523
|
+
function kn(e, t, r) {
|
|
1524
|
+
return e / t * r.pixelsPerResource;
|
|
1525
|
+
}
|
|
1526
|
+
function Nn(e, t, r, n) {
|
|
1527
|
+
const i = $e(e.start, r, n), a = kn(e.offset, t.capacity, n);
|
|
1528
|
+
return { x: i, y: a };
|
|
1529
|
+
}
|
|
1530
|
+
function te(e, t) {
|
|
1531
|
+
const r = e.element.getBoundingClientRect(), n = {
|
|
1532
|
+
x: r.x - t.initial.input.pageX,
|
|
1533
|
+
y: r.y - t.initial.input.pageY
|
|
1534
|
+
}, i = {
|
|
1535
|
+
x: n.x / r.width,
|
|
1536
|
+
y: n.y / r.height
|
|
1537
|
+
};
|
|
1538
|
+
return {
|
|
1539
|
+
absolute: n,
|
|
1540
|
+
relative: i
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
function It(e, t, r, n, i) {
|
|
1544
|
+
return {
|
|
1545
|
+
id: e.id,
|
|
1546
|
+
swimlaneId: t.id,
|
|
1547
|
+
start: _e(
|
|
1548
|
+
de(i.start, Math.floor(r.x / n.pixelsPerDay)),
|
|
1549
|
+
12
|
|
1550
|
+
),
|
|
1551
|
+
end: _e(
|
|
1552
|
+
de(
|
|
1553
|
+
i.start,
|
|
1554
|
+
Math.floor(
|
|
1555
|
+
(r.x + r.width) / n.pixelsPerDay
|
|
1556
|
+
)
|
|
1557
|
+
),
|
|
1558
|
+
12
|
|
1559
|
+
),
|
|
1560
|
+
offset: Math.floor(
|
|
1561
|
+
r.y / n.pixelsPerResource * t.capacity
|
|
1562
|
+
),
|
|
1563
|
+
size: Math.floor(
|
|
1564
|
+
r.height / n.pixelsPerResource * t.capacity
|
|
1565
|
+
),
|
|
1566
|
+
payload: e.payload
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
function An({ focusedDay: e }) {
|
|
1570
|
+
const { settings: t } = pe();
|
|
1571
|
+
return /* @__PURE__ */ y(H.Background, { children: /* @__PURE__ */ y("div", { className: "timelane-background", children: /* @__PURE__ */ Q("div", { className: "timelane-background-inner", children: [
|
|
1572
|
+
e && /* @__PURE__ */ y(
|
|
1573
|
+
"div",
|
|
1574
|
+
{
|
|
1575
|
+
className: "timelane-background-focused-day-position",
|
|
1576
|
+
style: {
|
|
1577
|
+
width: `${t.pixelsPerDay}px`,
|
|
1578
|
+
marginLeft: `${$e(e, t.start, t) - t.pixelsPerDay / 2}px`
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
),
|
|
1582
|
+
/* @__PURE__ */ y(
|
|
1583
|
+
"div",
|
|
1584
|
+
{
|
|
1585
|
+
id: "timelane-background-date-anchor",
|
|
1586
|
+
style: {
|
|
1587
|
+
position: "absolute",
|
|
1588
|
+
top: 0,
|
|
1589
|
+
width: "1px",
|
|
1590
|
+
height: "100%"
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
),
|
|
1594
|
+
Ct(t).map((r, n) => /* @__PURE__ */ y(
|
|
1595
|
+
"div",
|
|
1596
|
+
{
|
|
1597
|
+
className: `timelane-background-day-label ${zt(r) ? "timelane-background-day-label-sunday" : ""} `,
|
|
1598
|
+
style: { width: `${t.pixelsPerDay}px` },
|
|
1599
|
+
"data-day": j(r, "yyyy-MM-dd")
|
|
1600
|
+
},
|
|
1601
|
+
n
|
|
1602
|
+
))
|
|
1603
|
+
] }) }) });
|
|
1604
|
+
}
|
|
1605
|
+
function zn(e) {
|
|
1606
|
+
if (Array.isArray(e)) return e;
|
|
1607
|
+
}
|
|
1608
|
+
function _n(e, t) {
|
|
1609
|
+
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
1610
|
+
if (r != null) {
|
|
1611
|
+
var n, i, a, u, c = [], s = !0, o = !1;
|
|
1612
|
+
try {
|
|
1613
|
+
if (a = (r = r.call(e)).next, t !== 0) for (; !(s = (n = a.call(r)).done) && (c.push(n.value), c.length !== t); s = !0) ;
|
|
1614
|
+
} catch (f) {
|
|
1615
|
+
o = !0, i = f;
|
|
1616
|
+
} finally {
|
|
1617
|
+
try {
|
|
1618
|
+
if (!s && r.return != null && (u = r.return(), Object(u) !== u)) return;
|
|
1619
|
+
} finally {
|
|
1620
|
+
if (o) throw i;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
return c;
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
function Ce(e, t) {
|
|
1627
|
+
(t == null || t > e.length) && (t = e.length);
|
|
1628
|
+
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
1629
|
+
return n;
|
|
1630
|
+
}
|
|
1631
|
+
function jt(e, t) {
|
|
1632
|
+
if (e) {
|
|
1633
|
+
if (typeof e == "string") return Ce(e, t);
|
|
1634
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
1635
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Ce(e, t) : void 0;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
function Cn() {
|
|
1639
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1640
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1641
|
+
}
|
|
1642
|
+
function Bt(e, t) {
|
|
1643
|
+
return zn(e) || _n(e, t) || jt(e, t) || Cn();
|
|
1644
|
+
}
|
|
1645
|
+
var Pe = {}, se = {}, nt;
|
|
1646
|
+
function Yt() {
|
|
1647
|
+
if (nt) return se;
|
|
1648
|
+
nt = 1, Object.defineProperty(se, "__esModule", { value: !0 }), se.bind = void 0;
|
|
1649
|
+
function e(t, r) {
|
|
1650
|
+
var n = r.type, i = r.listener, a = r.options;
|
|
1651
|
+
return t.addEventListener(n, i, a), function() {
|
|
1652
|
+
t.removeEventListener(n, i, a);
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
return se.bind = e, se;
|
|
1656
|
+
}
|
|
1657
|
+
var G = {}, it;
|
|
1658
|
+
function Wn() {
|
|
1659
|
+
if (it) return G;
|
|
1660
|
+
it = 1;
|
|
1661
|
+
var e = G && G.__assign || function() {
|
|
1662
|
+
return e = Object.assign || function(a) {
|
|
1663
|
+
for (var u, c = 1, s = arguments.length; c < s; c++) {
|
|
1664
|
+
u = arguments[c];
|
|
1665
|
+
for (var o in u) Object.prototype.hasOwnProperty.call(u, o) && (a[o] = u[o]);
|
|
1666
|
+
}
|
|
1667
|
+
return a;
|
|
1668
|
+
}, e.apply(this, arguments);
|
|
1669
|
+
};
|
|
1670
|
+
Object.defineProperty(G, "__esModule", { value: !0 }), G.bindAll = void 0;
|
|
1671
|
+
var t = /* @__PURE__ */ Yt();
|
|
1672
|
+
function r(a) {
|
|
1673
|
+
if (!(typeof a > "u"))
|
|
1674
|
+
return typeof a == "boolean" ? {
|
|
1675
|
+
capture: a
|
|
1676
|
+
} : a;
|
|
1677
|
+
}
|
|
1678
|
+
function n(a, u) {
|
|
1679
|
+
if (u == null)
|
|
1680
|
+
return a;
|
|
1681
|
+
var c = e(e({}, a), { options: e(e({}, r(u)), r(a.options)) });
|
|
1682
|
+
return c;
|
|
1683
|
+
}
|
|
1684
|
+
function i(a, u, c) {
|
|
1685
|
+
var s = u.map(function(o) {
|
|
1686
|
+
var f = n(o, c);
|
|
1687
|
+
return (0, t.bind)(a, f);
|
|
1688
|
+
});
|
|
1689
|
+
return function() {
|
|
1690
|
+
s.forEach(function(f) {
|
|
1691
|
+
return f();
|
|
1692
|
+
});
|
|
1693
|
+
};
|
|
1694
|
+
}
|
|
1695
|
+
return G.bindAll = i, G;
|
|
1696
|
+
}
|
|
1697
|
+
var at;
|
|
1698
|
+
function Ln() {
|
|
1699
|
+
return at || (at = 1, function(e) {
|
|
1700
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.bindAll = e.bind = void 0;
|
|
1701
|
+
var t = /* @__PURE__ */ Yt();
|
|
1702
|
+
Object.defineProperty(e, "bind", { enumerable: !0, get: function() {
|
|
1703
|
+
return t.bind;
|
|
1704
|
+
} });
|
|
1705
|
+
var r = /* @__PURE__ */ Wn();
|
|
1706
|
+
Object.defineProperty(e, "bindAll", { enumerable: !0, get: function() {
|
|
1707
|
+
return r.bindAll;
|
|
1708
|
+
} });
|
|
1709
|
+
}(Pe)), Pe;
|
|
1710
|
+
}
|
|
1711
|
+
var ne = /* @__PURE__ */ Ln(), Ft = "data-pdnd-honey-pot";
|
|
1712
|
+
function $t(e) {
|
|
1713
|
+
return e instanceof Element && e.hasAttribute(Ft);
|
|
1714
|
+
}
|
|
1715
|
+
function qt(e) {
|
|
1716
|
+
var t = document.elementsFromPoint(e.x, e.y), r = Bt(t, 2), n = r[0], i = r[1];
|
|
1717
|
+
return n ? $t(n) ? i ?? null : n : null;
|
|
1718
|
+
}
|
|
1719
|
+
function fe(e) {
|
|
1720
|
+
"@babel/helpers - typeof";
|
|
1721
|
+
return fe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
1722
|
+
return typeof t;
|
|
1723
|
+
} : function(t) {
|
|
1724
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1725
|
+
}, fe(e);
|
|
1726
|
+
}
|
|
1727
|
+
function Hn(e, t) {
|
|
1728
|
+
if (fe(e) != "object" || !e) return e;
|
|
1729
|
+
var r = e[Symbol.toPrimitive];
|
|
1730
|
+
if (r !== void 0) {
|
|
1731
|
+
var n = r.call(e, t);
|
|
1732
|
+
if (fe(n) != "object") return n;
|
|
1733
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1734
|
+
}
|
|
1735
|
+
return (t === "string" ? String : Number)(e);
|
|
1736
|
+
}
|
|
1737
|
+
function In(e) {
|
|
1738
|
+
var t = Hn(e, "string");
|
|
1739
|
+
return fe(t) == "symbol" ? t : t + "";
|
|
1740
|
+
}
|
|
1741
|
+
function qe(e, t, r) {
|
|
1742
|
+
return (t = In(t)) in e ? Object.defineProperty(e, t, {
|
|
1743
|
+
value: r,
|
|
1744
|
+
enumerable: !0,
|
|
1745
|
+
configurable: !0,
|
|
1746
|
+
writable: !0
|
|
1747
|
+
}) : e[t] = r, e;
|
|
1748
|
+
}
|
|
1749
|
+
var jn = 2147483647;
|
|
1750
|
+
function ot(e, t) {
|
|
1751
|
+
var r = Object.keys(e);
|
|
1752
|
+
if (Object.getOwnPropertySymbols) {
|
|
1753
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
1754
|
+
t && (n = n.filter(function(i) {
|
|
1755
|
+
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
1756
|
+
})), r.push.apply(r, n);
|
|
1757
|
+
}
|
|
1758
|
+
return r;
|
|
1759
|
+
}
|
|
1760
|
+
function st(e) {
|
|
1761
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1762
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
1763
|
+
t % 2 ? ot(Object(r), !0).forEach(function(n) {
|
|
1764
|
+
qe(e, n, r[n]);
|
|
1765
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ot(Object(r)).forEach(function(n) {
|
|
1766
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
return e;
|
|
1770
|
+
}
|
|
1771
|
+
var he = 2, ut = he / 2;
|
|
1772
|
+
function Bn(e) {
|
|
1773
|
+
return {
|
|
1774
|
+
x: Math.floor(e.x),
|
|
1775
|
+
y: Math.floor(e.y)
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
function Yn(e) {
|
|
1779
|
+
return {
|
|
1780
|
+
x: e.x - ut,
|
|
1781
|
+
y: e.y - ut
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1784
|
+
function Fn(e) {
|
|
1785
|
+
return {
|
|
1786
|
+
x: Math.max(e.x, 0),
|
|
1787
|
+
y: Math.max(e.y, 0)
|
|
1788
|
+
};
|
|
1789
|
+
}
|
|
1790
|
+
function $n(e) {
|
|
1791
|
+
return {
|
|
1792
|
+
x: Math.min(e.x, window.innerWidth - he),
|
|
1793
|
+
y: Math.min(e.y, window.innerHeight - he)
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1796
|
+
function ct(e) {
|
|
1797
|
+
var t = e.client, r = $n(Fn(Yn(Bn(t))));
|
|
1798
|
+
return DOMRect.fromRect({
|
|
1799
|
+
x: r.x,
|
|
1800
|
+
y: r.y,
|
|
1801
|
+
width: he,
|
|
1802
|
+
height: he
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
function lt(e) {
|
|
1806
|
+
var t = e.clientRect;
|
|
1807
|
+
return {
|
|
1808
|
+
left: "".concat(t.left, "px"),
|
|
1809
|
+
top: "".concat(t.top, "px"),
|
|
1810
|
+
width: "".concat(t.width, "px"),
|
|
1811
|
+
height: "".concat(t.height, "px")
|
|
1812
|
+
};
|
|
1813
|
+
}
|
|
1814
|
+
function qn(e) {
|
|
1815
|
+
var t = e.client, r = e.clientRect;
|
|
1816
|
+
return (
|
|
1817
|
+
// is within horizontal bounds
|
|
1818
|
+
t.x >= r.x && t.x <= r.x + r.width && // is within vertical bounds
|
|
1819
|
+
t.y >= r.y && t.y <= r.y + r.height
|
|
1820
|
+
);
|
|
1821
|
+
}
|
|
1822
|
+
function Xn(e) {
|
|
1823
|
+
var t = e.initial, r = document.createElement("div");
|
|
1824
|
+
r.setAttribute(Ft, "true");
|
|
1825
|
+
var n = ct({
|
|
1826
|
+
client: t
|
|
1827
|
+
});
|
|
1828
|
+
Object.assign(r.style, st(st({
|
|
1829
|
+
// Setting a background color explicitly to avoid any inherited styles.
|
|
1830
|
+
// Looks like this could be `opacity: 0`, but worried that _might_
|
|
1831
|
+
// cause the element to be ignored on some platforms.
|
|
1832
|
+
// When debugging, set backgroundColor to something like "red".
|
|
1833
|
+
backgroundColor: "transparent",
|
|
1834
|
+
position: "fixed",
|
|
1835
|
+
// Being explicit to avoid inheriting styles
|
|
1836
|
+
padding: 0,
|
|
1837
|
+
margin: 0,
|
|
1838
|
+
boxSizing: "border-box"
|
|
1839
|
+
}, lt({
|
|
1840
|
+
clientRect: n
|
|
1841
|
+
})), {}, {
|
|
1842
|
+
// We want this element to absorb pointer events,
|
|
1843
|
+
// it's kind of the whole point 😉
|
|
1844
|
+
pointerEvents: "auto",
|
|
1845
|
+
// Want to make sure the honey pot is top of everything else.
|
|
1846
|
+
// Don't need to worry about native drag previews, as they will
|
|
1847
|
+
// have been rendered (and removed) before the honey pot is rendered
|
|
1848
|
+
zIndex: jn
|
|
1849
|
+
})), document.body.appendChild(r);
|
|
1850
|
+
var i = ne.bind(window, {
|
|
1851
|
+
type: "pointermove",
|
|
1852
|
+
listener: function(u) {
|
|
1853
|
+
var c = {
|
|
1854
|
+
x: u.clientX,
|
|
1855
|
+
y: u.clientY
|
|
1856
|
+
};
|
|
1857
|
+
n = ct({
|
|
1858
|
+
client: c
|
|
1859
|
+
}), Object.assign(r.style, lt({
|
|
1860
|
+
clientRect: n
|
|
1861
|
+
}));
|
|
1862
|
+
},
|
|
1863
|
+
// using capture so we are less likely to be impacted by event stopping
|
|
1864
|
+
options: {
|
|
1865
|
+
capture: !0
|
|
1866
|
+
}
|
|
1867
|
+
});
|
|
1868
|
+
return function(u) {
|
|
1869
|
+
var c = u.current;
|
|
1870
|
+
if (i(), qn({
|
|
1871
|
+
client: c,
|
|
1872
|
+
clientRect: n
|
|
1873
|
+
})) {
|
|
1874
|
+
r.remove();
|
|
1875
|
+
return;
|
|
1876
|
+
}
|
|
1877
|
+
function s() {
|
|
1878
|
+
o(), r.remove();
|
|
1879
|
+
}
|
|
1880
|
+
var o = ne.bindAll(window, [
|
|
1881
|
+
{
|
|
1882
|
+
type: "pointerdown",
|
|
1883
|
+
listener: s
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
type: "pointermove",
|
|
1887
|
+
listener: s
|
|
1888
|
+
},
|
|
1889
|
+
{
|
|
1890
|
+
type: "focusin",
|
|
1891
|
+
listener: s
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
type: "focusout",
|
|
1895
|
+
listener: s
|
|
1896
|
+
},
|
|
1897
|
+
// a 'pointerdown' should happen before 'dragstart', but just being super safe
|
|
1898
|
+
{
|
|
1899
|
+
type: "dragstart",
|
|
1900
|
+
listener: s
|
|
1901
|
+
},
|
|
1902
|
+
// if the user has dragged something out of the window
|
|
1903
|
+
// and then is dragging something back into the window
|
|
1904
|
+
// the first events we will see are "dragenter" (and then "dragover").
|
|
1905
|
+
// So if we see any of these we need to clear the post drag fix.
|
|
1906
|
+
{
|
|
1907
|
+
type: "dragenter",
|
|
1908
|
+
listener: s
|
|
1909
|
+
},
|
|
1910
|
+
{
|
|
1911
|
+
type: "dragover",
|
|
1912
|
+
listener: s
|
|
1913
|
+
}
|
|
1914
|
+
// Not adding a "wheel" event listener, as "wheel" by itself does not
|
|
1915
|
+
// resolve the bug.
|
|
1916
|
+
], {
|
|
1917
|
+
// Using `capture` so less likely to be impacted by other code stopping events
|
|
1918
|
+
capture: !0
|
|
1919
|
+
});
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
function Un() {
|
|
1923
|
+
var e = null;
|
|
1924
|
+
function t() {
|
|
1925
|
+
return e = null, ne.bind(window, {
|
|
1926
|
+
type: "pointermove",
|
|
1927
|
+
listener: function(i) {
|
|
1928
|
+
e = {
|
|
1929
|
+
x: i.clientX,
|
|
1930
|
+
y: i.clientY
|
|
1931
|
+
};
|
|
1932
|
+
},
|
|
1933
|
+
// listening for pointer move in capture phase
|
|
1934
|
+
// so we are less likely to be impacted by events being stopped.
|
|
1935
|
+
options: {
|
|
1936
|
+
capture: !0
|
|
1937
|
+
}
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1940
|
+
function r() {
|
|
1941
|
+
var n = null;
|
|
1942
|
+
return function(a) {
|
|
1943
|
+
var u = a.eventName, c = a.payload;
|
|
1944
|
+
if (u === "onDragStart") {
|
|
1945
|
+
var s = c.location.initial.input, o = e ?? {
|
|
1946
|
+
x: s.clientX,
|
|
1947
|
+
y: s.clientY
|
|
1948
|
+
};
|
|
1949
|
+
n = Xn({
|
|
1950
|
+
initial: o
|
|
1951
|
+
});
|
|
1952
|
+
}
|
|
1953
|
+
if (u === "onDrop") {
|
|
1954
|
+
var f, l = c.location.current.input;
|
|
1955
|
+
(f = n) === null || f === void 0 || f({
|
|
1956
|
+
current: {
|
|
1957
|
+
x: l.clientX,
|
|
1958
|
+
y: l.clientY
|
|
1959
|
+
}
|
|
1960
|
+
}), n = null, e = null;
|
|
1961
|
+
}
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
return {
|
|
1965
|
+
bindEvents: t,
|
|
1966
|
+
getOnPostDispatch: r
|
|
1967
|
+
};
|
|
1968
|
+
}
|
|
1969
|
+
function Gn(e) {
|
|
1970
|
+
if (Array.isArray(e)) return Ce(e);
|
|
1971
|
+
}
|
|
1972
|
+
function Kn(e) {
|
|
1973
|
+
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
1974
|
+
}
|
|
1975
|
+
function Vn() {
|
|
1976
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1977
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1978
|
+
}
|
|
1979
|
+
function Xt(e) {
|
|
1980
|
+
return Gn(e) || Kn(e) || jt(e) || Vn();
|
|
1981
|
+
}
|
|
1982
|
+
function ie(e) {
|
|
1983
|
+
var t = null;
|
|
1984
|
+
return function() {
|
|
1985
|
+
if (!t) {
|
|
1986
|
+
for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++)
|
|
1987
|
+
i[a] = arguments[a];
|
|
1988
|
+
var u = e.apply(this, i);
|
|
1989
|
+
t = {
|
|
1990
|
+
result: u
|
|
1991
|
+
};
|
|
1992
|
+
}
|
|
1993
|
+
return t.result;
|
|
1994
|
+
};
|
|
1995
|
+
}
|
|
1996
|
+
var Qn = ie(function() {
|
|
1997
|
+
return process.env.NODE_ENV === "test" ? !1 : navigator.userAgent.includes("Firefox");
|
|
1998
|
+
}), Xe = ie(function() {
|
|
1999
|
+
if (process.env.NODE_ENV === "test")
|
|
2000
|
+
return !1;
|
|
2001
|
+
var t = navigator, r = t.userAgent;
|
|
2002
|
+
return r.includes("AppleWebKit") && !r.includes("Chrome");
|
|
2003
|
+
}), We = {
|
|
2004
|
+
isLeavingWindow: Symbol("leaving"),
|
|
2005
|
+
isEnteringWindow: Symbol("entering")
|
|
2006
|
+
};
|
|
2007
|
+
function Jn(e) {
|
|
2008
|
+
var t = e.dragLeave;
|
|
2009
|
+
return Xe() ? t.hasOwnProperty(We.isLeavingWindow) : !1;
|
|
2010
|
+
}
|
|
2011
|
+
(function() {
|
|
2012
|
+
if (typeof window > "u" || process.env.NODE_ENV === "test" || !Xe())
|
|
2013
|
+
return;
|
|
2014
|
+
function t() {
|
|
2015
|
+
return {
|
|
2016
|
+
enterCount: 0,
|
|
2017
|
+
isOverWindow: !1
|
|
2018
|
+
};
|
|
2019
|
+
}
|
|
2020
|
+
var r = t();
|
|
2021
|
+
function n() {
|
|
2022
|
+
r = t();
|
|
2023
|
+
}
|
|
2024
|
+
ne.bindAll(
|
|
2025
|
+
window,
|
|
2026
|
+
[{
|
|
2027
|
+
type: "dragstart",
|
|
2028
|
+
listener: function() {
|
|
2029
|
+
r.enterCount = 0, r.isOverWindow = !0;
|
|
2030
|
+
}
|
|
2031
|
+
}, {
|
|
2032
|
+
type: "drop",
|
|
2033
|
+
listener: n
|
|
2034
|
+
}, {
|
|
2035
|
+
type: "dragend",
|
|
2036
|
+
listener: n
|
|
2037
|
+
}, {
|
|
2038
|
+
type: "dragenter",
|
|
2039
|
+
listener: function(a) {
|
|
2040
|
+
!r.isOverWindow && r.enterCount === 0 && (a[We.isEnteringWindow] = !0), r.isOverWindow = !0, r.enterCount++;
|
|
2041
|
+
}
|
|
2042
|
+
}, {
|
|
2043
|
+
type: "dragleave",
|
|
2044
|
+
listener: function(a) {
|
|
2045
|
+
r.enterCount--, r.isOverWindow && r.enterCount === 0 && (a[We.isLeavingWindow] = !0, r.isOverWindow = !1);
|
|
2046
|
+
}
|
|
2047
|
+
}],
|
|
2048
|
+
// using `capture: true` so that adding event listeners
|
|
2049
|
+
// in bubble phase will have the correct symbols
|
|
2050
|
+
{
|
|
2051
|
+
capture: !0
|
|
2052
|
+
}
|
|
2053
|
+
);
|
|
2054
|
+
})();
|
|
2055
|
+
function Zn(e) {
|
|
2056
|
+
return "nodeName" in e;
|
|
2057
|
+
}
|
|
2058
|
+
function ei(e) {
|
|
2059
|
+
return Zn(e) && e.ownerDocument !== document;
|
|
2060
|
+
}
|
|
2061
|
+
function ti(e) {
|
|
2062
|
+
var t = e.dragLeave, r = t.type, n = t.relatedTarget;
|
|
2063
|
+
return r !== "dragleave" ? !1 : Xe() ? Jn({
|
|
2064
|
+
dragLeave: t
|
|
2065
|
+
}) : n == null ? !0 : Qn() ? ei(n) : n instanceof HTMLIFrameElement;
|
|
2066
|
+
}
|
|
2067
|
+
function ri(e) {
|
|
2068
|
+
var t = e.onDragEnd;
|
|
2069
|
+
return [
|
|
2070
|
+
// ## Detecting drag ending for removed draggables
|
|
2071
|
+
//
|
|
2072
|
+
// If a draggable element is removed during a drag and the user drops:
|
|
2073
|
+
// 1. if over a valid drop target: we get a "drop" event to know the drag is finished
|
|
2074
|
+
// 2. if not over a valid drop target (or cancelled): we get nothing
|
|
2075
|
+
// The "dragend" event will not fire on the source draggable if it has been
|
|
2076
|
+
// removed from the DOM.
|
|
2077
|
+
// So we need to figure out if a drag operation has finished by looking at other events
|
|
2078
|
+
// We can do this by looking at other events
|
|
2079
|
+
// ### First detection: "pointermove" events
|
|
2080
|
+
// 1. "pointermove" events cannot fire during a drag and drop operation
|
|
2081
|
+
// according to the spec. So if we get a "pointermove" it means that
|
|
2082
|
+
// the drag and drop operations has finished. So if we get a "pointermove"
|
|
2083
|
+
// we know that the drag is over
|
|
2084
|
+
// 2. 🦊😤 Drag and drop operations are _supposed_ to suppress
|
|
2085
|
+
// other pointer events. However, firefox will allow a few
|
|
2086
|
+
// pointer event to get through after a drag starts.
|
|
2087
|
+
// The most I've seen is 3
|
|
2088
|
+
{
|
|
2089
|
+
type: "pointermove",
|
|
2090
|
+
listener: /* @__PURE__ */ function() {
|
|
2091
|
+
var r = 0;
|
|
2092
|
+
return function() {
|
|
2093
|
+
if (r < 20) {
|
|
2094
|
+
r++;
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2097
|
+
t();
|
|
2098
|
+
};
|
|
2099
|
+
}()
|
|
2100
|
+
},
|
|
2101
|
+
// ### Second detection: "pointerdown" events
|
|
2102
|
+
// If we receive this event then we know that a drag operation has finished
|
|
2103
|
+
// and potentially another one is about to start.
|
|
2104
|
+
// Note: `pointerdown` fires on all browsers / platforms before "dragstart"
|
|
2105
|
+
{
|
|
2106
|
+
type: "pointerdown",
|
|
2107
|
+
listener: t
|
|
2108
|
+
}
|
|
2109
|
+
];
|
|
2110
|
+
}
|
|
2111
|
+
function ce(e) {
|
|
2112
|
+
return {
|
|
2113
|
+
altKey: e.altKey,
|
|
2114
|
+
button: e.button,
|
|
2115
|
+
buttons: e.buttons,
|
|
2116
|
+
ctrlKey: e.ctrlKey,
|
|
2117
|
+
metaKey: e.metaKey,
|
|
2118
|
+
shiftKey: e.shiftKey,
|
|
2119
|
+
clientX: e.clientX,
|
|
2120
|
+
clientY: e.clientY,
|
|
2121
|
+
pageX: e.pageX,
|
|
2122
|
+
pageY: e.pageY
|
|
2123
|
+
};
|
|
2124
|
+
}
|
|
2125
|
+
var ni = function(t) {
|
|
2126
|
+
var r = [], n = null, i = function() {
|
|
2127
|
+
for (var u = arguments.length, c = new Array(u), s = 0; s < u; s++)
|
|
2128
|
+
c[s] = arguments[s];
|
|
2129
|
+
r = c, !n && (n = requestAnimationFrame(function() {
|
|
2130
|
+
n = null, t.apply(void 0, r);
|
|
2131
|
+
}));
|
|
2132
|
+
};
|
|
2133
|
+
return i.cancel = function() {
|
|
2134
|
+
n && (cancelAnimationFrame(n), n = null);
|
|
2135
|
+
}, i;
|
|
2136
|
+
}, Re = ni(function(e) {
|
|
2137
|
+
return e();
|
|
2138
|
+
}), me = /* @__PURE__ */ function() {
|
|
2139
|
+
var e = null;
|
|
2140
|
+
function t(n) {
|
|
2141
|
+
var i = requestAnimationFrame(function() {
|
|
2142
|
+
e = null, n();
|
|
2143
|
+
});
|
|
2144
|
+
e = {
|
|
2145
|
+
frameId: i,
|
|
2146
|
+
fn: n
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
function r() {
|
|
2150
|
+
e && (cancelAnimationFrame(e.frameId), e.fn(), e = null);
|
|
2151
|
+
}
|
|
2152
|
+
return {
|
|
2153
|
+
schedule: t,
|
|
2154
|
+
flush: r
|
|
2155
|
+
};
|
|
2156
|
+
}();
|
|
2157
|
+
function ii(e) {
|
|
2158
|
+
var t = e.source, r = e.initial, n = e.dispatchEvent, i = {
|
|
2159
|
+
dropTargets: []
|
|
2160
|
+
};
|
|
2161
|
+
function a(c) {
|
|
2162
|
+
n(c), i = {
|
|
2163
|
+
dropTargets: c.payload.location.current.dropTargets
|
|
2164
|
+
};
|
|
2165
|
+
}
|
|
2166
|
+
var u = {
|
|
2167
|
+
start: function(s) {
|
|
2168
|
+
var o = s.nativeSetDragImage, f = {
|
|
2169
|
+
current: r,
|
|
2170
|
+
previous: i,
|
|
2171
|
+
initial: r
|
|
2172
|
+
};
|
|
2173
|
+
a({
|
|
2174
|
+
eventName: "onGenerateDragPreview",
|
|
2175
|
+
payload: {
|
|
2176
|
+
source: t,
|
|
2177
|
+
location: f,
|
|
2178
|
+
nativeSetDragImage: o
|
|
2179
|
+
}
|
|
2180
|
+
}), me.schedule(function() {
|
|
2181
|
+
a({
|
|
2182
|
+
eventName: "onDragStart",
|
|
2183
|
+
payload: {
|
|
2184
|
+
source: t,
|
|
2185
|
+
location: f
|
|
2186
|
+
}
|
|
2187
|
+
});
|
|
2188
|
+
});
|
|
2189
|
+
},
|
|
2190
|
+
dragUpdate: function(s) {
|
|
2191
|
+
var o = s.current;
|
|
2192
|
+
me.flush(), Re.cancel(), a({
|
|
2193
|
+
eventName: "onDropTargetChange",
|
|
2194
|
+
payload: {
|
|
2195
|
+
source: t,
|
|
2196
|
+
location: {
|
|
2197
|
+
initial: r,
|
|
2198
|
+
previous: i,
|
|
2199
|
+
current: o
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
});
|
|
2203
|
+
},
|
|
2204
|
+
drag: function(s) {
|
|
2205
|
+
var o = s.current;
|
|
2206
|
+
Re(function() {
|
|
2207
|
+
me.flush();
|
|
2208
|
+
var f = {
|
|
2209
|
+
initial: r,
|
|
2210
|
+
previous: i,
|
|
2211
|
+
current: o
|
|
2212
|
+
};
|
|
2213
|
+
a({
|
|
2214
|
+
eventName: "onDrag",
|
|
2215
|
+
payload: {
|
|
2216
|
+
source: t,
|
|
2217
|
+
location: f
|
|
2218
|
+
}
|
|
2219
|
+
});
|
|
2220
|
+
});
|
|
2221
|
+
},
|
|
2222
|
+
drop: function(s) {
|
|
2223
|
+
var o = s.current, f = s.updatedSourcePayload;
|
|
2224
|
+
me.flush(), Re.cancel(), a({
|
|
2225
|
+
eventName: "onDrop",
|
|
2226
|
+
payload: {
|
|
2227
|
+
source: f ?? t,
|
|
2228
|
+
location: {
|
|
2229
|
+
current: o,
|
|
2230
|
+
previous: i,
|
|
2231
|
+
initial: r
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
return u;
|
|
2238
|
+
}
|
|
2239
|
+
var Le = {
|
|
2240
|
+
isActive: !1
|
|
2241
|
+
};
|
|
2242
|
+
function Ut() {
|
|
2243
|
+
return !Le.isActive;
|
|
2244
|
+
}
|
|
2245
|
+
function ai(e) {
|
|
2246
|
+
return e.dataTransfer ? e.dataTransfer.setDragImage.bind(e.dataTransfer) : null;
|
|
2247
|
+
}
|
|
2248
|
+
function oi(e) {
|
|
2249
|
+
var t = e.current, r = e.next;
|
|
2250
|
+
if (t.length !== r.length)
|
|
2251
|
+
return !0;
|
|
2252
|
+
for (var n = 0; n < t.length; n++)
|
|
2253
|
+
if (t[n].element !== r[n].element)
|
|
2254
|
+
return !0;
|
|
2255
|
+
return !1;
|
|
2256
|
+
}
|
|
2257
|
+
function si(e) {
|
|
2258
|
+
var t = e.event, r = e.dragType, n = e.getDropTargetsOver, i = e.dispatchEvent;
|
|
2259
|
+
if (!Ut())
|
|
2260
|
+
return;
|
|
2261
|
+
var a = ui({
|
|
2262
|
+
event: t,
|
|
2263
|
+
dragType: r,
|
|
2264
|
+
getDropTargetsOver: n
|
|
2265
|
+
});
|
|
2266
|
+
Le.isActive = !0;
|
|
2267
|
+
var u = {
|
|
2268
|
+
current: a
|
|
2269
|
+
};
|
|
2270
|
+
ke({
|
|
2271
|
+
event: t,
|
|
2272
|
+
current: a.dropTargets
|
|
2273
|
+
});
|
|
2274
|
+
var c = ii({
|
|
2275
|
+
source: r.payload,
|
|
2276
|
+
dispatchEvent: i,
|
|
2277
|
+
initial: a
|
|
2278
|
+
});
|
|
2279
|
+
function s(h) {
|
|
2280
|
+
var g = oi({
|
|
2281
|
+
current: u.current.dropTargets,
|
|
2282
|
+
next: h.dropTargets
|
|
2283
|
+
});
|
|
2284
|
+
u.current = h, g && c.dragUpdate({
|
|
2285
|
+
current: u.current
|
|
2286
|
+
});
|
|
2287
|
+
}
|
|
2288
|
+
function o(h) {
|
|
2289
|
+
var g = ce(h), p = $t(h.target) ? qt({
|
|
2290
|
+
x: g.clientX,
|
|
2291
|
+
y: g.clientY
|
|
2292
|
+
}) : h.target, m = n({
|
|
2293
|
+
target: p,
|
|
2294
|
+
input: g,
|
|
2295
|
+
source: r.payload,
|
|
2296
|
+
current: u.current.dropTargets
|
|
2297
|
+
});
|
|
2298
|
+
m.length && (h.preventDefault(), ke({
|
|
2299
|
+
event: h,
|
|
2300
|
+
current: m
|
|
2301
|
+
})), s({
|
|
2302
|
+
dropTargets: m,
|
|
2303
|
+
input: g
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
function f() {
|
|
2307
|
+
u.current.dropTargets.length && s({
|
|
2308
|
+
dropTargets: [],
|
|
2309
|
+
input: u.current.input
|
|
2310
|
+
}), c.drop({
|
|
2311
|
+
current: u.current,
|
|
2312
|
+
updatedSourcePayload: null
|
|
2313
|
+
}), l();
|
|
2314
|
+
}
|
|
2315
|
+
function l() {
|
|
2316
|
+
Le.isActive = !1, d();
|
|
2317
|
+
}
|
|
2318
|
+
var d = ne.bindAll(
|
|
2319
|
+
window,
|
|
2320
|
+
[{
|
|
2321
|
+
// 👋 Note: we are repurposing the `dragover` event as our `drag` event
|
|
2322
|
+
// this is because firefox does not publish pointer coordinates during
|
|
2323
|
+
// a `drag` event, but does for every other type of drag event
|
|
2324
|
+
// `dragover` fires on all elements that are being dragged over
|
|
2325
|
+
// Because we are binding to `window` - our `dragover` is effectively the same as a `drag`
|
|
2326
|
+
// 🦊😤
|
|
2327
|
+
type: "dragover",
|
|
2328
|
+
listener: function(g) {
|
|
2329
|
+
o(g), c.drag({
|
|
2330
|
+
current: u.current
|
|
2331
|
+
});
|
|
2332
|
+
}
|
|
2333
|
+
}, {
|
|
2334
|
+
type: "dragenter",
|
|
2335
|
+
listener: o
|
|
2336
|
+
}, {
|
|
2337
|
+
type: "dragleave",
|
|
2338
|
+
listener: function(g) {
|
|
2339
|
+
ti({
|
|
2340
|
+
dragLeave: g
|
|
2341
|
+
}) && (s({
|
|
2342
|
+
input: u.current.input,
|
|
2343
|
+
dropTargets: []
|
|
2344
|
+
}), r.startedFrom === "external" && f());
|
|
2345
|
+
}
|
|
2346
|
+
}, {
|
|
2347
|
+
// A "drop" can only happen if the browser allowed the drop
|
|
2348
|
+
type: "drop",
|
|
2349
|
+
listener: function(g) {
|
|
2350
|
+
if (u.current = {
|
|
2351
|
+
dropTargets: u.current.dropTargets,
|
|
2352
|
+
input: ce(g)
|
|
2353
|
+
}, !u.current.dropTargets.length) {
|
|
2354
|
+
f();
|
|
2355
|
+
return;
|
|
2356
|
+
}
|
|
2357
|
+
g.preventDefault(), ke({
|
|
2358
|
+
event: g,
|
|
2359
|
+
current: u.current.dropTargets
|
|
2360
|
+
}), c.drop({
|
|
2361
|
+
current: u.current,
|
|
2362
|
+
// When dropping something native, we need to extract the latest
|
|
2363
|
+
// `.items` from the "drop" event as it is now accessible
|
|
2364
|
+
updatedSourcePayload: r.type === "external" ? r.getDropPayload(g) : null
|
|
2365
|
+
}), l();
|
|
2366
|
+
}
|
|
2367
|
+
}, {
|
|
2368
|
+
// "dragend" fires when on the drag source (eg a draggable element)
|
|
2369
|
+
// when the drag is finished.
|
|
2370
|
+
// "dragend" will fire after "drop" (if there was a successful drop)
|
|
2371
|
+
// "dragend" does not fire if the draggable source has been removed during the drag
|
|
2372
|
+
// or for external drag sources (eg files)
|
|
2373
|
+
// This "dragend" listener will not fire if there was a successful drop
|
|
2374
|
+
// as we will have already removed the event listener
|
|
2375
|
+
type: "dragend",
|
|
2376
|
+
listener: function(g) {
|
|
2377
|
+
u.current = {
|
|
2378
|
+
dropTargets: u.current.dropTargets,
|
|
2379
|
+
input: ce(g)
|
|
2380
|
+
}, f();
|
|
2381
|
+
}
|
|
2382
|
+
}].concat(Xt(ri({
|
|
2383
|
+
onDragEnd: f
|
|
2384
|
+
}))),
|
|
2385
|
+
// Once we have started a managed drag operation it is important that we see / own all drag events
|
|
2386
|
+
// We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
|
|
2387
|
+
// all "drop" events in the bubble phase on the `document.body`.
|
|
2388
|
+
// This meant that we never saw the "drop" event.
|
|
2389
|
+
{
|
|
2390
|
+
capture: !0
|
|
2391
|
+
}
|
|
2392
|
+
);
|
|
2393
|
+
c.start({
|
|
2394
|
+
nativeSetDragImage: ai(t)
|
|
2395
|
+
});
|
|
2396
|
+
}
|
|
2397
|
+
function ke(e) {
|
|
2398
|
+
var t, r = e.event, n = e.current, i = (t = n[0]) === null || t === void 0 ? void 0 : t.dropEffect;
|
|
2399
|
+
i != null && r.dataTransfer && (r.dataTransfer.dropEffect = i);
|
|
2400
|
+
}
|
|
2401
|
+
function ui(e) {
|
|
2402
|
+
var t = e.event, r = e.dragType, n = e.getDropTargetsOver, i = ce(t);
|
|
2403
|
+
if (r.startedFrom === "external")
|
|
2404
|
+
return {
|
|
2405
|
+
input: i,
|
|
2406
|
+
dropTargets: []
|
|
2407
|
+
};
|
|
2408
|
+
var a = n({
|
|
2409
|
+
input: i,
|
|
2410
|
+
source: r.payload,
|
|
2411
|
+
target: t.target,
|
|
2412
|
+
current: []
|
|
2413
|
+
});
|
|
2414
|
+
return {
|
|
2415
|
+
input: i,
|
|
2416
|
+
dropTargets: a
|
|
2417
|
+
};
|
|
2418
|
+
}
|
|
2419
|
+
var dt = {
|
|
2420
|
+
canStart: Ut,
|
|
2421
|
+
start: si
|
|
2422
|
+
}, He = /* @__PURE__ */ new Map();
|
|
2423
|
+
function ci(e) {
|
|
2424
|
+
var t = e.typeKey, r = e.mount, n = He.get(t);
|
|
2425
|
+
if (n)
|
|
2426
|
+
return n.usageCount++, n;
|
|
2427
|
+
var i = {
|
|
2428
|
+
typeKey: t,
|
|
2429
|
+
unmount: r(),
|
|
2430
|
+
usageCount: 1
|
|
2431
|
+
};
|
|
2432
|
+
return He.set(t, i), i;
|
|
2433
|
+
}
|
|
2434
|
+
function li(e) {
|
|
2435
|
+
var t = ci(e);
|
|
2436
|
+
return function() {
|
|
2437
|
+
t.usageCount--, !(t.usageCount > 0) && (t.unmount(), He.delete(e.typeKey));
|
|
2438
|
+
};
|
|
2439
|
+
}
|
|
2440
|
+
function Ue() {
|
|
2441
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
2442
|
+
t[r] = arguments[r];
|
|
2443
|
+
return function() {
|
|
2444
|
+
t.forEach(function(i) {
|
|
2445
|
+
return i();
|
|
2446
|
+
});
|
|
2447
|
+
};
|
|
2448
|
+
}
|
|
2449
|
+
function Gt(e, t) {
|
|
2450
|
+
var r = t.attribute, n = t.value;
|
|
2451
|
+
return e.setAttribute(r, n), function() {
|
|
2452
|
+
return e.removeAttribute(r);
|
|
2453
|
+
};
|
|
2454
|
+
}
|
|
2455
|
+
function ft(e, t) {
|
|
2456
|
+
var r = Object.keys(e);
|
|
2457
|
+
if (Object.getOwnPropertySymbols) {
|
|
2458
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
2459
|
+
t && (n = n.filter(function(i) {
|
|
2460
|
+
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
2461
|
+
})), r.push.apply(r, n);
|
|
2462
|
+
}
|
|
2463
|
+
return r;
|
|
2464
|
+
}
|
|
2465
|
+
function F(e) {
|
|
2466
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
2467
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
2468
|
+
t % 2 ? ft(Object(r), !0).forEach(function(n) {
|
|
2469
|
+
qe(e, n, r[n]);
|
|
2470
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ft(Object(r)).forEach(function(n) {
|
|
2471
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
2472
|
+
});
|
|
2473
|
+
}
|
|
2474
|
+
return e;
|
|
2475
|
+
}
|
|
2476
|
+
function Ne(e, t) {
|
|
2477
|
+
var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2478
|
+
if (!r) {
|
|
2479
|
+
if (Array.isArray(e) || (r = di(e)) || t) {
|
|
2480
|
+
r && (e = r);
|
|
2481
|
+
var n = 0, i = function() {
|
|
2482
|
+
};
|
|
2483
|
+
return { s: i, n: function() {
|
|
2484
|
+
return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
|
|
2485
|
+
}, e: function(o) {
|
|
2486
|
+
throw o;
|
|
2487
|
+
}, f: i };
|
|
2488
|
+
}
|
|
2489
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2490
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
2491
|
+
}
|
|
2492
|
+
var a, u = !0, c = !1;
|
|
2493
|
+
return { s: function() {
|
|
2494
|
+
r = r.call(e);
|
|
2495
|
+
}, n: function() {
|
|
2496
|
+
var o = r.next();
|
|
2497
|
+
return u = o.done, o;
|
|
2498
|
+
}, e: function(o) {
|
|
2499
|
+
c = !0, a = o;
|
|
2500
|
+
}, f: function() {
|
|
2501
|
+
try {
|
|
2502
|
+
u || r.return == null || r.return();
|
|
2503
|
+
} finally {
|
|
2504
|
+
if (c) throw a;
|
|
2505
|
+
}
|
|
2506
|
+
} };
|
|
2507
|
+
}
|
|
2508
|
+
function di(e, t) {
|
|
2509
|
+
if (e) {
|
|
2510
|
+
if (typeof e == "string") return ht(e, t);
|
|
2511
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
2512
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ht(e, t) : void 0;
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
function ht(e, t) {
|
|
2516
|
+
(t == null || t > e.length) && (t = e.length);
|
|
2517
|
+
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
2518
|
+
return n;
|
|
2519
|
+
}
|
|
2520
|
+
function Ae(e) {
|
|
2521
|
+
return e.slice(0).reverse();
|
|
2522
|
+
}
|
|
2523
|
+
function fi(e) {
|
|
2524
|
+
var t = e.typeKey, r = e.defaultDropEffect, n = /* @__PURE__ */ new WeakMap(), i = "data-drop-target-for-".concat(t), a = "[".concat(i, "]");
|
|
2525
|
+
function u(h) {
|
|
2526
|
+
return n.set(h.element, h), function() {
|
|
2527
|
+
return n.delete(h.element);
|
|
2528
|
+
};
|
|
2529
|
+
}
|
|
2530
|
+
function c(h) {
|
|
2531
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2532
|
+
var g = n.get(h.element);
|
|
2533
|
+
g && console.warn("You have already registered a [".concat(t, "] dropTarget on the same element"), {
|
|
2534
|
+
existing: g,
|
|
2535
|
+
proposed: h
|
|
2536
|
+
}), h.element instanceof HTMLIFrameElement && console.warn(`
|
|
2537
|
+
We recommend not registering <iframe> elements as drop targets
|
|
2538
|
+
as it can result in some strange browser event ordering.
|
|
2539
|
+
`.replace(/\s{2,}/g, " ").trim());
|
|
2540
|
+
}
|
|
2541
|
+
var p = Ue(Gt(h.element, {
|
|
2542
|
+
attribute: i,
|
|
2543
|
+
value: "true"
|
|
2544
|
+
}), u(h));
|
|
2545
|
+
return ie(p);
|
|
2546
|
+
}
|
|
2547
|
+
function s(h) {
|
|
2548
|
+
var g, p, m, b, O = h.source, x = h.target, w = h.input, M = h.result, S = M === void 0 ? [] : M;
|
|
2549
|
+
if (x == null)
|
|
2550
|
+
return S;
|
|
2551
|
+
if (!(x instanceof Element))
|
|
2552
|
+
return x instanceof Node ? s({
|
|
2553
|
+
source: O,
|
|
2554
|
+
target: x.parentElement,
|
|
2555
|
+
input: w,
|
|
2556
|
+
result: S
|
|
2557
|
+
}) : S;
|
|
2558
|
+
var z = x.closest(a);
|
|
2559
|
+
if (z == null)
|
|
2560
|
+
return S;
|
|
2561
|
+
var E = n.get(z);
|
|
2562
|
+
if (E == null)
|
|
2563
|
+
return S;
|
|
2564
|
+
var v = {
|
|
2565
|
+
input: w,
|
|
2566
|
+
source: O,
|
|
2567
|
+
element: E.element
|
|
2568
|
+
};
|
|
2569
|
+
if (E.canDrop && !E.canDrop(v))
|
|
2570
|
+
return s({
|
|
2571
|
+
source: O,
|
|
2572
|
+
target: E.element.parentElement,
|
|
2573
|
+
input: w,
|
|
2574
|
+
result: S
|
|
2575
|
+
});
|
|
2576
|
+
var D = (g = (p = E.getData) === null || p === void 0 ? void 0 : p.call(E, v)) !== null && g !== void 0 ? g : {}, P = (m = (b = E.getDropEffect) === null || b === void 0 ? void 0 : b.call(E, v)) !== null && m !== void 0 ? m : r, R = {
|
|
2577
|
+
data: D,
|
|
2578
|
+
element: E.element,
|
|
2579
|
+
dropEffect: P,
|
|
2580
|
+
// we are collecting _actual_ drop targets, so these are
|
|
2581
|
+
// being applied _not_ due to stickiness
|
|
2582
|
+
isActiveDueToStickiness: !1
|
|
2583
|
+
};
|
|
2584
|
+
return s({
|
|
2585
|
+
source: O,
|
|
2586
|
+
target: E.element.parentElement,
|
|
2587
|
+
input: w,
|
|
2588
|
+
// Using bubble ordering. Same ordering as `event.getPath()`
|
|
2589
|
+
result: [].concat(Xt(S), [R])
|
|
2590
|
+
});
|
|
2591
|
+
}
|
|
2592
|
+
function o(h) {
|
|
2593
|
+
var g = h.eventName, p = h.payload, m = Ne(p.location.current.dropTargets), b;
|
|
2594
|
+
try {
|
|
2595
|
+
for (m.s(); !(b = m.n()).done; ) {
|
|
2596
|
+
var O, x = b.value, w = n.get(x.element), M = F(F({}, p), {}, {
|
|
2597
|
+
self: x
|
|
2598
|
+
});
|
|
2599
|
+
w == null || (O = w[g]) === null || O === void 0 || O.call(
|
|
2600
|
+
w,
|
|
2601
|
+
// I cannot seem to get the types right here.
|
|
2602
|
+
// TS doesn't seem to like that one event can need `nativeSetDragImage`
|
|
2603
|
+
// @ts-expect-error
|
|
2604
|
+
M
|
|
2605
|
+
);
|
|
2606
|
+
}
|
|
2607
|
+
} catch (S) {
|
|
2608
|
+
m.e(S);
|
|
2609
|
+
} finally {
|
|
2610
|
+
m.f();
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
var f = {
|
|
2614
|
+
onGenerateDragPreview: o,
|
|
2615
|
+
onDrag: o,
|
|
2616
|
+
onDragStart: o,
|
|
2617
|
+
onDrop: o,
|
|
2618
|
+
onDropTargetChange: function(g) {
|
|
2619
|
+
var p = g.payload, m = new Set(p.location.current.dropTargets.map(function(U) {
|
|
2620
|
+
return U.element;
|
|
2621
|
+
})), b = /* @__PURE__ */ new Set(), O = Ne(p.location.previous.dropTargets), x;
|
|
2622
|
+
try {
|
|
2623
|
+
for (O.s(); !(x = O.n()).done; ) {
|
|
2624
|
+
var w, M = x.value;
|
|
2625
|
+
b.add(M.element);
|
|
2626
|
+
var S = n.get(M.element), z = m.has(M.element), E = F(F({}, p), {}, {
|
|
2627
|
+
self: M
|
|
2628
|
+
});
|
|
2629
|
+
if (S == null || (w = S.onDropTargetChange) === null || w === void 0 || w.call(S, E), !z) {
|
|
2630
|
+
var v;
|
|
2631
|
+
S == null || (v = S.onDragLeave) === null || v === void 0 || v.call(S, E);
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
} catch (U) {
|
|
2635
|
+
O.e(U);
|
|
2636
|
+
} finally {
|
|
2637
|
+
O.f();
|
|
2638
|
+
}
|
|
2639
|
+
var D = Ne(p.location.current.dropTargets), P;
|
|
2640
|
+
try {
|
|
2641
|
+
for (D.s(); !(P = D.n()).done; ) {
|
|
2642
|
+
var R, L, X = P.value;
|
|
2643
|
+
if (!b.has(X.element)) {
|
|
2644
|
+
var J = F(F({}, p), {}, {
|
|
2645
|
+
self: X
|
|
2646
|
+
}), A = n.get(X.element);
|
|
2647
|
+
A == null || (R = A.onDropTargetChange) === null || R === void 0 || R.call(A, J), A == null || (L = A.onDragEnter) === null || L === void 0 || L.call(A, J);
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
} catch (U) {
|
|
2651
|
+
D.e(U);
|
|
2652
|
+
} finally {
|
|
2653
|
+
D.f();
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
};
|
|
2657
|
+
function l(h) {
|
|
2658
|
+
f[h.eventName](h);
|
|
2659
|
+
}
|
|
2660
|
+
function d(h) {
|
|
2661
|
+
var g = h.source, p = h.target, m = h.input, b = h.current, O = s({
|
|
2662
|
+
source: g,
|
|
2663
|
+
target: p,
|
|
2664
|
+
input: m
|
|
2665
|
+
});
|
|
2666
|
+
if (O.length >= b.length)
|
|
2667
|
+
return O;
|
|
2668
|
+
for (var x = Ae(b), w = Ae(O), M = [], S = 0; S < x.length; S++) {
|
|
2669
|
+
var z, E = x[S], v = w[S];
|
|
2670
|
+
if (v != null) {
|
|
2671
|
+
M.push(v);
|
|
2672
|
+
continue;
|
|
2673
|
+
}
|
|
2674
|
+
var D = M[S - 1], P = x[S - 1];
|
|
2675
|
+
if ((D == null ? void 0 : D.element) !== (P == null ? void 0 : P.element))
|
|
2676
|
+
break;
|
|
2677
|
+
var R = n.get(E.element);
|
|
2678
|
+
if (!R)
|
|
2679
|
+
break;
|
|
2680
|
+
var L = {
|
|
2681
|
+
input: m,
|
|
2682
|
+
source: g,
|
|
2683
|
+
element: R.element
|
|
2684
|
+
};
|
|
2685
|
+
if (R.canDrop && !R.canDrop(L) || !((z = R.getIsSticky) !== null && z !== void 0 && z.call(R, L)))
|
|
2686
|
+
break;
|
|
2687
|
+
M.push(F(F({}, E), {}, {
|
|
2688
|
+
// making it clear to consumers this drop target is active due to stickiness
|
|
2689
|
+
isActiveDueToStickiness: !0
|
|
2690
|
+
}));
|
|
2691
|
+
}
|
|
2692
|
+
return Ae(M);
|
|
2693
|
+
}
|
|
2694
|
+
return {
|
|
2695
|
+
dropTargetForConsumers: c,
|
|
2696
|
+
getIsOver: d,
|
|
2697
|
+
dispatchEvent: l
|
|
2698
|
+
};
|
|
2699
|
+
}
|
|
2700
|
+
function hi(e, t) {
|
|
2701
|
+
var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2702
|
+
if (!r) {
|
|
2703
|
+
if (Array.isArray(e) || (r = gi(e)) || t) {
|
|
2704
|
+
r && (e = r);
|
|
2705
|
+
var n = 0, i = function() {
|
|
2706
|
+
};
|
|
2707
|
+
return { s: i, n: function() {
|
|
2708
|
+
return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
|
|
2709
|
+
}, e: function(o) {
|
|
2710
|
+
throw o;
|
|
2711
|
+
}, f: i };
|
|
2712
|
+
}
|
|
2713
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2714
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
2715
|
+
}
|
|
2716
|
+
var a, u = !0, c = !1;
|
|
2717
|
+
return { s: function() {
|
|
2718
|
+
r = r.call(e);
|
|
2719
|
+
}, n: function() {
|
|
2720
|
+
var o = r.next();
|
|
2721
|
+
return u = o.done, o;
|
|
2722
|
+
}, e: function(o) {
|
|
2723
|
+
c = !0, a = o;
|
|
2724
|
+
}, f: function() {
|
|
2725
|
+
try {
|
|
2726
|
+
u || r.return == null || r.return();
|
|
2727
|
+
} finally {
|
|
2728
|
+
if (c) throw a;
|
|
2729
|
+
}
|
|
2730
|
+
} };
|
|
2731
|
+
}
|
|
2732
|
+
function gi(e, t) {
|
|
2733
|
+
if (e) {
|
|
2734
|
+
if (typeof e == "string") return gt(e, t);
|
|
2735
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
2736
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? gt(e, t) : void 0;
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
function gt(e, t) {
|
|
2740
|
+
(t == null || t > e.length) && (t = e.length);
|
|
2741
|
+
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
2742
|
+
return n;
|
|
2743
|
+
}
|
|
2744
|
+
function pt(e, t) {
|
|
2745
|
+
var r = Object.keys(e);
|
|
2746
|
+
if (Object.getOwnPropertySymbols) {
|
|
2747
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
2748
|
+
t && (n = n.filter(function(i) {
|
|
2749
|
+
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
2750
|
+
})), r.push.apply(r, n);
|
|
2751
|
+
}
|
|
2752
|
+
return r;
|
|
2753
|
+
}
|
|
2754
|
+
function pi(e) {
|
|
2755
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
2756
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
2757
|
+
t % 2 ? pt(Object(r), !0).forEach(function(n) {
|
|
2758
|
+
qe(e, n, r[n]);
|
|
2759
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : pt(Object(r)).forEach(function(n) {
|
|
2760
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2763
|
+
return e;
|
|
2764
|
+
}
|
|
2765
|
+
function mi() {
|
|
2766
|
+
var e = /* @__PURE__ */ new Set(), t = null;
|
|
2767
|
+
function r(a) {
|
|
2768
|
+
t && (!a.canMonitor || a.canMonitor(t.canMonitorArgs)) && t.active.add(a);
|
|
2769
|
+
}
|
|
2770
|
+
function n(a) {
|
|
2771
|
+
var u = pi({}, a);
|
|
2772
|
+
e.add(u), r(u);
|
|
2773
|
+
function c() {
|
|
2774
|
+
e.delete(u), t && t.active.delete(u);
|
|
2775
|
+
}
|
|
2776
|
+
return ie(c);
|
|
2777
|
+
}
|
|
2778
|
+
function i(a) {
|
|
2779
|
+
var u = a.eventName, c = a.payload;
|
|
2780
|
+
if (u === "onGenerateDragPreview") {
|
|
2781
|
+
t = {
|
|
2782
|
+
canMonitorArgs: {
|
|
2783
|
+
initial: c.location.initial,
|
|
2784
|
+
source: c.source
|
|
2785
|
+
},
|
|
2786
|
+
active: /* @__PURE__ */ new Set()
|
|
2787
|
+
};
|
|
2788
|
+
var s = hi(e), o;
|
|
2789
|
+
try {
|
|
2790
|
+
for (s.s(); !(o = s.n()).done; ) {
|
|
2791
|
+
var f = o.value;
|
|
2792
|
+
r(f);
|
|
2793
|
+
}
|
|
2794
|
+
} catch (m) {
|
|
2795
|
+
s.e(m);
|
|
2796
|
+
} finally {
|
|
2797
|
+
s.f();
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
if (t) {
|
|
2801
|
+
for (var l = Array.from(t.active), d = 0, h = l; d < h.length; d++) {
|
|
2802
|
+
var g = h[d];
|
|
2803
|
+
if (t.active.has(g)) {
|
|
2804
|
+
var p;
|
|
2805
|
+
(p = g[u]) === null || p === void 0 || p.call(g, c);
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
u === "onDrop" && (t.active.clear(), t = null);
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
return {
|
|
2812
|
+
dispatchEvent: i,
|
|
2813
|
+
monitorForConsumers: n
|
|
2814
|
+
};
|
|
2815
|
+
}
|
|
2816
|
+
function yi(e) {
|
|
2817
|
+
var t = e.typeKey, r = e.mount, n = e.dispatchEventToSource, i = e.onPostDispatch, a = e.defaultDropEffect, u = mi(), c = fi({
|
|
2818
|
+
typeKey: t,
|
|
2819
|
+
defaultDropEffect: a
|
|
2820
|
+
});
|
|
2821
|
+
function s(l) {
|
|
2822
|
+
n == null || n(l), c.dispatchEvent(l), u.dispatchEvent(l), i == null || i(l);
|
|
2823
|
+
}
|
|
2824
|
+
function o(l) {
|
|
2825
|
+
var d = l.event, h = l.dragType;
|
|
2826
|
+
dt.start({
|
|
2827
|
+
event: d,
|
|
2828
|
+
dragType: h,
|
|
2829
|
+
getDropTargetsOver: c.getIsOver,
|
|
2830
|
+
dispatchEvent: s
|
|
2831
|
+
});
|
|
2832
|
+
}
|
|
2833
|
+
function f() {
|
|
2834
|
+
function l() {
|
|
2835
|
+
var d = {
|
|
2836
|
+
canStart: dt.canStart,
|
|
2837
|
+
start: o
|
|
2838
|
+
};
|
|
2839
|
+
return r(d);
|
|
2840
|
+
}
|
|
2841
|
+
return li({
|
|
2842
|
+
typeKey: t,
|
|
2843
|
+
mount: l
|
|
2844
|
+
});
|
|
2845
|
+
}
|
|
2846
|
+
return {
|
|
2847
|
+
registerUsage: f,
|
|
2848
|
+
dropTarget: c.dropTargetForConsumers,
|
|
2849
|
+
monitor: u.monitorForConsumers
|
|
2850
|
+
};
|
|
2851
|
+
}
|
|
2852
|
+
var vi = ie(function() {
|
|
2853
|
+
return navigator.userAgent.toLocaleLowerCase().includes("android");
|
|
2854
|
+
}), bi = "pdnd:android-fallback", mt = "text/plain", wi = "text/uri-list", xi = "application/vnd.pdnd", ge = /* @__PURE__ */ new WeakMap();
|
|
2855
|
+
function Si(e) {
|
|
2856
|
+
return ge.set(e.element, e), function() {
|
|
2857
|
+
ge.delete(e.element);
|
|
2858
|
+
};
|
|
2859
|
+
}
|
|
2860
|
+
var yt = Un(), Ge = yi({
|
|
2861
|
+
typeKey: "element",
|
|
2862
|
+
defaultDropEffect: "move",
|
|
2863
|
+
mount: function(t) {
|
|
2864
|
+
return Ue(yt.bindEvents(), ne.bind(document, {
|
|
2865
|
+
type: "dragstart",
|
|
2866
|
+
listener: function(n) {
|
|
2867
|
+
var i, a, u, c, s, o;
|
|
2868
|
+
if (t.canStart(n) && !n.defaultPrevented) {
|
|
2869
|
+
if (!n.dataTransfer) {
|
|
2870
|
+
process.env.NODE_ENV !== "production" && console.warn(`
|
|
2871
|
+
It appears as though you have are not testing DragEvents correctly.
|
|
2872
|
+
|
|
2873
|
+
- If you are unit testing, ensure you have polyfilled DragEvent.
|
|
2874
|
+
- If you are browser testing, ensure you are dispatching drag events correctly.
|
|
2875
|
+
|
|
2876
|
+
Please see our testing guides for more information:
|
|
2877
|
+
https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
|
|
2878
|
+
`.replace(/ {2}/g, ""));
|
|
2879
|
+
return;
|
|
2880
|
+
}
|
|
2881
|
+
var f = n.target;
|
|
2882
|
+
if (!(f instanceof HTMLElement))
|
|
2883
|
+
return null;
|
|
2884
|
+
var l = ge.get(f);
|
|
2885
|
+
if (!l)
|
|
2886
|
+
return null;
|
|
2887
|
+
var d = ce(n), h = {
|
|
2888
|
+
element: l.element,
|
|
2889
|
+
dragHandle: (i = l.dragHandle) !== null && i !== void 0 ? i : null,
|
|
2890
|
+
input: d
|
|
2891
|
+
};
|
|
2892
|
+
if (l.canDrag && !l.canDrag(h))
|
|
2893
|
+
return n.preventDefault(), null;
|
|
2894
|
+
if (l.dragHandle) {
|
|
2895
|
+
var g = qt({
|
|
2896
|
+
x: d.clientX,
|
|
2897
|
+
y: d.clientY
|
|
2898
|
+
});
|
|
2899
|
+
if (!l.dragHandle.contains(g))
|
|
2900
|
+
return n.preventDefault(), null;
|
|
2901
|
+
}
|
|
2902
|
+
var p = (a = (u = l.getInitialDataForExternal) === null || u === void 0 ? void 0 : u.call(l, h)) !== null && a !== void 0 ? a : null;
|
|
2903
|
+
if (p)
|
|
2904
|
+
for (var m = 0, b = Object.entries(p); m < b.length; m++) {
|
|
2905
|
+
var O = Bt(b[m], 2), x = O[0], w = O[1];
|
|
2906
|
+
n.dataTransfer.setData(x, w ?? "");
|
|
2907
|
+
}
|
|
2908
|
+
vi() && !n.dataTransfer.types.includes(mt) && !n.dataTransfer.types.includes(wi) && n.dataTransfer.setData(mt, bi), n.dataTransfer.setData(xi, "");
|
|
2909
|
+
var M = {
|
|
2910
|
+
element: l.element,
|
|
2911
|
+
dragHandle: (c = l.dragHandle) !== null && c !== void 0 ? c : null,
|
|
2912
|
+
data: (s = (o = l.getInitialData) === null || o === void 0 ? void 0 : o.call(l, h)) !== null && s !== void 0 ? s : {}
|
|
2913
|
+
}, S = {
|
|
2914
|
+
type: "element",
|
|
2915
|
+
payload: M,
|
|
2916
|
+
startedFrom: "internal"
|
|
2917
|
+
};
|
|
2918
|
+
t.start({
|
|
2919
|
+
event: n,
|
|
2920
|
+
dragType: S
|
|
2921
|
+
});
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
}));
|
|
2925
|
+
},
|
|
2926
|
+
dispatchEventToSource: function(t) {
|
|
2927
|
+
var r, n, i = t.eventName, a = t.payload;
|
|
2928
|
+
(r = ge.get(a.source.element)) === null || r === void 0 || (n = r[i]) === null || n === void 0 || n.call(
|
|
2929
|
+
r,
|
|
2930
|
+
// I cannot seem to get the types right here.
|
|
2931
|
+
// TS doesn't seem to like that one event can need `nativeSetDragImage`
|
|
2932
|
+
// @ts-expect-error
|
|
2933
|
+
a
|
|
2934
|
+
);
|
|
2935
|
+
},
|
|
2936
|
+
onPostDispatch: yt.getOnPostDispatch()
|
|
2937
|
+
}), Oi = Ge.dropTarget, Di = Ge.monitor;
|
|
2938
|
+
function Ti(e) {
|
|
2939
|
+
if (process.env.NODE_ENV !== "production" && e.dragHandle && !e.element.contains(e.dragHandle) && console.warn("Drag handle element must be contained in draggable element", {
|
|
2940
|
+
element: e.element,
|
|
2941
|
+
dragHandle: e.dragHandle
|
|
2942
|
+
}), process.env.NODE_ENV !== "production") {
|
|
2943
|
+
var t = ge.get(e.element);
|
|
2944
|
+
t && console.warn("You have already registered a `draggable` on the same element", {
|
|
2945
|
+
existing: t,
|
|
2946
|
+
proposed: e
|
|
2947
|
+
});
|
|
2948
|
+
}
|
|
2949
|
+
var r = Ue(
|
|
2950
|
+
// making the draggable register the adapter rather than drop targets
|
|
2951
|
+
// this is because you *must* have a draggable element to start a drag
|
|
2952
|
+
// but you _might_ not have any drop targets immediately
|
|
2953
|
+
// (You might create drop targets async)
|
|
2954
|
+
Ge.registerUsage(),
|
|
2955
|
+
Si(e),
|
|
2956
|
+
Gt(e.element, {
|
|
2957
|
+
attribute: "draggable",
|
|
2958
|
+
value: "true"
|
|
2959
|
+
})
|
|
2960
|
+
);
|
|
2961
|
+
return ie(r);
|
|
2962
|
+
}
|
|
2963
|
+
var Mi = process.env.NODE_ENV === "production", vt = "Invariant failed";
|
|
2964
|
+
function Ie(e, t) {
|
|
2965
|
+
if (!e) {
|
|
2966
|
+
if (Mi)
|
|
2967
|
+
throw new Error(vt);
|
|
2968
|
+
var r = vt;
|
|
2969
|
+
throw new Error(r);
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
function Ei({
|
|
2973
|
+
children: e,
|
|
2974
|
+
onDragStart: t = () => {
|
|
2975
|
+
},
|
|
2976
|
+
onDrag: r = () => {
|
|
2977
|
+
},
|
|
2978
|
+
onDrop: n = () => {
|
|
2979
|
+
},
|
|
2980
|
+
onDragEnter: i = () => {
|
|
2981
|
+
},
|
|
2982
|
+
onDragLeave: a = () => {
|
|
2983
|
+
}
|
|
2984
|
+
}) {
|
|
2985
|
+
const u = le(null);
|
|
2986
|
+
return re(() => {
|
|
2987
|
+
const c = u.current;
|
|
2988
|
+
return Ie(c), Oi({
|
|
2989
|
+
element: c,
|
|
2990
|
+
getData: () => ({ drop: "drop" }),
|
|
2991
|
+
onDragStart: ({ source: s, location: o }) => {
|
|
2992
|
+
const f = ye(o), l = te(s, o);
|
|
2993
|
+
t(f, l, s.data);
|
|
2994
|
+
},
|
|
2995
|
+
onDragEnter: ({ source: s, location: o }) => {
|
|
2996
|
+
const f = ye(o), l = te(s, o);
|
|
2997
|
+
i(f, l, s.data);
|
|
2998
|
+
},
|
|
2999
|
+
onDrag: ({ source: s, location: o }) => {
|
|
3000
|
+
const f = ye(o), l = te(s, o);
|
|
3001
|
+
r(f, l, s.data);
|
|
3002
|
+
},
|
|
3003
|
+
onDrop: ({ source: s, location: o }) => {
|
|
3004
|
+
const f = ye(o), l = te(s, o);
|
|
3005
|
+
n(f, l, s.data);
|
|
3006
|
+
},
|
|
3007
|
+
onDragLeave: ({ source: s, location: o }) => {
|
|
3008
|
+
const f = te(s, o);
|
|
3009
|
+
a(f, s.data);
|
|
3010
|
+
}
|
|
3011
|
+
});
|
|
3012
|
+
}, [r, a, t, n, i]), /* @__PURE__ */ y("div", { className: "timelane-drop-target", ref: u, children: e });
|
|
3013
|
+
}
|
|
3014
|
+
function ye(e) {
|
|
3015
|
+
const t = e.current.dropTargets[0].element.getBoundingClientRect();
|
|
3016
|
+
return {
|
|
3017
|
+
x: e.current.input.pageX - t.x,
|
|
3018
|
+
y: e.current.input.pageY - t.y
|
|
3019
|
+
};
|
|
3020
|
+
}
|
|
3021
|
+
function Pi({
|
|
3022
|
+
x: e,
|
|
3023
|
+
y: t,
|
|
3024
|
+
width: r,
|
|
3025
|
+
height: n,
|
|
3026
|
+
children: i
|
|
3027
|
+
}) {
|
|
3028
|
+
return /* @__PURE__ */ y(
|
|
3029
|
+
"div",
|
|
3030
|
+
{
|
|
3031
|
+
className: "timelane-drop-preview",
|
|
3032
|
+
style: {
|
|
3033
|
+
left: `${e}px`,
|
|
3034
|
+
top: `${t}px`,
|
|
3035
|
+
width: `${r}px`,
|
|
3036
|
+
height: `${n}px`
|
|
3037
|
+
},
|
|
3038
|
+
children: i
|
|
3039
|
+
}
|
|
3040
|
+
);
|
|
3041
|
+
}
|
|
3042
|
+
function Ri(e, t, r, n, i, a, u, c, s) {
|
|
3043
|
+
if (n === null)
|
|
3044
|
+
return null;
|
|
3045
|
+
const o = Ye(
|
|
3046
|
+
e,
|
|
3047
|
+
a,
|
|
3048
|
+
c
|
|
3049
|
+
), f = t.filter((d) => d.id !== r.id).map((d) => Fe(d, e, c, a));
|
|
3050
|
+
let l = null;
|
|
3051
|
+
return l = ki(
|
|
3052
|
+
e,
|
|
3053
|
+
r,
|
|
3054
|
+
i,
|
|
3055
|
+
a,
|
|
3056
|
+
n
|
|
3057
|
+
), l = Ai(l, u), l = Ni(
|
|
3058
|
+
l,
|
|
3059
|
+
o
|
|
3060
|
+
), l = zi(
|
|
3061
|
+
l,
|
|
3062
|
+
f,
|
|
3063
|
+
o,
|
|
3064
|
+
s
|
|
3065
|
+
), l;
|
|
3066
|
+
}
|
|
3067
|
+
function ki(e, t, r, n, i) {
|
|
3068
|
+
const { width: a, height: u } = Ht(t, e, n), c = i.x + a * r.relative.x, s = i.y + u * r.relative.y;
|
|
3069
|
+
return {
|
|
3070
|
+
x: c,
|
|
3071
|
+
y: s,
|
|
3072
|
+
width: a,
|
|
3073
|
+
height: u
|
|
3074
|
+
};
|
|
3075
|
+
}
|
|
3076
|
+
function Ni(e, t) {
|
|
3077
|
+
const r = Math.max(
|
|
3078
|
+
0,
|
|
3079
|
+
Math.min(e.x, t.width - e.width)
|
|
3080
|
+
), n = Math.max(
|
|
3081
|
+
0,
|
|
3082
|
+
Math.min(e.y, t.height - e.height)
|
|
3083
|
+
);
|
|
3084
|
+
return {
|
|
3085
|
+
...e,
|
|
3086
|
+
x: r,
|
|
3087
|
+
y: n
|
|
3088
|
+
};
|
|
3089
|
+
}
|
|
3090
|
+
function Ai(e, t) {
|
|
3091
|
+
const r = {
|
|
3092
|
+
...e
|
|
3093
|
+
};
|
|
3094
|
+
return t && t.x && (r.x = bt(r.x, t.x, t.offsetX || 0)), t && t.y && (r.y = bt(r.y, t.y, t.offsetY || 0)), r;
|
|
3095
|
+
}
|
|
3096
|
+
function bt(e, t, r) {
|
|
3097
|
+
return Math.max(
|
|
3098
|
+
r,
|
|
3099
|
+
r + Math.round((e - r) / t) * t
|
|
3100
|
+
);
|
|
3101
|
+
}
|
|
3102
|
+
function zi(e, t, r, n) {
|
|
3103
|
+
const i = {
|
|
3104
|
+
...e
|
|
3105
|
+
};
|
|
3106
|
+
if (!n) {
|
|
3107
|
+
let a = !0;
|
|
3108
|
+
for (; a; ) {
|
|
3109
|
+
const u = t.find((c) => ue(i, c));
|
|
3110
|
+
u !== void 0 ? i.y = u.y + u.height : a = !1;
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
return Wi(i, r) ? i : null;
|
|
3114
|
+
}
|
|
3115
|
+
function ue(e, t) {
|
|
3116
|
+
return !(e.x >= t.x + t.width || t.x >= e.x + e.width || e.y >= t.y + t.height || t.y >= e.y + e.height);
|
|
3117
|
+
}
|
|
3118
|
+
function _i(e, t) {
|
|
3119
|
+
const r = Math.max(e.x, t.x), n = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height);
|
|
3120
|
+
return r < i && n < a ? {
|
|
3121
|
+
x: r,
|
|
3122
|
+
y: n,
|
|
3123
|
+
width: i - r,
|
|
3124
|
+
height: a - n
|
|
3125
|
+
} : null;
|
|
3126
|
+
}
|
|
3127
|
+
function Ci(e, t) {
|
|
3128
|
+
return !(e.start >= t.end || t.start >= e.end || e.offset >= t.offset + t.size || t.offset >= e.offset + e.size);
|
|
3129
|
+
}
|
|
3130
|
+
function Wi(e, t) {
|
|
3131
|
+
return e.x >= 0 && e.y >= 0 && e.x + e.width <= t.width && e.y + e.height <= t.height;
|
|
3132
|
+
}
|
|
3133
|
+
function Li(e, t, r, n, i) {
|
|
3134
|
+
const a = Hi(
|
|
3135
|
+
e,
|
|
3136
|
+
t,
|
|
3137
|
+
r.capacity,
|
|
3138
|
+
n
|
|
3139
|
+
);
|
|
3140
|
+
if (a) {
|
|
3141
|
+
const u = Ii(
|
|
3142
|
+
e,
|
|
3143
|
+
i.start,
|
|
3144
|
+
i.end,
|
|
3145
|
+
n,
|
|
3146
|
+
a
|
|
3147
|
+
);
|
|
3148
|
+
if (u)
|
|
3149
|
+
return {
|
|
3150
|
+
start: u.lower,
|
|
3151
|
+
end: u.upper,
|
|
3152
|
+
minOffset: a.lower,
|
|
3153
|
+
maxOffset: a.upper
|
|
3154
|
+
};
|
|
3155
|
+
}
|
|
3156
|
+
return null;
|
|
3157
|
+
}
|
|
3158
|
+
function Hi(e, t, r, n) {
|
|
3159
|
+
const i = n.filter((f) => f.start <= e && f.end >= e);
|
|
3160
|
+
if (i.find(
|
|
3161
|
+
(f) => f.offset <= t && f.offset + f.size >= t
|
|
3162
|
+
))
|
|
3163
|
+
return null;
|
|
3164
|
+
const u = i.filter((f) => f.offset + f.size <= t), c = i.filter((f) => f.offset >= t), s = u.length > 0 ? Math.max(...u.map((f) => f.offset + f.size)) : 0, o = c.length > 0 ? Math.min(...c.map((f) => f.offset)) : r;
|
|
3165
|
+
return {
|
|
3166
|
+
lower: s,
|
|
3167
|
+
upper: o
|
|
3168
|
+
};
|
|
3169
|
+
}
|
|
3170
|
+
function Ii(e, t, r, n, i) {
|
|
3171
|
+
const a = {
|
|
3172
|
+
start: t,
|
|
3173
|
+
end: r,
|
|
3174
|
+
offset: i.lower,
|
|
3175
|
+
size: i.upper - i.lower
|
|
3176
|
+
}, u = n.filter(
|
|
3177
|
+
(l) => Ci(l, a)
|
|
3178
|
+
);
|
|
3179
|
+
if (u.length === 0)
|
|
3180
|
+
return {
|
|
3181
|
+
lower: t,
|
|
3182
|
+
upper: r
|
|
3183
|
+
};
|
|
3184
|
+
const c = u.filter((l) => l.end <= e), s = u.filter((l) => l.start >= e), o = c.length > 0 ? yr(c.map((l) => l.end)) : t, f = s.length > 0 ? vr(s.map((l) => l.start)) : r;
|
|
3185
|
+
return {
|
|
3186
|
+
lower: o,
|
|
3187
|
+
upper: f
|
|
3188
|
+
};
|
|
3189
|
+
}
|
|
3190
|
+
var ve = { exports: {} }, _ = {};
|
|
3191
|
+
/**
|
|
3192
|
+
* @license React
|
|
3193
|
+
* react-dom.production.js
|
|
3194
|
+
*
|
|
3195
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3196
|
+
*
|
|
3197
|
+
* This source code is licensed under the MIT license found in the
|
|
3198
|
+
* LICENSE file in the root directory of this source tree.
|
|
3199
|
+
*/
|
|
3200
|
+
var wt;
|
|
3201
|
+
function ji() {
|
|
3202
|
+
if (wt) return _;
|
|
3203
|
+
wt = 1;
|
|
3204
|
+
var e = kt;
|
|
3205
|
+
function t(s) {
|
|
3206
|
+
var o = "https://react.dev/errors/" + s;
|
|
3207
|
+
if (1 < arguments.length) {
|
|
3208
|
+
o += "?args[]=" + encodeURIComponent(arguments[1]);
|
|
3209
|
+
for (var f = 2; f < arguments.length; f++)
|
|
3210
|
+
o += "&args[]=" + encodeURIComponent(arguments[f]);
|
|
3211
|
+
}
|
|
3212
|
+
return "Minified React error #" + s + "; visit " + o + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
|
|
3213
|
+
}
|
|
3214
|
+
function r() {
|
|
3215
|
+
}
|
|
3216
|
+
var n = {
|
|
3217
|
+
d: {
|
|
3218
|
+
f: r,
|
|
3219
|
+
r: function() {
|
|
3220
|
+
throw Error(t(522));
|
|
3221
|
+
},
|
|
3222
|
+
D: r,
|
|
3223
|
+
C: r,
|
|
3224
|
+
L: r,
|
|
3225
|
+
m: r,
|
|
3226
|
+
X: r,
|
|
3227
|
+
S: r,
|
|
3228
|
+
M: r
|
|
3229
|
+
},
|
|
3230
|
+
p: 0,
|
|
3231
|
+
findDOMNode: null
|
|
3232
|
+
}, i = Symbol.for("react.portal");
|
|
3233
|
+
function a(s, o, f) {
|
|
3234
|
+
var l = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
|
|
3235
|
+
return {
|
|
3236
|
+
$$typeof: i,
|
|
3237
|
+
key: l == null ? null : "" + l,
|
|
3238
|
+
children: s,
|
|
3239
|
+
containerInfo: o,
|
|
3240
|
+
implementation: f
|
|
3241
|
+
};
|
|
3242
|
+
}
|
|
3243
|
+
var u = e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
3244
|
+
function c(s, o) {
|
|
3245
|
+
if (s === "font") return "";
|
|
3246
|
+
if (typeof o == "string")
|
|
3247
|
+
return o === "use-credentials" ? o : "";
|
|
3248
|
+
}
|
|
3249
|
+
return _.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = n, _.createPortal = function(s, o) {
|
|
3250
|
+
var f = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
|
|
3251
|
+
if (!o || o.nodeType !== 1 && o.nodeType !== 9 && o.nodeType !== 11)
|
|
3252
|
+
throw Error(t(299));
|
|
3253
|
+
return a(s, o, null, f);
|
|
3254
|
+
}, _.flushSync = function(s) {
|
|
3255
|
+
var o = u.T, f = n.p;
|
|
3256
|
+
try {
|
|
3257
|
+
if (u.T = null, n.p = 2, s) return s();
|
|
3258
|
+
} finally {
|
|
3259
|
+
u.T = o, n.p = f, n.d.f();
|
|
3260
|
+
}
|
|
3261
|
+
}, _.preconnect = function(s, o) {
|
|
3262
|
+
typeof s == "string" && (o ? (o = o.crossOrigin, o = typeof o == "string" ? o === "use-credentials" ? o : "" : void 0) : o = null, n.d.C(s, o));
|
|
3263
|
+
}, _.prefetchDNS = function(s) {
|
|
3264
|
+
typeof s == "string" && n.d.D(s);
|
|
3265
|
+
}, _.preinit = function(s, o) {
|
|
3266
|
+
if (typeof s == "string" && o && typeof o.as == "string") {
|
|
3267
|
+
var f = o.as, l = c(f, o.crossOrigin), d = typeof o.integrity == "string" ? o.integrity : void 0, h = typeof o.fetchPriority == "string" ? o.fetchPriority : void 0;
|
|
3268
|
+
f === "style" ? n.d.S(
|
|
3269
|
+
s,
|
|
3270
|
+
typeof o.precedence == "string" ? o.precedence : void 0,
|
|
3271
|
+
{
|
|
3272
|
+
crossOrigin: l,
|
|
3273
|
+
integrity: d,
|
|
3274
|
+
fetchPriority: h
|
|
3275
|
+
}
|
|
3276
|
+
) : f === "script" && n.d.X(s, {
|
|
3277
|
+
crossOrigin: l,
|
|
3278
|
+
integrity: d,
|
|
3279
|
+
fetchPriority: h,
|
|
3280
|
+
nonce: typeof o.nonce == "string" ? o.nonce : void 0
|
|
3281
|
+
});
|
|
3282
|
+
}
|
|
3283
|
+
}, _.preinitModule = function(s, o) {
|
|
3284
|
+
if (typeof s == "string")
|
|
3285
|
+
if (typeof o == "object" && o !== null) {
|
|
3286
|
+
if (o.as == null || o.as === "script") {
|
|
3287
|
+
var f = c(
|
|
3288
|
+
o.as,
|
|
3289
|
+
o.crossOrigin
|
|
3290
|
+
);
|
|
3291
|
+
n.d.M(s, {
|
|
3292
|
+
crossOrigin: f,
|
|
3293
|
+
integrity: typeof o.integrity == "string" ? o.integrity : void 0,
|
|
3294
|
+
nonce: typeof o.nonce == "string" ? o.nonce : void 0
|
|
3295
|
+
});
|
|
3296
|
+
}
|
|
3297
|
+
} else o == null && n.d.M(s);
|
|
3298
|
+
}, _.preload = function(s, o) {
|
|
3299
|
+
if (typeof s == "string" && typeof o == "object" && o !== null && typeof o.as == "string") {
|
|
3300
|
+
var f = o.as, l = c(f, o.crossOrigin);
|
|
3301
|
+
n.d.L(s, f, {
|
|
3302
|
+
crossOrigin: l,
|
|
3303
|
+
integrity: typeof o.integrity == "string" ? o.integrity : void 0,
|
|
3304
|
+
nonce: typeof o.nonce == "string" ? o.nonce : void 0,
|
|
3305
|
+
type: typeof o.type == "string" ? o.type : void 0,
|
|
3306
|
+
fetchPriority: typeof o.fetchPriority == "string" ? o.fetchPriority : void 0,
|
|
3307
|
+
referrerPolicy: typeof o.referrerPolicy == "string" ? o.referrerPolicy : void 0,
|
|
3308
|
+
imageSrcSet: typeof o.imageSrcSet == "string" ? o.imageSrcSet : void 0,
|
|
3309
|
+
imageSizes: typeof o.imageSizes == "string" ? o.imageSizes : void 0,
|
|
3310
|
+
media: typeof o.media == "string" ? o.media : void 0
|
|
3311
|
+
});
|
|
3312
|
+
}
|
|
3313
|
+
}, _.preloadModule = function(s, o) {
|
|
3314
|
+
if (typeof s == "string")
|
|
3315
|
+
if (o) {
|
|
3316
|
+
var f = c(o.as, o.crossOrigin);
|
|
3317
|
+
n.d.m(s, {
|
|
3318
|
+
as: typeof o.as == "string" && o.as !== "script" ? o.as : void 0,
|
|
3319
|
+
crossOrigin: f,
|
|
3320
|
+
integrity: typeof o.integrity == "string" ? o.integrity : void 0
|
|
3321
|
+
});
|
|
3322
|
+
} else n.d.m(s);
|
|
3323
|
+
}, _.requestFormReset = function(s) {
|
|
3324
|
+
n.d.r(s);
|
|
3325
|
+
}, _.unstable_batchedUpdates = function(s, o) {
|
|
3326
|
+
return s(o);
|
|
3327
|
+
}, _.useFormState = function(s, o, f) {
|
|
3328
|
+
return u.H.useFormState(s, o, f);
|
|
3329
|
+
}, _.useFormStatus = function() {
|
|
3330
|
+
return u.H.useHostTransitionStatus();
|
|
3331
|
+
}, _.version = "19.1.0", _;
|
|
3332
|
+
}
|
|
3333
|
+
var C = {};
|
|
3334
|
+
/**
|
|
3335
|
+
* @license React
|
|
3336
|
+
* react-dom.development.js
|
|
3337
|
+
*
|
|
3338
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3339
|
+
*
|
|
3340
|
+
* This source code is licensed under the MIT license found in the
|
|
3341
|
+
* LICENSE file in the root directory of this source tree.
|
|
3342
|
+
*/
|
|
3343
|
+
var xt;
|
|
3344
|
+
function Bi() {
|
|
3345
|
+
return xt || (xt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
3346
|
+
function e() {
|
|
3347
|
+
}
|
|
3348
|
+
function t(l) {
|
|
3349
|
+
return "" + l;
|
|
3350
|
+
}
|
|
3351
|
+
function r(l, d, h) {
|
|
3352
|
+
var g = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
|
|
3353
|
+
try {
|
|
3354
|
+
t(g);
|
|
3355
|
+
var p = !1;
|
|
3356
|
+
} catch {
|
|
3357
|
+
p = !0;
|
|
3358
|
+
}
|
|
3359
|
+
return p && (console.error(
|
|
3360
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
3361
|
+
typeof Symbol == "function" && Symbol.toStringTag && g[Symbol.toStringTag] || g.constructor.name || "Object"
|
|
3362
|
+
), t(g)), {
|
|
3363
|
+
$$typeof: o,
|
|
3364
|
+
key: g == null ? null : "" + g,
|
|
3365
|
+
children: l,
|
|
3366
|
+
containerInfo: d,
|
|
3367
|
+
implementation: h
|
|
3368
|
+
};
|
|
3369
|
+
}
|
|
3370
|
+
function n(l, d) {
|
|
3371
|
+
if (l === "font") return "";
|
|
3372
|
+
if (typeof d == "string")
|
|
3373
|
+
return d === "use-credentials" ? d : "";
|
|
3374
|
+
}
|
|
3375
|
+
function i(l) {
|
|
3376
|
+
return l === null ? "`null`" : l === void 0 ? "`undefined`" : l === "" ? "an empty string" : 'something with type "' + typeof l + '"';
|
|
3377
|
+
}
|
|
3378
|
+
function a(l) {
|
|
3379
|
+
return l === null ? "`null`" : l === void 0 ? "`undefined`" : l === "" ? "an empty string" : typeof l == "string" ? JSON.stringify(l) : typeof l == "number" ? "`" + l + "`" : 'something with type "' + typeof l + '"';
|
|
3380
|
+
}
|
|
3381
|
+
function u() {
|
|
3382
|
+
var l = f.H;
|
|
3383
|
+
return l === null && console.error(
|
|
3384
|
+
`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
3385
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
3386
|
+
2. You might be breaking the Rules of Hooks
|
|
3387
|
+
3. You might have more than one copy of React in the same app
|
|
3388
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
3389
|
+
), l;
|
|
3390
|
+
}
|
|
3391
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
3392
|
+
var c = kt, s = {
|
|
3393
|
+
d: {
|
|
3394
|
+
f: e,
|
|
3395
|
+
r: function() {
|
|
3396
|
+
throw Error(
|
|
3397
|
+
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
|
|
3398
|
+
);
|
|
3399
|
+
},
|
|
3400
|
+
D: e,
|
|
3401
|
+
C: e,
|
|
3402
|
+
L: e,
|
|
3403
|
+
m: e,
|
|
3404
|
+
X: e,
|
|
3405
|
+
S: e,
|
|
3406
|
+
M: e
|
|
3407
|
+
},
|
|
3408
|
+
p: 0,
|
|
3409
|
+
findDOMNode: null
|
|
3410
|
+
}, o = Symbol.for("react.portal"), f = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
3411
|
+
typeof Map == "function" && Map.prototype != null && typeof Map.prototype.forEach == "function" && typeof Set == "function" && Set.prototype != null && typeof Set.prototype.clear == "function" && typeof Set.prototype.forEach == "function" || console.error(
|
|
3412
|
+
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
|
3413
|
+
), C.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = s, C.createPortal = function(l, d) {
|
|
3414
|
+
var h = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
|
|
3415
|
+
if (!d || d.nodeType !== 1 && d.nodeType !== 9 && d.nodeType !== 11)
|
|
3416
|
+
throw Error("Target container is not a DOM element.");
|
|
3417
|
+
return r(l, d, null, h);
|
|
3418
|
+
}, C.flushSync = function(l) {
|
|
3419
|
+
var d = f.T, h = s.p;
|
|
3420
|
+
try {
|
|
3421
|
+
if (f.T = null, s.p = 2, l)
|
|
3422
|
+
return l();
|
|
3423
|
+
} finally {
|
|
3424
|
+
f.T = d, s.p = h, s.d.f() && console.error(
|
|
3425
|
+
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
|
3426
|
+
);
|
|
3427
|
+
}
|
|
3428
|
+
}, C.preconnect = function(l, d) {
|
|
3429
|
+
typeof l == "string" && l ? d != null && typeof d != "object" ? console.error(
|
|
3430
|
+
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
|
3431
|
+
a(d)
|
|
3432
|
+
) : d != null && typeof d.crossOrigin != "string" && console.error(
|
|
3433
|
+
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
|
|
3434
|
+
i(d.crossOrigin)
|
|
3435
|
+
) : console.error(
|
|
3436
|
+
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
3437
|
+
i(l)
|
|
3438
|
+
), typeof l == "string" && (d ? (d = d.crossOrigin, d = typeof d == "string" ? d === "use-credentials" ? d : "" : void 0) : d = null, s.d.C(l, d));
|
|
3439
|
+
}, C.prefetchDNS = function(l) {
|
|
3440
|
+
if (typeof l != "string" || !l)
|
|
3441
|
+
console.error(
|
|
3442
|
+
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
3443
|
+
i(l)
|
|
3444
|
+
);
|
|
3445
|
+
else if (1 < arguments.length) {
|
|
3446
|
+
var d = arguments[1];
|
|
3447
|
+
typeof d == "object" && d.hasOwnProperty("crossOrigin") ? console.error(
|
|
3448
|
+
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
3449
|
+
a(d)
|
|
3450
|
+
) : console.error(
|
|
3451
|
+
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
3452
|
+
a(d)
|
|
3453
|
+
);
|
|
3454
|
+
}
|
|
3455
|
+
typeof l == "string" && s.d.D(l);
|
|
3456
|
+
}, C.preinit = function(l, d) {
|
|
3457
|
+
if (typeof l == "string" && l ? d == null || typeof d != "object" ? console.error(
|
|
3458
|
+
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
|
|
3459
|
+
a(d)
|
|
3460
|
+
) : d.as !== "style" && d.as !== "script" && console.error(
|
|
3461
|
+
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
|
|
3462
|
+
a(d.as)
|
|
3463
|
+
) : console.error(
|
|
3464
|
+
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
3465
|
+
i(l)
|
|
3466
|
+
), typeof l == "string" && d && typeof d.as == "string") {
|
|
3467
|
+
var h = d.as, g = n(h, d.crossOrigin), p = typeof d.integrity == "string" ? d.integrity : void 0, m = typeof d.fetchPriority == "string" ? d.fetchPriority : void 0;
|
|
3468
|
+
h === "style" ? s.d.S(
|
|
3469
|
+
l,
|
|
3470
|
+
typeof d.precedence == "string" ? d.precedence : void 0,
|
|
3471
|
+
{
|
|
3472
|
+
crossOrigin: g,
|
|
3473
|
+
integrity: p,
|
|
3474
|
+
fetchPriority: m
|
|
3475
|
+
}
|
|
3476
|
+
) : h === "script" && s.d.X(l, {
|
|
3477
|
+
crossOrigin: g,
|
|
3478
|
+
integrity: p,
|
|
3479
|
+
fetchPriority: m,
|
|
3480
|
+
nonce: typeof d.nonce == "string" ? d.nonce : void 0
|
|
3481
|
+
});
|
|
3482
|
+
}
|
|
3483
|
+
}, C.preinitModule = function(l, d) {
|
|
3484
|
+
var h = "";
|
|
3485
|
+
if (typeof l == "string" && l || (h += " The `href` argument encountered was " + i(l) + "."), d !== void 0 && typeof d != "object" ? h += " The `options` argument encountered was " + i(d) + "." : d && "as" in d && d.as !== "script" && (h += " The `as` option encountered was " + a(d.as) + "."), h)
|
|
3486
|
+
console.error(
|
|
3487
|
+
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
|
|
3488
|
+
h
|
|
3489
|
+
);
|
|
3490
|
+
else
|
|
3491
|
+
switch (h = d && typeof d.as == "string" ? d.as : "script", h) {
|
|
3492
|
+
case "script":
|
|
3493
|
+
break;
|
|
3494
|
+
default:
|
|
3495
|
+
h = a(h), console.error(
|
|
3496
|
+
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
|
|
3497
|
+
h,
|
|
3498
|
+
l
|
|
3499
|
+
);
|
|
3500
|
+
}
|
|
3501
|
+
typeof l == "string" && (typeof d == "object" && d !== null ? (d.as == null || d.as === "script") && (h = n(
|
|
3502
|
+
d.as,
|
|
3503
|
+
d.crossOrigin
|
|
3504
|
+
), s.d.M(l, {
|
|
3505
|
+
crossOrigin: h,
|
|
3506
|
+
integrity: typeof d.integrity == "string" ? d.integrity : void 0,
|
|
3507
|
+
nonce: typeof d.nonce == "string" ? d.nonce : void 0
|
|
3508
|
+
})) : d == null && s.d.M(l));
|
|
3509
|
+
}, C.preload = function(l, d) {
|
|
3510
|
+
var h = "";
|
|
3511
|
+
if (typeof l == "string" && l || (h += " The `href` argument encountered was " + i(l) + "."), d == null || typeof d != "object" ? h += " The `options` argument encountered was " + i(d) + "." : typeof d.as == "string" && d.as || (h += " The `as` option encountered was " + i(d.as) + "."), h && console.error(
|
|
3512
|
+
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
|
3513
|
+
h
|
|
3514
|
+
), typeof l == "string" && typeof d == "object" && d !== null && typeof d.as == "string") {
|
|
3515
|
+
h = d.as;
|
|
3516
|
+
var g = n(
|
|
3517
|
+
h,
|
|
3518
|
+
d.crossOrigin
|
|
3519
|
+
);
|
|
3520
|
+
s.d.L(l, h, {
|
|
3521
|
+
crossOrigin: g,
|
|
3522
|
+
integrity: typeof d.integrity == "string" ? d.integrity : void 0,
|
|
3523
|
+
nonce: typeof d.nonce == "string" ? d.nonce : void 0,
|
|
3524
|
+
type: typeof d.type == "string" ? d.type : void 0,
|
|
3525
|
+
fetchPriority: typeof d.fetchPriority == "string" ? d.fetchPriority : void 0,
|
|
3526
|
+
referrerPolicy: typeof d.referrerPolicy == "string" ? d.referrerPolicy : void 0,
|
|
3527
|
+
imageSrcSet: typeof d.imageSrcSet == "string" ? d.imageSrcSet : void 0,
|
|
3528
|
+
imageSizes: typeof d.imageSizes == "string" ? d.imageSizes : void 0,
|
|
3529
|
+
media: typeof d.media == "string" ? d.media : void 0
|
|
3530
|
+
});
|
|
3531
|
+
}
|
|
3532
|
+
}, C.preloadModule = function(l, d) {
|
|
3533
|
+
var h = "";
|
|
3534
|
+
typeof l == "string" && l || (h += " The `href` argument encountered was " + i(l) + "."), d !== void 0 && typeof d != "object" ? h += " The `options` argument encountered was " + i(d) + "." : d && "as" in d && typeof d.as != "string" && (h += " The `as` option encountered was " + i(d.as) + "."), h && console.error(
|
|
3535
|
+
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
|
|
3536
|
+
h
|
|
3537
|
+
), typeof l == "string" && (d ? (h = n(
|
|
3538
|
+
d.as,
|
|
3539
|
+
d.crossOrigin
|
|
3540
|
+
), s.d.m(l, {
|
|
3541
|
+
as: typeof d.as == "string" && d.as !== "script" ? d.as : void 0,
|
|
3542
|
+
crossOrigin: h,
|
|
3543
|
+
integrity: typeof d.integrity == "string" ? d.integrity : void 0
|
|
3544
|
+
})) : s.d.m(l));
|
|
3545
|
+
}, C.requestFormReset = function(l) {
|
|
3546
|
+
s.d.r(l);
|
|
3547
|
+
}, C.unstable_batchedUpdates = function(l, d) {
|
|
3548
|
+
return l(d);
|
|
3549
|
+
}, C.useFormState = function(l, d, h) {
|
|
3550
|
+
return u().useFormState(l, d, h);
|
|
3551
|
+
}, C.useFormStatus = function() {
|
|
3552
|
+
return u().useHostTransitionStatus();
|
|
3553
|
+
}, C.version = "19.1.0", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
3554
|
+
}()), C;
|
|
3555
|
+
}
|
|
3556
|
+
var St;
|
|
3557
|
+
function Yi() {
|
|
3558
|
+
if (St) return ve.exports;
|
|
3559
|
+
St = 1;
|
|
3560
|
+
function e() {
|
|
3561
|
+
if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) {
|
|
3562
|
+
if (process.env.NODE_ENV !== "production")
|
|
3563
|
+
throw new Error("^_^");
|
|
3564
|
+
try {
|
|
3565
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
|
|
3566
|
+
} catch (t) {
|
|
3567
|
+
console.error(t);
|
|
3568
|
+
}
|
|
3569
|
+
}
|
|
3570
|
+
}
|
|
3571
|
+
return process.env.NODE_ENV === "production" ? (e(), ve.exports = ji()) : ve.exports = Bi(), ve.exports;
|
|
3572
|
+
}
|
|
3573
|
+
var Fi = Yi(), k = function() {
|
|
3574
|
+
return k = Object.assign || function(e) {
|
|
3575
|
+
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
|
3576
|
+
t = arguments[r];
|
|
3577
|
+
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
3578
|
+
}
|
|
3579
|
+
return e;
|
|
3580
|
+
}, k.apply(this, arguments);
|
|
3581
|
+
}, Ot = {
|
|
3582
|
+
width: "100%",
|
|
3583
|
+
height: "10px",
|
|
3584
|
+
top: "0px",
|
|
3585
|
+
left: "0px",
|
|
3586
|
+
cursor: "row-resize"
|
|
3587
|
+
}, Dt = {
|
|
3588
|
+
width: "10px",
|
|
3589
|
+
height: "100%",
|
|
3590
|
+
top: "0px",
|
|
3591
|
+
left: "0px",
|
|
3592
|
+
cursor: "col-resize"
|
|
3593
|
+
}, be = {
|
|
3594
|
+
width: "20px",
|
|
3595
|
+
height: "20px",
|
|
3596
|
+
position: "absolute",
|
|
3597
|
+
zIndex: 1
|
|
3598
|
+
}, $i = {
|
|
3599
|
+
top: k(k({}, Ot), { top: "-5px" }),
|
|
3600
|
+
right: k(k({}, Dt), { left: void 0, right: "-5px" }),
|
|
3601
|
+
bottom: k(k({}, Ot), { top: void 0, bottom: "-5px" }),
|
|
3602
|
+
left: k(k({}, Dt), { left: "-5px" }),
|
|
3603
|
+
topRight: k(k({}, be), { right: "-10px", top: "-10px", cursor: "ne-resize" }),
|
|
3604
|
+
bottomRight: k(k({}, be), { right: "-10px", bottom: "-10px", cursor: "se-resize" }),
|
|
3605
|
+
bottomLeft: k(k({}, be), { left: "-10px", bottom: "-10px", cursor: "sw-resize" }),
|
|
3606
|
+
topLeft: k(k({}, be), { left: "-10px", top: "-10px", cursor: "nw-resize" })
|
|
3607
|
+
}, qi = Zt(function(e) {
|
|
3608
|
+
var t = e.onResizeStart, r = e.direction, n = e.children, i = e.replaceStyles, a = e.className, u = Ve(function(o) {
|
|
3609
|
+
t(o, r);
|
|
3610
|
+
}, [t, r]), c = Ve(function(o) {
|
|
3611
|
+
t(o, r);
|
|
3612
|
+
}, [t, r]), s = er(function() {
|
|
3613
|
+
return k(k({ position: "absolute", userSelect: "none" }, $i[r]), i ?? {});
|
|
3614
|
+
}, [i, r]);
|
|
3615
|
+
return y("div", { className: a || void 0, style: s, onMouseDown: u, onTouchStart: c, children: n });
|
|
3616
|
+
}), Xi = /* @__PURE__ */ function() {
|
|
3617
|
+
var e = function(t, r) {
|
|
3618
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
|
|
3619
|
+
n.__proto__ = i;
|
|
3620
|
+
} || function(n, i) {
|
|
3621
|
+
for (var a in i) Object.prototype.hasOwnProperty.call(i, a) && (n[a] = i[a]);
|
|
3622
|
+
}, e(t, r);
|
|
3623
|
+
};
|
|
3624
|
+
return function(t, r) {
|
|
3625
|
+
if (typeof r != "function" && r !== null)
|
|
3626
|
+
throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
|
|
3627
|
+
e(t, r);
|
|
3628
|
+
function n() {
|
|
3629
|
+
this.constructor = t;
|
|
3630
|
+
}
|
|
3631
|
+
t.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
|
|
3632
|
+
};
|
|
3633
|
+
}(), I = function() {
|
|
3634
|
+
return I = Object.assign || function(e) {
|
|
3635
|
+
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
|
3636
|
+
t = arguments[r];
|
|
3637
|
+
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
3638
|
+
}
|
|
3639
|
+
return e;
|
|
3640
|
+
}, I.apply(this, arguments);
|
|
3641
|
+
}, Ui = {
|
|
3642
|
+
width: "auto",
|
|
3643
|
+
height: "auto"
|
|
3644
|
+
}, we = function(e, t, r) {
|
|
3645
|
+
return Math.max(Math.min(e, r), t);
|
|
3646
|
+
}, Tt = function(e, t, r) {
|
|
3647
|
+
var n = Math.round(e / t);
|
|
3648
|
+
return n * t + r * (n - 1);
|
|
3649
|
+
}, ee = function(e, t) {
|
|
3650
|
+
return new RegExp(e, "i").test(t);
|
|
3651
|
+
}, xe = function(e) {
|
|
3652
|
+
return !!(e.touches && e.touches.length);
|
|
3653
|
+
}, Gi = function(e) {
|
|
3654
|
+
return !!((e.clientX || e.clientX === 0) && (e.clientY || e.clientY === 0));
|
|
3655
|
+
}, Mt = function(e, t, r) {
|
|
3656
|
+
r === void 0 && (r = 0);
|
|
3657
|
+
var n = t.reduce(function(a, u, c) {
|
|
3658
|
+
return Math.abs(u - e) < Math.abs(t[a] - e) ? c : a;
|
|
3659
|
+
}, 0), i = Math.abs(t[n] - e);
|
|
3660
|
+
return r === 0 || i < r ? t[n] : e;
|
|
3661
|
+
}, ze = function(e) {
|
|
3662
|
+
return e = e.toString(), e === "auto" || e.endsWith("px") || e.endsWith("%") || e.endsWith("vh") || e.endsWith("vw") || e.endsWith("vmax") || e.endsWith("vmin") ? e : "".concat(e, "px");
|
|
3663
|
+
}, Se = function(e, t, r, n) {
|
|
3664
|
+
if (e && typeof e == "string") {
|
|
3665
|
+
if (e.endsWith("px"))
|
|
3666
|
+
return Number(e.replace("px", ""));
|
|
3667
|
+
if (e.endsWith("%")) {
|
|
3668
|
+
var i = Number(e.replace("%", "")) / 100;
|
|
3669
|
+
return t * i;
|
|
3670
|
+
}
|
|
3671
|
+
if (e.endsWith("vw")) {
|
|
3672
|
+
var i = Number(e.replace("vw", "")) / 100;
|
|
3673
|
+
return r * i;
|
|
3674
|
+
}
|
|
3675
|
+
if (e.endsWith("vh")) {
|
|
3676
|
+
var i = Number(e.replace("vh", "")) / 100;
|
|
3677
|
+
return n * i;
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
return e;
|
|
3681
|
+
}, Ki = function(e, t, r, n, i, a, u) {
|
|
3682
|
+
return n = Se(n, e.width, t, r), i = Se(i, e.height, t, r), a = Se(a, e.width, t, r), u = Se(u, e.height, t, r), {
|
|
3683
|
+
maxWidth: typeof n > "u" ? void 0 : Number(n),
|
|
3684
|
+
maxHeight: typeof i > "u" ? void 0 : Number(i),
|
|
3685
|
+
minWidth: typeof a > "u" ? void 0 : Number(a),
|
|
3686
|
+
minHeight: typeof u > "u" ? void 0 : Number(u)
|
|
3687
|
+
};
|
|
3688
|
+
}, Vi = function(e) {
|
|
3689
|
+
return Array.isArray(e) ? e : [e, e];
|
|
3690
|
+
}, Qi = [
|
|
3691
|
+
"as",
|
|
3692
|
+
"ref",
|
|
3693
|
+
"style",
|
|
3694
|
+
"className",
|
|
3695
|
+
"grid",
|
|
3696
|
+
"gridGap",
|
|
3697
|
+
"snap",
|
|
3698
|
+
"bounds",
|
|
3699
|
+
"boundsByDirection",
|
|
3700
|
+
"size",
|
|
3701
|
+
"defaultSize",
|
|
3702
|
+
"minWidth",
|
|
3703
|
+
"minHeight",
|
|
3704
|
+
"maxWidth",
|
|
3705
|
+
"maxHeight",
|
|
3706
|
+
"lockAspectRatio",
|
|
3707
|
+
"lockAspectRatioExtraWidth",
|
|
3708
|
+
"lockAspectRatioExtraHeight",
|
|
3709
|
+
"enable",
|
|
3710
|
+
"handleStyles",
|
|
3711
|
+
"handleClasses",
|
|
3712
|
+
"handleWrapperStyle",
|
|
3713
|
+
"handleWrapperClass",
|
|
3714
|
+
"children",
|
|
3715
|
+
"onResizeStart",
|
|
3716
|
+
"onResize",
|
|
3717
|
+
"onResizeStop",
|
|
3718
|
+
"handleComponent",
|
|
3719
|
+
"scale",
|
|
3720
|
+
"resizeRatio",
|
|
3721
|
+
"snapGap"
|
|
3722
|
+
], Et = "__resizable_base__", Ji = (
|
|
3723
|
+
/** @class */
|
|
3724
|
+
function(e) {
|
|
3725
|
+
Xi(t, e);
|
|
3726
|
+
function t(r) {
|
|
3727
|
+
var n, i, a, u, c = e.call(this, r) || this;
|
|
3728
|
+
return c.ratio = 1, c.resizable = null, c.parentLeft = 0, c.parentTop = 0, c.resizableLeft = 0, c.resizableRight = 0, c.resizableTop = 0, c.resizableBottom = 0, c.targetLeft = 0, c.targetTop = 0, c.delta = {
|
|
3729
|
+
width: 0,
|
|
3730
|
+
height: 0
|
|
3731
|
+
}, c.appendBase = function() {
|
|
3732
|
+
if (!c.resizable || !c.window)
|
|
3733
|
+
return null;
|
|
3734
|
+
var s = c.parentNode;
|
|
3735
|
+
if (!s)
|
|
3736
|
+
return null;
|
|
3737
|
+
var o = c.window.document.createElement("div");
|
|
3738
|
+
return o.style.width = "100%", o.style.height = "100%", o.style.position = "absolute", o.style.transform = "scale(0, 0)", o.style.left = "0", o.style.flex = "0 0 100%", o.classList ? o.classList.add(Et) : o.className += Et, s.appendChild(o), o;
|
|
3739
|
+
}, c.removeBase = function(s) {
|
|
3740
|
+
var o = c.parentNode;
|
|
3741
|
+
o && o.removeChild(s);
|
|
3742
|
+
}, c.state = {
|
|
3743
|
+
isResizing: !1,
|
|
3744
|
+
width: (i = (n = c.propsSize) === null || n === void 0 ? void 0 : n.width) !== null && i !== void 0 ? i : "auto",
|
|
3745
|
+
height: (u = (a = c.propsSize) === null || a === void 0 ? void 0 : a.height) !== null && u !== void 0 ? u : "auto",
|
|
3746
|
+
direction: "right",
|
|
3747
|
+
original: {
|
|
3748
|
+
x: 0,
|
|
3749
|
+
y: 0,
|
|
3750
|
+
width: 0,
|
|
3751
|
+
height: 0
|
|
3752
|
+
},
|
|
3753
|
+
backgroundStyle: {
|
|
3754
|
+
height: "100%",
|
|
3755
|
+
width: "100%",
|
|
3756
|
+
backgroundColor: "rgba(0,0,0,0)",
|
|
3757
|
+
cursor: "auto",
|
|
3758
|
+
opacity: 0,
|
|
3759
|
+
position: "fixed",
|
|
3760
|
+
zIndex: 9999,
|
|
3761
|
+
top: "0",
|
|
3762
|
+
left: "0",
|
|
3763
|
+
bottom: "0",
|
|
3764
|
+
right: "0"
|
|
3765
|
+
},
|
|
3766
|
+
flexBasis: void 0
|
|
3767
|
+
}, c.onResizeStart = c.onResizeStart.bind(c), c.onMouseMove = c.onMouseMove.bind(c), c.onMouseUp = c.onMouseUp.bind(c), c;
|
|
3768
|
+
}
|
|
3769
|
+
return Object.defineProperty(t.prototype, "parentNode", {
|
|
3770
|
+
get: function() {
|
|
3771
|
+
return this.resizable ? this.resizable.parentNode : null;
|
|
3772
|
+
},
|
|
3773
|
+
enumerable: !1,
|
|
3774
|
+
configurable: !0
|
|
3775
|
+
}), Object.defineProperty(t.prototype, "window", {
|
|
3776
|
+
get: function() {
|
|
3777
|
+
return !this.resizable || !this.resizable.ownerDocument ? null : this.resizable.ownerDocument.defaultView;
|
|
3778
|
+
},
|
|
3779
|
+
enumerable: !1,
|
|
3780
|
+
configurable: !0
|
|
3781
|
+
}), Object.defineProperty(t.prototype, "propsSize", {
|
|
3782
|
+
get: function() {
|
|
3783
|
+
return this.props.size || this.props.defaultSize || Ui;
|
|
3784
|
+
},
|
|
3785
|
+
enumerable: !1,
|
|
3786
|
+
configurable: !0
|
|
3787
|
+
}), Object.defineProperty(t.prototype, "size", {
|
|
3788
|
+
get: function() {
|
|
3789
|
+
var r = 0, n = 0;
|
|
3790
|
+
if (this.resizable && this.window) {
|
|
3791
|
+
var i = this.resizable.offsetWidth, a = this.resizable.offsetHeight, u = this.resizable.style.position;
|
|
3792
|
+
u !== "relative" && (this.resizable.style.position = "relative"), r = this.resizable.style.width !== "auto" ? this.resizable.offsetWidth : i, n = this.resizable.style.height !== "auto" ? this.resizable.offsetHeight : a, this.resizable.style.position = u;
|
|
3793
|
+
}
|
|
3794
|
+
return { width: r, height: n };
|
|
3795
|
+
},
|
|
3796
|
+
enumerable: !1,
|
|
3797
|
+
configurable: !0
|
|
3798
|
+
}), Object.defineProperty(t.prototype, "sizeStyle", {
|
|
3799
|
+
get: function() {
|
|
3800
|
+
var r = this, n = this.props.size, i = function(c) {
|
|
3801
|
+
var s;
|
|
3802
|
+
if (typeof r.state[c] > "u" || r.state[c] === "auto")
|
|
3803
|
+
return "auto";
|
|
3804
|
+
if (r.propsSize && r.propsSize[c] && (!((s = r.propsSize[c]) === null || s === void 0) && s.toString().endsWith("%"))) {
|
|
3805
|
+
if (r.state[c].toString().endsWith("%"))
|
|
3806
|
+
return r.state[c].toString();
|
|
3807
|
+
var o = r.getParentSize(), f = Number(r.state[c].toString().replace("px", "")), l = f / o[c] * 100;
|
|
3808
|
+
return "".concat(l, "%");
|
|
3809
|
+
}
|
|
3810
|
+
return ze(r.state[c]);
|
|
3811
|
+
}, a = n && typeof n.width < "u" && !this.state.isResizing ? ze(n.width) : i("width"), u = n && typeof n.height < "u" && !this.state.isResizing ? ze(n.height) : i("height");
|
|
3812
|
+
return { width: a, height: u };
|
|
3813
|
+
},
|
|
3814
|
+
enumerable: !1,
|
|
3815
|
+
configurable: !0
|
|
3816
|
+
}), t.prototype.getParentSize = function() {
|
|
3817
|
+
if (!this.parentNode)
|
|
3818
|
+
return this.window ? { width: this.window.innerWidth, height: this.window.innerHeight } : { width: 0, height: 0 };
|
|
3819
|
+
var r = this.appendBase();
|
|
3820
|
+
if (!r)
|
|
3821
|
+
return { width: 0, height: 0 };
|
|
3822
|
+
var n = !1, i = this.parentNode.style.flexWrap;
|
|
3823
|
+
i !== "wrap" && (n = !0, this.parentNode.style.flexWrap = "wrap"), r.style.position = "relative", r.style.minWidth = "100%", r.style.minHeight = "100%";
|
|
3824
|
+
var a = {
|
|
3825
|
+
width: r.offsetWidth,
|
|
3826
|
+
height: r.offsetHeight
|
|
3827
|
+
};
|
|
3828
|
+
return n && (this.parentNode.style.flexWrap = i), this.removeBase(r), a;
|
|
3829
|
+
}, t.prototype.bindEvents = function() {
|
|
3830
|
+
this.window && (this.window.addEventListener("mouseup", this.onMouseUp), this.window.addEventListener("mousemove", this.onMouseMove), this.window.addEventListener("mouseleave", this.onMouseUp), this.window.addEventListener("touchmove", this.onMouseMove, {
|
|
3831
|
+
capture: !0,
|
|
3832
|
+
passive: !1
|
|
3833
|
+
}), this.window.addEventListener("touchend", this.onMouseUp));
|
|
3834
|
+
}, t.prototype.unbindEvents = function() {
|
|
3835
|
+
this.window && (this.window.removeEventListener("mouseup", this.onMouseUp), this.window.removeEventListener("mousemove", this.onMouseMove), this.window.removeEventListener("mouseleave", this.onMouseUp), this.window.removeEventListener("touchmove", this.onMouseMove, !0), this.window.removeEventListener("touchend", this.onMouseUp));
|
|
3836
|
+
}, t.prototype.componentDidMount = function() {
|
|
3837
|
+
if (!(!this.resizable || !this.window)) {
|
|
3838
|
+
var r = this.window.getComputedStyle(this.resizable);
|
|
3839
|
+
this.setState({
|
|
3840
|
+
width: this.state.width || this.size.width,
|
|
3841
|
+
height: this.state.height || this.size.height,
|
|
3842
|
+
flexBasis: r.flexBasis !== "auto" ? r.flexBasis : void 0
|
|
3843
|
+
});
|
|
3844
|
+
}
|
|
3845
|
+
}, t.prototype.componentWillUnmount = function() {
|
|
3846
|
+
this.window && this.unbindEvents();
|
|
3847
|
+
}, t.prototype.createSizeForCssProperty = function(r, n) {
|
|
3848
|
+
var i = this.propsSize && this.propsSize[n];
|
|
3849
|
+
return this.state[n] === "auto" && this.state.original[n] === r && (typeof i > "u" || i === "auto") ? "auto" : r;
|
|
3850
|
+
}, t.prototype.calculateNewMaxFromBoundary = function(r, n) {
|
|
3851
|
+
var i = this.props.boundsByDirection, a = this.state.direction, u = i && ee("left", a), c = i && ee("top", a), s, o;
|
|
3852
|
+
if (this.props.bounds === "parent") {
|
|
3853
|
+
var f = this.parentNode;
|
|
3854
|
+
f && (s = u ? this.resizableRight - this.parentLeft : f.offsetWidth + (this.parentLeft - this.resizableLeft), o = c ? this.resizableBottom - this.parentTop : f.offsetHeight + (this.parentTop - this.resizableTop));
|
|
3855
|
+
} else this.props.bounds === "window" ? this.window && (s = u ? this.resizableRight : this.window.innerWidth - this.resizableLeft, o = c ? this.resizableBottom : this.window.innerHeight - this.resizableTop) : this.props.bounds && (s = u ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft), o = c ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop));
|
|
3856
|
+
return s && Number.isFinite(s) && (r = r && r < s ? r : s), o && Number.isFinite(o) && (n = n && n < o ? n : o), { maxWidth: r, maxHeight: n };
|
|
3857
|
+
}, t.prototype.calculateNewSizeFromDirection = function(r, n) {
|
|
3858
|
+
var i = this.props.scale || 1, a = Vi(this.props.resizeRatio || 1), u = a[0], c = a[1], s = this.state, o = s.direction, f = s.original, l = this.props, d = l.lockAspectRatio, h = l.lockAspectRatioExtraHeight, g = l.lockAspectRatioExtraWidth, p = f.width, m = f.height, b = h || 0, O = g || 0;
|
|
3859
|
+
return ee("right", o) && (p = f.width + (r - f.x) * u / i, d && (m = (p - O) / this.ratio + b)), ee("left", o) && (p = f.width - (r - f.x) * u / i, d && (m = (p - O) / this.ratio + b)), ee("bottom", o) && (m = f.height + (n - f.y) * c / i, d && (p = (m - b) * this.ratio + O)), ee("top", o) && (m = f.height - (n - f.y) * c / i, d && (p = (m - b) * this.ratio + O)), { newWidth: p, newHeight: m };
|
|
3860
|
+
}, t.prototype.calculateNewSizeFromAspectRatio = function(r, n, i, a) {
|
|
3861
|
+
var u = this.props, c = u.lockAspectRatio, s = u.lockAspectRatioExtraHeight, o = u.lockAspectRatioExtraWidth, f = typeof a.width > "u" ? 10 : a.width, l = typeof i.width > "u" || i.width < 0 ? r : i.width, d = typeof a.height > "u" ? 10 : a.height, h = typeof i.height > "u" || i.height < 0 ? n : i.height, g = s || 0, p = o || 0;
|
|
3862
|
+
if (c) {
|
|
3863
|
+
var m = (d - g) * this.ratio + p, b = (h - g) * this.ratio + p, O = (f - p) / this.ratio + g, x = (l - p) / this.ratio + g, w = Math.max(f, m), M = Math.min(l, b), S = Math.max(d, O), z = Math.min(h, x);
|
|
3864
|
+
r = we(r, w, M), n = we(n, S, z);
|
|
3865
|
+
} else
|
|
3866
|
+
r = we(r, f, l), n = we(n, d, h);
|
|
3867
|
+
return { newWidth: r, newHeight: n };
|
|
3868
|
+
}, t.prototype.setBoundingClientRect = function() {
|
|
3869
|
+
var r = 1 / (this.props.scale || 1);
|
|
3870
|
+
if (this.props.bounds === "parent") {
|
|
3871
|
+
var n = this.parentNode;
|
|
3872
|
+
if (n) {
|
|
3873
|
+
var i = n.getBoundingClientRect();
|
|
3874
|
+
this.parentLeft = i.left * r, this.parentTop = i.top * r;
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
if (this.props.bounds && typeof this.props.bounds != "string") {
|
|
3878
|
+
var a = this.props.bounds.getBoundingClientRect();
|
|
3879
|
+
this.targetLeft = a.left * r, this.targetTop = a.top * r;
|
|
3880
|
+
}
|
|
3881
|
+
if (this.resizable) {
|
|
3882
|
+
var u = this.resizable.getBoundingClientRect(), c = u.left, s = u.top, o = u.right, f = u.bottom;
|
|
3883
|
+
this.resizableLeft = c * r, this.resizableRight = o * r, this.resizableTop = s * r, this.resizableBottom = f * r;
|
|
3884
|
+
}
|
|
3885
|
+
}, t.prototype.onResizeStart = function(r, n) {
|
|
3886
|
+
if (!(!this.resizable || !this.window)) {
|
|
3887
|
+
var i = 0, a = 0;
|
|
3888
|
+
if (r.nativeEvent && Gi(r.nativeEvent) ? (i = r.nativeEvent.clientX, a = r.nativeEvent.clientY) : r.nativeEvent && xe(r.nativeEvent) && (i = r.nativeEvent.touches[0].clientX, a = r.nativeEvent.touches[0].clientY), this.props.onResizeStart && this.resizable) {
|
|
3889
|
+
var u = this.props.onResizeStart(r, n, this.resizable);
|
|
3890
|
+
if (u === !1)
|
|
3891
|
+
return;
|
|
3892
|
+
}
|
|
3893
|
+
this.props.size && (typeof this.props.size.height < "u" && this.props.size.height !== this.state.height && this.setState({ height: this.props.size.height }), typeof this.props.size.width < "u" && this.props.size.width !== this.state.width && this.setState({ width: this.props.size.width })), this.ratio = typeof this.props.lockAspectRatio == "number" ? this.props.lockAspectRatio : this.size.width / this.size.height;
|
|
3894
|
+
var c, s = this.window.getComputedStyle(this.resizable);
|
|
3895
|
+
if (s.flexBasis !== "auto") {
|
|
3896
|
+
var o = this.parentNode;
|
|
3897
|
+
if (o) {
|
|
3898
|
+
var f = this.window.getComputedStyle(o).flexDirection;
|
|
3899
|
+
this.flexDir = f.startsWith("row") ? "row" : "column", c = s.flexBasis;
|
|
3900
|
+
}
|
|
3901
|
+
}
|
|
3902
|
+
this.setBoundingClientRect(), this.bindEvents();
|
|
3903
|
+
var l = {
|
|
3904
|
+
original: {
|
|
3905
|
+
x: i,
|
|
3906
|
+
y: a,
|
|
3907
|
+
width: this.size.width,
|
|
3908
|
+
height: this.size.height
|
|
3909
|
+
},
|
|
3910
|
+
isResizing: !0,
|
|
3911
|
+
backgroundStyle: I(I({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(r.target).cursor || "auto" }),
|
|
3912
|
+
direction: n,
|
|
3913
|
+
flexBasis: c
|
|
3914
|
+
};
|
|
3915
|
+
this.setState(l);
|
|
3916
|
+
}
|
|
3917
|
+
}, t.prototype.onMouseMove = function(r) {
|
|
3918
|
+
var n = this;
|
|
3919
|
+
if (!(!this.state.isResizing || !this.resizable || !this.window)) {
|
|
3920
|
+
if (this.window.TouchEvent && xe(r))
|
|
3921
|
+
try {
|
|
3922
|
+
r.preventDefault(), r.stopPropagation();
|
|
3923
|
+
} catch {
|
|
3924
|
+
}
|
|
3925
|
+
var i = this.props, a = i.maxWidth, u = i.maxHeight, c = i.minWidth, s = i.minHeight, o = xe(r) ? r.touches[0].clientX : r.clientX, f = xe(r) ? r.touches[0].clientY : r.clientY, l = this.state, d = l.direction, h = l.original, g = l.width, p = l.height, m = this.getParentSize(), b = Ki(m, this.window.innerWidth, this.window.innerHeight, a, u, c, s);
|
|
3926
|
+
a = b.maxWidth, u = b.maxHeight, c = b.minWidth, s = b.minHeight;
|
|
3927
|
+
var O = this.calculateNewSizeFromDirection(o, f), x = O.newHeight, w = O.newWidth, M = this.calculateNewMaxFromBoundary(a, u);
|
|
3928
|
+
this.props.snap && this.props.snap.x && (w = Mt(w, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (x = Mt(x, this.props.snap.y, this.props.snapGap));
|
|
3929
|
+
var S = this.calculateNewSizeFromAspectRatio(w, x, { width: M.maxWidth, height: M.maxHeight }, { width: c, height: s });
|
|
3930
|
+
if (w = S.newWidth, x = S.newHeight, this.props.grid) {
|
|
3931
|
+
var z = Tt(w, this.props.grid[0], this.props.gridGap ? this.props.gridGap[0] : 0), E = Tt(x, this.props.grid[1], this.props.gridGap ? this.props.gridGap[1] : 0), v = this.props.snapGap || 0, D = v === 0 || Math.abs(z - w) <= v ? z : w, P = v === 0 || Math.abs(E - x) <= v ? E : x;
|
|
3932
|
+
w = D, x = P;
|
|
3933
|
+
}
|
|
3934
|
+
var R = {
|
|
3935
|
+
width: w - h.width,
|
|
3936
|
+
height: x - h.height
|
|
3937
|
+
};
|
|
3938
|
+
if (this.delta = R, g && typeof g == "string") {
|
|
3939
|
+
if (g.endsWith("%")) {
|
|
3940
|
+
var L = w / m.width * 100;
|
|
3941
|
+
w = "".concat(L, "%");
|
|
3942
|
+
} else if (g.endsWith("vw")) {
|
|
3943
|
+
var X = w / this.window.innerWidth * 100;
|
|
3944
|
+
w = "".concat(X, "vw");
|
|
3945
|
+
} else if (g.endsWith("vh")) {
|
|
3946
|
+
var J = w / this.window.innerHeight * 100;
|
|
3947
|
+
w = "".concat(J, "vh");
|
|
3948
|
+
}
|
|
3949
|
+
}
|
|
3950
|
+
if (p && typeof p == "string") {
|
|
3951
|
+
if (p.endsWith("%")) {
|
|
3952
|
+
var L = x / m.height * 100;
|
|
3953
|
+
x = "".concat(L, "%");
|
|
3954
|
+
} else if (p.endsWith("vw")) {
|
|
3955
|
+
var X = x / this.window.innerWidth * 100;
|
|
3956
|
+
x = "".concat(X, "vw");
|
|
3957
|
+
} else if (p.endsWith("vh")) {
|
|
3958
|
+
var J = x / this.window.innerHeight * 100;
|
|
3959
|
+
x = "".concat(J, "vh");
|
|
3960
|
+
}
|
|
3961
|
+
}
|
|
3962
|
+
var A = {
|
|
3963
|
+
width: this.createSizeForCssProperty(w, "width"),
|
|
3964
|
+
height: this.createSizeForCssProperty(x, "height")
|
|
3965
|
+
};
|
|
3966
|
+
this.flexDir === "row" ? A.flexBasis = A.width : this.flexDir === "column" && (A.flexBasis = A.height);
|
|
3967
|
+
var U = this.state.width !== A.width, Kt = this.state.height !== A.height, Vt = this.state.flexBasis !== A.flexBasis, Ke = U || Kt || Vt;
|
|
3968
|
+
Ke && Fi.flushSync(function() {
|
|
3969
|
+
n.setState(A);
|
|
3970
|
+
}), this.props.onResize && Ke && this.props.onResize(r, d, this.resizable, R);
|
|
3971
|
+
}
|
|
3972
|
+
}, t.prototype.onMouseUp = function(r) {
|
|
3973
|
+
var n, i, a = this.state, u = a.isResizing, c = a.direction;
|
|
3974
|
+
a.original, !(!u || !this.resizable) && (this.props.onResizeStop && this.props.onResizeStop(r, c, this.resizable, this.delta), this.props.size && this.setState({ width: (n = this.props.size.width) !== null && n !== void 0 ? n : "auto", height: (i = this.props.size.height) !== null && i !== void 0 ? i : "auto" }), this.unbindEvents(), this.setState({
|
|
3975
|
+
isResizing: !1,
|
|
3976
|
+
backgroundStyle: I(I({}, this.state.backgroundStyle), { cursor: "auto" })
|
|
3977
|
+
}));
|
|
3978
|
+
}, t.prototype.updateSize = function(r) {
|
|
3979
|
+
var n, i;
|
|
3980
|
+
this.setState({ width: (n = r.width) !== null && n !== void 0 ? n : "auto", height: (i = r.height) !== null && i !== void 0 ? i : "auto" });
|
|
3981
|
+
}, t.prototype.renderResizer = function() {
|
|
3982
|
+
var r = this, n = this.props, i = n.enable, a = n.handleStyles, u = n.handleClasses, c = n.handleWrapperStyle, s = n.handleWrapperClass, o = n.handleComponent;
|
|
3983
|
+
if (!i)
|
|
3984
|
+
return null;
|
|
3985
|
+
var f = Object.keys(i).map(function(l) {
|
|
3986
|
+
return i[l] !== !1 ? y(qi, { direction: l, onResizeStart: r.onResizeStart, replaceStyles: a && a[l], className: u && u[l], children: o && o[l] ? o[l] : null }, l) : null;
|
|
3987
|
+
});
|
|
3988
|
+
return y("div", { className: s, style: c, children: f });
|
|
3989
|
+
}, t.prototype.render = function() {
|
|
3990
|
+
var r = this, n = Object.keys(this.props).reduce(function(u, c) {
|
|
3991
|
+
return Qi.indexOf(c) !== -1 || (u[c] = r.props[c]), u;
|
|
3992
|
+
}, {}), i = I(I(I({ position: "relative", userSelect: this.state.isResizing ? "none" : "auto" }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: "border-box", flexShrink: 0 });
|
|
3993
|
+
this.state.flexBasis && (i.flexBasis = this.state.flexBasis);
|
|
3994
|
+
var a = this.props.as || "div";
|
|
3995
|
+
return Q(a, I({ style: i, className: this.props.className }, n, {
|
|
3996
|
+
// `ref` is after `extendsProps` to ensure this one wins over a version
|
|
3997
|
+
// passed in
|
|
3998
|
+
ref: function(u) {
|
|
3999
|
+
u && (r.resizable = u);
|
|
4000
|
+
},
|
|
4001
|
+
children: [this.state.isResizing && y("div", { style: this.state.backgroundStyle }), this.props.children, this.renderResizer()]
|
|
4002
|
+
}));
|
|
4003
|
+
}, t.defaultProps = {
|
|
4004
|
+
as: "div",
|
|
4005
|
+
onResizeStart: function() {
|
|
4006
|
+
},
|
|
4007
|
+
onResize: function() {
|
|
4008
|
+
},
|
|
4009
|
+
onResizeStop: function() {
|
|
4010
|
+
},
|
|
4011
|
+
enable: {
|
|
4012
|
+
top: !0,
|
|
4013
|
+
right: !0,
|
|
4014
|
+
bottom: !0,
|
|
4015
|
+
left: !0,
|
|
4016
|
+
topRight: !0,
|
|
4017
|
+
bottomRight: !0,
|
|
4018
|
+
bottomLeft: !0,
|
|
4019
|
+
topLeft: !0
|
|
4020
|
+
},
|
|
4021
|
+
style: {},
|
|
4022
|
+
grid: [1, 1],
|
|
4023
|
+
gridGap: [0, 0],
|
|
4024
|
+
lockAspectRatio: !1,
|
|
4025
|
+
lockAspectRatioExtraWidth: 0,
|
|
4026
|
+
lockAspectRatioExtraHeight: 0,
|
|
4027
|
+
scale: 1,
|
|
4028
|
+
resizeRatio: 1,
|
|
4029
|
+
snapGap: 0
|
|
4030
|
+
}, t;
|
|
4031
|
+
}(tr)
|
|
4032
|
+
);
|
|
4033
|
+
function Zi({
|
|
4034
|
+
item: e,
|
|
4035
|
+
rectangle: t,
|
|
4036
|
+
boundingRectangle: r,
|
|
4037
|
+
children: n,
|
|
4038
|
+
onDrag: i,
|
|
4039
|
+
onDragStart: a,
|
|
4040
|
+
onDrop: u,
|
|
4041
|
+
onUpdate: c,
|
|
4042
|
+
onResizeStart: s
|
|
4043
|
+
}) {
|
|
4044
|
+
const o = le(null), f = le(null), [l, d] = V(t);
|
|
4045
|
+
return re(() => {
|
|
4046
|
+
d(t);
|
|
4047
|
+
}, [t]), re(() => (Ie(o.current), Ie(f.current), Ti({
|
|
4048
|
+
element: o.current,
|
|
4049
|
+
dragHandle: f.current,
|
|
4050
|
+
onDragStart: ({ source: h, location: g }) => {
|
|
4051
|
+
const p = te(h, g);
|
|
4052
|
+
a(p.absolute, p.relative);
|
|
4053
|
+
},
|
|
4054
|
+
onDrag: () => {
|
|
4055
|
+
i();
|
|
4056
|
+
},
|
|
4057
|
+
onDrop: () => {
|
|
4058
|
+
u();
|
|
4059
|
+
},
|
|
4060
|
+
getInitialData: () => ({ ...e })
|
|
4061
|
+
})), [e, i, a, u]), /* @__PURE__ */ y(
|
|
4062
|
+
"div",
|
|
4063
|
+
{
|
|
4064
|
+
id: `timelane-item-${e.id}`,
|
|
4065
|
+
className: "timelane-item",
|
|
4066
|
+
"data-timelane-item-id": e.id,
|
|
4067
|
+
ref: o,
|
|
4068
|
+
style: {
|
|
4069
|
+
width: `${l.width}px`,
|
|
4070
|
+
height: `${l.height}px`,
|
|
4071
|
+
minWidth: `${l.width}px`,
|
|
4072
|
+
minHeight: `${l.height}px`,
|
|
4073
|
+
maxWidth: `${l.width}px`,
|
|
4074
|
+
maxHeight: `${l.height}px`,
|
|
4075
|
+
top: `${l.y}px`,
|
|
4076
|
+
left: `${l.x}px`
|
|
4077
|
+
},
|
|
4078
|
+
onMouseDown: (h) => {
|
|
4079
|
+
h.stopPropagation();
|
|
4080
|
+
},
|
|
4081
|
+
onClick: (h) => {
|
|
4082
|
+
h.stopPropagation();
|
|
4083
|
+
},
|
|
4084
|
+
children: /* @__PURE__ */ y(
|
|
4085
|
+
Ji,
|
|
4086
|
+
{
|
|
4087
|
+
enable: {
|
|
4088
|
+
right: !0,
|
|
4089
|
+
left: !0,
|
|
4090
|
+
top: !0,
|
|
4091
|
+
bottom: !0
|
|
4092
|
+
},
|
|
4093
|
+
handleClasses: {
|
|
4094
|
+
left: "timelane-item-resize-handle timelane-item-resize-handle-left",
|
|
4095
|
+
right: "timelane-item-resize-handle timelane-item-resize-handle-right"
|
|
4096
|
+
},
|
|
4097
|
+
size: {
|
|
4098
|
+
width: l.width,
|
|
4099
|
+
height: l.height
|
|
4100
|
+
},
|
|
4101
|
+
onResizeStart: () => {
|
|
4102
|
+
s();
|
|
4103
|
+
},
|
|
4104
|
+
onResize: (h, g, p, m) => {
|
|
4105
|
+
d((b) => g === "right" ? {
|
|
4106
|
+
...b,
|
|
4107
|
+
width: t.width + m.width
|
|
4108
|
+
} : g === "left" ? {
|
|
4109
|
+
...b,
|
|
4110
|
+
x: t.x - m.width,
|
|
4111
|
+
width: t.width + m.width
|
|
4112
|
+
} : g === "bottom" ? {
|
|
4113
|
+
...b,
|
|
4114
|
+
height: Math.min(
|
|
4115
|
+
t.height + m.height,
|
|
4116
|
+
r.height - t.y
|
|
4117
|
+
)
|
|
4118
|
+
} : g === "top" ? {
|
|
4119
|
+
...b,
|
|
4120
|
+
y: t.y - m.height,
|
|
4121
|
+
height: t.height + m.height
|
|
4122
|
+
} : b);
|
|
4123
|
+
},
|
|
4124
|
+
onResizeStop: (h, g, p, m) => {
|
|
4125
|
+
let b = t;
|
|
4126
|
+
g === "right" ? b = {
|
|
4127
|
+
...t,
|
|
4128
|
+
width: t.width + m.width
|
|
4129
|
+
} : g === "left" ? b = {
|
|
4130
|
+
...t,
|
|
4131
|
+
x: t.x - m.width,
|
|
4132
|
+
width: t.width + m.width
|
|
4133
|
+
} : g === "bottom" ? b = {
|
|
4134
|
+
...t,
|
|
4135
|
+
height: Math.min(
|
|
4136
|
+
t.height + m.height,
|
|
4137
|
+
r.height - t.y
|
|
4138
|
+
)
|
|
4139
|
+
} : g === "top" && (b = {
|
|
4140
|
+
...t,
|
|
4141
|
+
y: t.y - m.height,
|
|
4142
|
+
height: t.height + m.height
|
|
4143
|
+
}), c(b);
|
|
4144
|
+
},
|
|
4145
|
+
style: { overflow: "hidden" },
|
|
4146
|
+
children: /* @__PURE__ */ y("div", { className: "timelane-item-drag-handle", ref: f, children: n })
|
|
4147
|
+
}
|
|
4148
|
+
)
|
|
4149
|
+
}
|
|
4150
|
+
);
|
|
4151
|
+
}
|
|
4152
|
+
function ea({
|
|
4153
|
+
swimlane: e,
|
|
4154
|
+
item: t,
|
|
4155
|
+
settings: r,
|
|
4156
|
+
children: n,
|
|
4157
|
+
onDragStart: i,
|
|
4158
|
+
onDrag: a,
|
|
4159
|
+
onDrop: u,
|
|
4160
|
+
onUpdate: c,
|
|
4161
|
+
onResizeStart: s
|
|
4162
|
+
}) {
|
|
4163
|
+
const o = Fe(t, e, r, r), f = Ye(
|
|
4164
|
+
e,
|
|
4165
|
+
r,
|
|
4166
|
+
r
|
|
4167
|
+
);
|
|
4168
|
+
return /* @__PURE__ */ y(
|
|
4169
|
+
Zi,
|
|
4170
|
+
{
|
|
4171
|
+
item: t,
|
|
4172
|
+
rectangle: o,
|
|
4173
|
+
boundingRectangle: f,
|
|
4174
|
+
onDrag: a,
|
|
4175
|
+
onDragStart: i,
|
|
4176
|
+
onDrop: u,
|
|
4177
|
+
onUpdate: (l) => {
|
|
4178
|
+
const d = It(
|
|
4179
|
+
t,
|
|
4180
|
+
e,
|
|
4181
|
+
l,
|
|
4182
|
+
r,
|
|
4183
|
+
r
|
|
4184
|
+
);
|
|
4185
|
+
c(d);
|
|
4186
|
+
},
|
|
4187
|
+
onResizeStart: s,
|
|
4188
|
+
children: n
|
|
4189
|
+
}
|
|
4190
|
+
);
|
|
4191
|
+
}
|
|
4192
|
+
function ta({ overlap: e }) {
|
|
4193
|
+
return /* @__PURE__ */ y(
|
|
4194
|
+
"div",
|
|
4195
|
+
{
|
|
4196
|
+
style: {
|
|
4197
|
+
position: "absolute",
|
|
4198
|
+
left: `${e.x}px`,
|
|
4199
|
+
top: `${e.y}px`,
|
|
4200
|
+
width: `${e.width - 1}px`,
|
|
4201
|
+
height: `${e.height - 1}px`,
|
|
4202
|
+
background: "rgba(255,0,0, 0.3)",
|
|
4203
|
+
marginLeft: "1px",
|
|
4204
|
+
pointerEvents: "none"
|
|
4205
|
+
}
|
|
4206
|
+
}
|
|
4207
|
+
);
|
|
4208
|
+
}
|
|
4209
|
+
function Pt(e) {
|
|
4210
|
+
return "id" in e && "swimlaneId" in e && "start" in e && "end" in e && "size" in e && "offset" in e;
|
|
4211
|
+
}
|
|
4212
|
+
function ra({
|
|
4213
|
+
swimlane: e,
|
|
4214
|
+
items: t,
|
|
4215
|
+
focused: r = !1,
|
|
4216
|
+
onItemUpdate: n = () => {
|
|
4217
|
+
},
|
|
4218
|
+
onMouseUp: i = () => {
|
|
4219
|
+
},
|
|
4220
|
+
onClick: a = () => {
|
|
4221
|
+
},
|
|
4222
|
+
onDoubleClick: u = () => {
|
|
4223
|
+
},
|
|
4224
|
+
onContextMenu: c = () => {
|
|
4225
|
+
},
|
|
4226
|
+
renderItem: s = na,
|
|
4227
|
+
onResizeStart: o = () => {
|
|
4228
|
+
}
|
|
4229
|
+
}) {
|
|
4230
|
+
const { settings: f } = pe(), l = {
|
|
4231
|
+
x: f.pixelsPerDay,
|
|
4232
|
+
offsetX: f.pixelsPerDay / 2
|
|
4233
|
+
}, d = Ye(
|
|
4234
|
+
e,
|
|
4235
|
+
f,
|
|
4236
|
+
f
|
|
4237
|
+
), [h, g] = V(null), [p, m] = V(
|
|
4238
|
+
null
|
|
4239
|
+
);
|
|
4240
|
+
function b(v) {
|
|
4241
|
+
const D = v.currentTarget.getBoundingClientRect();
|
|
4242
|
+
return _e(
|
|
4243
|
+
de(
|
|
4244
|
+
f.start,
|
|
4245
|
+
(v.clientX - D.left) / f.pixelsPerDay
|
|
4246
|
+
),
|
|
4247
|
+
12
|
|
4248
|
+
);
|
|
4249
|
+
}
|
|
4250
|
+
function O(v) {
|
|
4251
|
+
const D = v.currentTarget.getBoundingClientRect();
|
|
4252
|
+
return (v.pageY - D.top) / D.height * e.capacity;
|
|
4253
|
+
}
|
|
4254
|
+
function x(v, D, P) {
|
|
4255
|
+
if (!Pt(P)) return;
|
|
4256
|
+
const R = Ri(
|
|
4257
|
+
e,
|
|
4258
|
+
t,
|
|
4259
|
+
P,
|
|
4260
|
+
v,
|
|
4261
|
+
D,
|
|
4262
|
+
f,
|
|
4263
|
+
l,
|
|
4264
|
+
f,
|
|
4265
|
+
f.allowOverlaps
|
|
4266
|
+
);
|
|
4267
|
+
m(R);
|
|
4268
|
+
}
|
|
4269
|
+
function w(v, D, P) {
|
|
4270
|
+
if (!Pt(P) || p === null) return;
|
|
4271
|
+
const R = It(
|
|
4272
|
+
P,
|
|
4273
|
+
e,
|
|
4274
|
+
p,
|
|
4275
|
+
f,
|
|
4276
|
+
f
|
|
4277
|
+
);
|
|
4278
|
+
n(R), m(null);
|
|
4279
|
+
}
|
|
4280
|
+
function M() {
|
|
4281
|
+
m(null);
|
|
4282
|
+
}
|
|
4283
|
+
function S(v, D) {
|
|
4284
|
+
const P = b(v), R = O(v), L = Li(
|
|
4285
|
+
P,
|
|
4286
|
+
R,
|
|
4287
|
+
e,
|
|
4288
|
+
t,
|
|
4289
|
+
f
|
|
4290
|
+
);
|
|
4291
|
+
D == "single" ? a(P, L, v) : u(P, L, v);
|
|
4292
|
+
}
|
|
4293
|
+
const z = t.map((v) => ({
|
|
4294
|
+
id: v.id,
|
|
4295
|
+
...Fe(v, e, f, f)
|
|
4296
|
+
})), E = z.flatMap(
|
|
4297
|
+
(v) => z.map((D) => v.id < D.id ? _i(v, D) : null)
|
|
4298
|
+
).filter((v) => v !== null);
|
|
4299
|
+
return /* @__PURE__ */ y(
|
|
4300
|
+
"div",
|
|
4301
|
+
{
|
|
4302
|
+
id: `timelane-swimlane-${e.id}`,
|
|
4303
|
+
className: `timelane-swimlane ${r ? "timelane-swimlane-focused" : ""}`,
|
|
4304
|
+
"data-timelane-swimlane-id": e.id,
|
|
4305
|
+
style: d,
|
|
4306
|
+
onMouseUp: i,
|
|
4307
|
+
onClick: (v) => S(v, "single"),
|
|
4308
|
+
onDoubleClick: (v) => S(v, "double"),
|
|
4309
|
+
onContextMenu: (v) => {
|
|
4310
|
+
c(b(v), v);
|
|
4311
|
+
},
|
|
4312
|
+
children: /* @__PURE__ */ Q(
|
|
4313
|
+
Ei,
|
|
4314
|
+
{
|
|
4315
|
+
onDrag: x,
|
|
4316
|
+
onDragLeave: M,
|
|
4317
|
+
onDrop: w,
|
|
4318
|
+
children: [
|
|
4319
|
+
t.map((v, D) => /* @__PURE__ */ y(
|
|
4320
|
+
ea,
|
|
4321
|
+
{
|
|
4322
|
+
item: v,
|
|
4323
|
+
settings: f,
|
|
4324
|
+
swimlane: e,
|
|
4325
|
+
onDragStart: () => {
|
|
4326
|
+
g(v);
|
|
4327
|
+
},
|
|
4328
|
+
onDrag: () => {
|
|
4329
|
+
},
|
|
4330
|
+
onDrop: () => {
|
|
4331
|
+
g(null);
|
|
4332
|
+
},
|
|
4333
|
+
onUpdate: n,
|
|
4334
|
+
onResizeStart: () => {
|
|
4335
|
+
o(v.payload);
|
|
4336
|
+
},
|
|
4337
|
+
children: s(
|
|
4338
|
+
v,
|
|
4339
|
+
h !== null && h.id === v.id
|
|
4340
|
+
)
|
|
4341
|
+
},
|
|
4342
|
+
D
|
|
4343
|
+
)),
|
|
4344
|
+
p && /* @__PURE__ */ y(Pi, { ...p }),
|
|
4345
|
+
E.map((v, D) => /* @__PURE__ */ y(ta, { overlap: v }, D))
|
|
4346
|
+
]
|
|
4347
|
+
}
|
|
4348
|
+
)
|
|
4349
|
+
}
|
|
4350
|
+
);
|
|
4351
|
+
}
|
|
4352
|
+
function na(e, t) {
|
|
4353
|
+
return /* @__PURE__ */ Q("div", { children: [
|
|
4354
|
+
e.id,
|
|
4355
|
+
" (",
|
|
4356
|
+
j(e.start, "yyyy-mm-dd"),
|
|
4357
|
+
" -",
|
|
4358
|
+
" ",
|
|
4359
|
+
j(e.end, "yyyy-mm-dd"),
|
|
4360
|
+
")",
|
|
4361
|
+
t ? "dragging" : ""
|
|
4362
|
+
] });
|
|
4363
|
+
}
|
|
4364
|
+
function ia({
|
|
4365
|
+
children: e,
|
|
4366
|
+
onSelect: t
|
|
4367
|
+
}) {
|
|
4368
|
+
const [r, n] = V([]), i = le(null), [a, u] = V(null), [c, s] = V(null);
|
|
4369
|
+
re(() => Di({
|
|
4370
|
+
onDragStart: (d) => {
|
|
4371
|
+
n([d.source.data.id]);
|
|
4372
|
+
}
|
|
4373
|
+
}), []), re(() => {
|
|
4374
|
+
t(r);
|
|
4375
|
+
}, [t, r]);
|
|
4376
|
+
function o(d) {
|
|
4377
|
+
!d.shiftKey && !d.ctrlKey && n([]), u({ x: d.clientX, y: d.clientY });
|
|
4378
|
+
}
|
|
4379
|
+
function f(d) {
|
|
4380
|
+
if (a) {
|
|
4381
|
+
const h = {
|
|
4382
|
+
x: Math.min(d.clientX, a.x),
|
|
4383
|
+
y: Math.min(d.clientY, a.y),
|
|
4384
|
+
width: Math.abs(d.clientX - a.x),
|
|
4385
|
+
height: Math.abs(d.clientY - a.y)
|
|
4386
|
+
}, g = d.currentTarget.getBoundingClientRect();
|
|
4387
|
+
s({
|
|
4388
|
+
...h,
|
|
4389
|
+
x: h.x - g.left,
|
|
4390
|
+
y: h.y - g.top
|
|
4391
|
+
}), document.querySelectorAll(".timelane-drop-target").forEach((p) => {
|
|
4392
|
+
ue(p.getBoundingClientRect(), h) && p.querySelectorAll(".timelane-item").forEach((m) => {
|
|
4393
|
+
ue(m.getBoundingClientRect(), h) ? m.classList.add("timelane-item-marked") : m.classList.remove("timelane-item-marked");
|
|
4394
|
+
});
|
|
4395
|
+
}), (h.width > 5 || h.height > 5) && !i.current && (i.current = Rt, window.addEventListener("click", Rt, !0));
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
function l(d) {
|
|
4399
|
+
if (a && c) {
|
|
4400
|
+
d.stopPropagation();
|
|
4401
|
+
const h = {
|
|
4402
|
+
x: Math.min(d.clientX, a.x),
|
|
4403
|
+
y: Math.min(d.clientY, a.y),
|
|
4404
|
+
width: Math.abs(d.clientX - a.x),
|
|
4405
|
+
height: Math.abs(d.clientY - a.y)
|
|
4406
|
+
}, g = Array.from(
|
|
4407
|
+
document.querySelectorAll(".timelane-drop-target")
|
|
4408
|
+
).filter((p) => ue(p.getBoundingClientRect(), h)).map((p) => Array.from(p.querySelectorAll(".timelane-item"))).flatMap((p) => p).filter((p) => ue(p.getBoundingClientRect(), h)).map((p) => p instanceof HTMLElement ? Number.parseInt(p.dataset.timelaneItemId || "-1") : -1).filter((p) => p > 0);
|
|
4409
|
+
g.length > 0 && (d.shiftKey || d.ctrlKey ? n((p) => Array.from(/* @__PURE__ */ new Set([...p, ...g]))) : n(g)), document.querySelectorAll(".timelane-item-marked").forEach((p) => {
|
|
4410
|
+
p.classList.remove("timelane-item-marked");
|
|
4411
|
+
});
|
|
4412
|
+
}
|
|
4413
|
+
u(null), s(null), requestAnimationFrame(() => {
|
|
4414
|
+
i.current && i.current !== null && (window.removeEventListener("click", i.current, !0), i.current = null);
|
|
4415
|
+
});
|
|
4416
|
+
}
|
|
4417
|
+
return /* @__PURE__ */ Q(
|
|
4418
|
+
"div",
|
|
4419
|
+
{
|
|
4420
|
+
onMouseDown: o,
|
|
4421
|
+
onMouseMove: f,
|
|
4422
|
+
onMouseUp: l,
|
|
4423
|
+
style: {
|
|
4424
|
+
position: "relative"
|
|
4425
|
+
},
|
|
4426
|
+
children: [
|
|
4427
|
+
c && /* @__PURE__ */ y(aa, { rect: c }),
|
|
4428
|
+
e
|
|
4429
|
+
]
|
|
4430
|
+
}
|
|
4431
|
+
);
|
|
4432
|
+
}
|
|
4433
|
+
const Rt = (e) => {
|
|
4434
|
+
e.preventDefault(), e.stopPropagation();
|
|
4435
|
+
};
|
|
4436
|
+
function aa({ rect: e }) {
|
|
4437
|
+
return /* @__PURE__ */ y(
|
|
4438
|
+
"div",
|
|
4439
|
+
{
|
|
4440
|
+
id: "mouse-selection-indicator",
|
|
4441
|
+
style: {
|
|
4442
|
+
border: "1px dashed blue",
|
|
4443
|
+
position: "absolute",
|
|
4444
|
+
top: `${e.y}px`,
|
|
4445
|
+
left: `${e.x}px`,
|
|
4446
|
+
width: `${e.width}px`,
|
|
4447
|
+
height: `${e.height}px`,
|
|
4448
|
+
zIndex: 1e6
|
|
4449
|
+
}
|
|
4450
|
+
}
|
|
4451
|
+
);
|
|
4452
|
+
}
|
|
4453
|
+
function oa({
|
|
4454
|
+
onSelect: e = () => {
|
|
4455
|
+
},
|
|
4456
|
+
children: t
|
|
4457
|
+
}) {
|
|
4458
|
+
return /* @__PURE__ */ y(H.Body, { children: /* @__PURE__ */ y(ia, { onSelect: e, children: /* @__PURE__ */ y("div", { className: "timelane-body", children: t }) }) });
|
|
4459
|
+
}
|
|
4460
|
+
function sa(e, t) {
|
|
4461
|
+
const r = q(t, e) + 1;
|
|
4462
|
+
return /* @__PURE__ */ y(Oe, { children: r > 4 ? j(e, "LLLL yyyy") : /* @__PURE__ */ y(Oe, {}) });
|
|
4463
|
+
}
|
|
4464
|
+
function ua(e, t) {
|
|
4465
|
+
const r = q(t, e) + 1, n = `KW ${j(e, "w")} (${j(
|
|
4466
|
+
e,
|
|
4467
|
+
"MM-dd"
|
|
4468
|
+
)} - ${j(t, "MM-dd")}`;
|
|
4469
|
+
return /* @__PURE__ */ y("div", { title: n, children: r > 2 ? /* @__PURE__ */ Q(Oe, { children: [
|
|
4470
|
+
"KW ",
|
|
4471
|
+
j(e, "w")
|
|
4472
|
+
] }) : /* @__PURE__ */ y(Oe, {}) });
|
|
4473
|
+
}
|
|
4474
|
+
function ca(e) {
|
|
4475
|
+
const t = `${j(e, "yyyy-MM-dd")}`;
|
|
4476
|
+
return /* @__PURE__ */ y("div", { title: t, children: j(e, "d") });
|
|
4477
|
+
}
|
|
4478
|
+
function la({
|
|
4479
|
+
range: e,
|
|
4480
|
+
pixels: t,
|
|
4481
|
+
setFocusedDay: r = () => {
|
|
4482
|
+
},
|
|
4483
|
+
render: n = sa,
|
|
4484
|
+
onMonthClick: i = () => {
|
|
4485
|
+
}
|
|
4486
|
+
}) {
|
|
4487
|
+
return /* @__PURE__ */ y("div", { className: "timelane-header-months", children: Sr(e).map((a, u) => {
|
|
4488
|
+
a < e.start && (a = e.start);
|
|
4489
|
+
let c = Tn(a);
|
|
4490
|
+
c > e.end && (c = e.end);
|
|
4491
|
+
const s = q(c, a) + 1;
|
|
4492
|
+
return /* @__PURE__ */ y(
|
|
4493
|
+
"div",
|
|
4494
|
+
{
|
|
4495
|
+
className: "timelane-header-month-label",
|
|
4496
|
+
style: {
|
|
4497
|
+
width: `${t.pixelsPerDay * s}px`
|
|
4498
|
+
},
|
|
4499
|
+
onClick: (o) => {
|
|
4500
|
+
i({ firstDay: a, lastDay: c, e: o }), r(a);
|
|
4501
|
+
},
|
|
4502
|
+
children: n(a, c)
|
|
4503
|
+
},
|
|
4504
|
+
u
|
|
4505
|
+
);
|
|
4506
|
+
}) });
|
|
4507
|
+
}
|
|
4508
|
+
function da({
|
|
4509
|
+
range: e,
|
|
4510
|
+
pixels: t,
|
|
4511
|
+
setFocusedDay: r = () => {
|
|
4512
|
+
},
|
|
4513
|
+
render: n = ua,
|
|
4514
|
+
onWeekClick: i = () => {
|
|
4515
|
+
}
|
|
4516
|
+
}) {
|
|
4517
|
+
return /* @__PURE__ */ y("div", { className: "timelane-header-weeks", children: Or(e, { weekStartsOn: 1 }).map((a, u) => {
|
|
4518
|
+
a < e.start && (a = e.start);
|
|
4519
|
+
let c = zt(a) ? a : En(a);
|
|
4520
|
+
c > e.end && (c = e.end);
|
|
4521
|
+
const s = q(c, a) + 1;
|
|
4522
|
+
return /* @__PURE__ */ y(
|
|
4523
|
+
"div",
|
|
4524
|
+
{
|
|
4525
|
+
className: "timelane-header-week-label",
|
|
4526
|
+
style: {
|
|
4527
|
+
width: `${t.pixelsPerDay * s}px`
|
|
4528
|
+
},
|
|
4529
|
+
onClick: (o) => {
|
|
4530
|
+
i({ firstDay: a, lastDay: c, e: o }), r(a);
|
|
4531
|
+
},
|
|
4532
|
+
children: n(a, c)
|
|
4533
|
+
},
|
|
4534
|
+
u
|
|
4535
|
+
);
|
|
4536
|
+
}) });
|
|
4537
|
+
}
|
|
4538
|
+
function fa({
|
|
4539
|
+
range: e,
|
|
4540
|
+
pixels: t,
|
|
4541
|
+
focusedDay: r,
|
|
4542
|
+
setFocusedDay: n = () => {
|
|
4543
|
+
},
|
|
4544
|
+
render: i = ca,
|
|
4545
|
+
onDayClick: a = () => {
|
|
4546
|
+
}
|
|
4547
|
+
}) {
|
|
4548
|
+
return /* @__PURE__ */ y("div", { className: "timelane-header-days", children: Ct(e).map((u, c) => /* @__PURE__ */ y(
|
|
4549
|
+
"div",
|
|
4550
|
+
{
|
|
4551
|
+
className: `timelane-header-day-label ${r && br(r, u) ? "timelane-header-day-label-focused" : ""}`,
|
|
4552
|
+
style: { width: `${t.pixelsPerDay}px` },
|
|
4553
|
+
onClick: (s) => {
|
|
4554
|
+
a({ day: u, e: s }), n(u);
|
|
4555
|
+
},
|
|
4556
|
+
children: i(u)
|
|
4557
|
+
},
|
|
4558
|
+
c
|
|
4559
|
+
)) });
|
|
4560
|
+
}
|
|
4561
|
+
function ha({
|
|
4562
|
+
focusedDay: e,
|
|
4563
|
+
setFocusedDay: t = () => {
|
|
4564
|
+
},
|
|
4565
|
+
renderMonthHeader: r,
|
|
4566
|
+
renderWeekHeader: n,
|
|
4567
|
+
renderDayHeader: i,
|
|
4568
|
+
onMonthClick: a,
|
|
4569
|
+
onDayClick: u,
|
|
4570
|
+
onWeekClick: c
|
|
4571
|
+
}) {
|
|
4572
|
+
const { settings: s } = pe();
|
|
4573
|
+
return /* @__PURE__ */ y(H.Header, { children: /* @__PURE__ */ Q("div", { className: "timelane-header", children: [
|
|
4574
|
+
s.showMonths && /* @__PURE__ */ y(
|
|
4575
|
+
la,
|
|
4576
|
+
{
|
|
4577
|
+
range: s,
|
|
4578
|
+
pixels: s,
|
|
4579
|
+
setFocusedDay: t,
|
|
4580
|
+
render: r,
|
|
4581
|
+
onMonthClick: a
|
|
4582
|
+
}
|
|
4583
|
+
),
|
|
4584
|
+
s.showWeeks && /* @__PURE__ */ y(
|
|
4585
|
+
da,
|
|
4586
|
+
{
|
|
4587
|
+
range: s,
|
|
4588
|
+
pixels: s,
|
|
4589
|
+
setFocusedDay: t,
|
|
4590
|
+
render: n,
|
|
4591
|
+
onWeekClick: c
|
|
4592
|
+
}
|
|
4593
|
+
),
|
|
4594
|
+
s.showDays && /* @__PURE__ */ y(
|
|
4595
|
+
fa,
|
|
4596
|
+
{
|
|
4597
|
+
range: s,
|
|
4598
|
+
pixels: s,
|
|
4599
|
+
focusedDay: e,
|
|
4600
|
+
setFocusedDay: t,
|
|
4601
|
+
render: i,
|
|
4602
|
+
onDayClick: u
|
|
4603
|
+
}
|
|
4604
|
+
)
|
|
4605
|
+
] }) });
|
|
4606
|
+
}
|
|
4607
|
+
function $({ children: e }) {
|
|
4608
|
+
return /* @__PURE__ */ y("div", { className: "timelane", children: /* @__PURE__ */ y(H, { children: e }) });
|
|
4609
|
+
}
|
|
4610
|
+
$.Container = $;
|
|
4611
|
+
$.Header = ha;
|
|
4612
|
+
$.Body = oa;
|
|
4613
|
+
$.Background = An;
|
|
4614
|
+
$.Aside = lr;
|
|
4615
|
+
$.Lane = ra;
|
|
4616
|
+
$.Layout = H;
|
|
4617
|
+
const ya = ({
|
|
4618
|
+
settings: e,
|
|
4619
|
+
children: t
|
|
4620
|
+
}) => {
|
|
4621
|
+
const [r, n] = V(e);
|
|
4622
|
+
return re(() => {
|
|
4623
|
+
n((i) => ({ ...i, _settings: e }));
|
|
4624
|
+
}, [e]), /* @__PURE__ */ y(Nt.Provider, { value: { settings: r, setSettings: n }, children: t });
|
|
4625
|
+
}, va = () => {
|
|
4626
|
+
const { settings: e } = pe();
|
|
4627
|
+
function t(a) {
|
|
4628
|
+
a instanceof Object ? (a.horz !== void 0 && r(a.horz), a.vert !== void 0 && n(a.vert)) : i(a);
|
|
4629
|
+
}
|
|
4630
|
+
function r(a) {
|
|
4631
|
+
window.requestAnimationFrame(() => {
|
|
4632
|
+
const u = document.getElementById(
|
|
4633
|
+
"timelane-background-date-anchor"
|
|
4634
|
+
);
|
|
4635
|
+
if (u) {
|
|
4636
|
+
const c = $e(a, e.start, e);
|
|
4637
|
+
u.style.setProperty("left", `${c}px`), u.scrollIntoView({
|
|
4638
|
+
block: "nearest",
|
|
4639
|
+
inline: "center",
|
|
4640
|
+
behavior: "smooth"
|
|
4641
|
+
});
|
|
4642
|
+
}
|
|
4643
|
+
});
|
|
4644
|
+
}
|
|
4645
|
+
function n(a) {
|
|
4646
|
+
window.requestAnimationFrame(() => {
|
|
4647
|
+
const u = document.getElementById(
|
|
4648
|
+
`timelane-swimlane-${a}`
|
|
4649
|
+
);
|
|
4650
|
+
u && u.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
4651
|
+
});
|
|
4652
|
+
}
|
|
4653
|
+
function i(a) {
|
|
4654
|
+
window.requestAnimationFrame(() => {
|
|
4655
|
+
const u = document.getElementById(
|
|
4656
|
+
`timelane-item-${a}`
|
|
4657
|
+
);
|
|
4658
|
+
u && u.scrollIntoView({
|
|
4659
|
+
block: "center",
|
|
4660
|
+
inline: "center",
|
|
4661
|
+
behavior: "smooth"
|
|
4662
|
+
});
|
|
4663
|
+
});
|
|
4664
|
+
}
|
|
4665
|
+
return { scrollTo: t, scrollToDate: r, scrollToItem: i, scrollToLane: n };
|
|
4666
|
+
};
|
|
4667
|
+
export {
|
|
4668
|
+
ra as CoreSwimlane,
|
|
4669
|
+
fa as DaysHeader,
|
|
4670
|
+
la as MonthsHeader,
|
|
4671
|
+
$ as Timelane,
|
|
4672
|
+
lr as TimelaneAside,
|
|
4673
|
+
An as TimelaneBackground,
|
|
4674
|
+
oa as TimelaneBody,
|
|
4675
|
+
ha as TimelaneHeader,
|
|
4676
|
+
H as TimelaneLayout,
|
|
4677
|
+
ya as TimelaneSettingsProvider,
|
|
4678
|
+
da as WeeksHeader,
|
|
4679
|
+
$e as dateToPixel,
|
|
4680
|
+
ue as doOverlap,
|
|
4681
|
+
Li as getAvailableSpace,
|
|
4682
|
+
Ri as getDropPreviewRectangle,
|
|
4683
|
+
Ye as getDropTargetDimensions,
|
|
4684
|
+
Pn as getDropTargetHeight,
|
|
4685
|
+
Rn as getDropTargetWidth,
|
|
4686
|
+
te as getGrabPosition,
|
|
4687
|
+
Ht as getItemDimensions,
|
|
4688
|
+
Nn as getItemPosition,
|
|
4689
|
+
Fe as getItemRectangle,
|
|
4690
|
+
_i as getOverlap,
|
|
4691
|
+
It as getUpdatedItem,
|
|
4692
|
+
Pt as isCoreItem,
|
|
4693
|
+
Wi as isWithinTargetDimensions,
|
|
4694
|
+
Ci as itemsDoOverlap,
|
|
4695
|
+
kn as offsetToPixel,
|
|
4696
|
+
ca as renderDayHeader,
|
|
4697
|
+
sa as renderMonthHeader,
|
|
4698
|
+
ua as renderWeekHeader,
|
|
4699
|
+
va as useScroll,
|
|
4700
|
+
pe as useTimelaneContext
|
|
4701
|
+
};
|