@norskvideo/norsk-studio-source-switcher 1.9.0-2025-01-27-b21c8c91

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/client/info.js ADDED
@@ -0,0 +1,3339 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __esm = (fn, res) => function __init() {
8
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
+ };
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __export = (target, all) => {
14
+ for (var name in all)
15
+ __defProp(target, name, { get: all[name], enumerable: true });
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (let key of __getOwnPropNames(from))
20
+ if (!__hasOwnProp.call(to, key) && key !== except)
21
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
+ }
23
+ return to;
24
+ };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
+ mod
32
+ ));
33
+
34
+ // external-global-plugin:react
35
+ var require_react = __commonJS({
36
+ "external-global-plugin:react"(exports, module) {
37
+ module.exports = window.ReactExports;
38
+ }
39
+ });
40
+
41
+ // external-global-plugin:react/jsx-runtime
42
+ var require_jsx_runtime = __commonJS({
43
+ "external-global-plugin:react/jsx-runtime"(exports, module) {
44
+ module.exports = window.ReactJsx;
45
+ }
46
+ });
47
+
48
+ // ../../node_modules/@norskvideo/norsk-studio/lib/shared/shared-views.js
49
+ var require_shared_views = __commonJS({
50
+ "../../node_modules/@norskvideo/norsk-studio/lib/shared/shared-views.js"(exports) {
51
+ "use strict";
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.GlobalIceServerView = GlobalIceServerView;
54
+ exports.EzDrmConfigView = EzDrmConfigView;
55
+ exports.AxinomConfigView = AxinomConfigView;
56
+ var jsx_runtime_1 = require_jsx_runtime();
57
+ function GlobalIceServerView(i) {
58
+ return (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-flow-row-dense grid-cols-3 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "URL" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: i.url }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Reported URL" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: i.reportedUrl ?? "" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Username" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: i.username ?? "" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Password" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: i.credential ?? "" })] });
59
+ }
60
+ function EzDrmConfigView(i) {
61
+ return (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-flow-row-dense grid-cols-2 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-span-2 node-editor-helper-text", children: "For Encryption (required)" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Token" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: i.token?.trim() ? "Yes" : "No" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2 node-editor-helper-text", children: "For Local Preview (optional)" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "pX" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: i.pX?.trim() ? "Yes" : "No" })] });
62
+ }
63
+ function AxinomConfigView(i) {
64
+ return (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-flow-row-dense grid-cols-2 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-span-2 node-editor-helper-text", children: "For Encryption (required)" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Tenant ID" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: i.tenantId?.trim() ? "Yes" : "No" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Management Key" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: i.managementKey?.trim() ? "Yes" : "No" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2 node-editor-helper-text", children: "For Local Preview (optional)" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Communication ID" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: i.comKeyId?.trim() ? "Yes" : "No" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Communication Key" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: i.comKey?.trim() ? "Yes" : "No" })] });
65
+ }
66
+ }
67
+ });
68
+
69
+ // ../../node_modules/@norskvideo/norsk-studio/lib/shared/config.js
70
+ var require_config = __commonJS({
71
+ "../../node_modules/@norskvideo/norsk-studio/lib/shared/config.js"(exports) {
72
+ "use strict";
73
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
74
+ if (k2 === void 0)
75
+ k2 = k;
76
+ var desc = Object.getOwnPropertyDescriptor(m, k);
77
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
78
+ desc = { enumerable: true, get: function() {
79
+ return m[k];
80
+ } };
81
+ }
82
+ Object.defineProperty(o, k2, desc);
83
+ } : function(o, m, k, k2) {
84
+ if (k2 === void 0)
85
+ k2 = k;
86
+ o[k2] = m[k];
87
+ });
88
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
89
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
90
+ } : function(o, v) {
91
+ o["default"] = v;
92
+ });
93
+ var __importStar = exports && exports.__importStar || function(mod) {
94
+ if (mod && mod.__esModule)
95
+ return mod;
96
+ var result = {};
97
+ if (mod != null) {
98
+ for (var k in mod)
99
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
100
+ __createBinding(result, mod, k);
101
+ }
102
+ __setModuleDefault(result, mod);
103
+ return result;
104
+ };
105
+ var __importDefault = exports && exports.__importDefault || function(mod) {
106
+ return mod && mod.__esModule ? mod : { "default": mod };
107
+ };
108
+ Object.defineProperty(exports, "__esModule", { value: true });
109
+ exports.GlobalIceServers = GlobalIceServers2;
110
+ exports.GlobalEzDrmConfig = GlobalEzDrmConfig;
111
+ exports.GlobalAxinomConfig = GlobalAxinomConfig;
112
+ exports.contractHardwareAcceleration = contractHardwareAcceleration;
113
+ exports.HardwareSelection = HardwareSelection2;
114
+ exports.RootDataDir = RootDataDir;
115
+ var react_1 = __importDefault(require_react());
116
+ function GlobalIceServers2(f) {
117
+ const GlobalIceServerView = react_1.default.lazy(async () => {
118
+ const views = await Promise.resolve().then(() => __importStar(require_shared_views()));
119
+ return { default: views.GlobalIceServerView };
120
+ });
121
+ const { validation: { Z } } = f;
122
+ return {
123
+ id: "ice-servers",
124
+ form: {
125
+ help: "ICE Servers to use for either STUN or TURN",
126
+ hint: {
127
+ envOverride: true,
128
+ type: "form-list",
129
+ form: {
130
+ url: {
131
+ help: "URL of the STUN/TURN server (with turn:/stun: prefix) as accessed by Norsk Studio",
132
+ hint: {
133
+ type: "text",
134
+ validation: f.validation.IceServer
135
+ }
136
+ },
137
+ reportedUrl: {
138
+ help: "Optional URL of the STUN/TURN server as accessed by the client (if different to the above)",
139
+ hint: {
140
+ type: "text",
141
+ validation: Z.union([Z.literal(""), f.validation.IceServer]).optional(),
142
+ optional: true
143
+ }
144
+ },
145
+ username: {
146
+ help: "Optional username",
147
+ hint: {
148
+ type: "text",
149
+ validation: Z.string()
150
+ }
151
+ },
152
+ credential: {
153
+ help: "Optional password",
154
+ hint: {
155
+ type: "text",
156
+ validation: Z.string()
157
+ }
158
+ }
159
+ },
160
+ view: GlobalIceServerView,
161
+ defaultValue: [{
162
+ url: "stun:stun.l.google.com:19302"
163
+ }]
164
+ }
165
+ }
166
+ };
167
+ }
168
+ function GlobalEzDrmConfig(_f) {
169
+ const EzDrmConfigView = react_1.default.lazy(async () => {
170
+ const views = await Promise.resolve().then(() => __importStar(require_shared_views()));
171
+ return { default: views.EzDrmConfigView };
172
+ });
173
+ return {
174
+ id: "ezdrm-config",
175
+ form: {
176
+ help: "Configuration for EZDRM",
177
+ hint: {
178
+ envOverride: true,
179
+ type: "form-item",
180
+ optional: true,
181
+ form: {
182
+ token: {
183
+ help: "Token for EZDRM",
184
+ hint: {
185
+ envOverride: true,
186
+ type: "text"
187
+ }
188
+ },
189
+ pX: {
190
+ help: "The last six digits of your Widevine Profile ID",
191
+ hint: {
192
+ envOverride: true,
193
+ defaultValue: "",
194
+ type: "text"
195
+ }
196
+ }
197
+ },
198
+ view: EzDrmConfigView
199
+ }
200
+ }
201
+ };
202
+ }
203
+ function GlobalAxinomConfig(_f) {
204
+ const AxinomConfigView = react_1.default.lazy(async () => {
205
+ const views = await Promise.resolve().then(() => __importStar(require_shared_views()));
206
+ return { default: views.AxinomConfigView };
207
+ });
208
+ return {
209
+ id: "axinom-config",
210
+ form: {
211
+ help: "Configuration for Axinom DRM",
212
+ hint: {
213
+ envOverride: true,
214
+ type: "form-item",
215
+ form: {
216
+ tenantId: {
217
+ help: "Tenant ID from your Axinom DRM account",
218
+ hint: {
219
+ envOverride: true,
220
+ type: "text"
221
+ }
222
+ },
223
+ managementKey: {
224
+ help: "Management Key from your Axinom DRM account",
225
+ hint: {
226
+ envOverride: true,
227
+ type: "text"
228
+ }
229
+ },
230
+ comKeyId: {
231
+ help: "Communication Key ID from your Axinom DRM account",
232
+ hint: {
233
+ envOverride: true,
234
+ defaultValue: "",
235
+ type: "text"
236
+ }
237
+ },
238
+ comKey: {
239
+ help: "Communication Key from your Axinom DRM account",
240
+ hint: {
241
+ envOverride: true,
242
+ defaultValue: "",
243
+ type: "text"
244
+ }
245
+ }
246
+ },
247
+ view: AxinomConfigView
248
+ }
249
+ }
250
+ };
251
+ }
252
+ function contractHardwareAcceleration(value, accepted) {
253
+ if (!value)
254
+ return void 0;
255
+ const expanded = accepted;
256
+ if (expanded.includes(value)) {
257
+ return value;
258
+ }
259
+ return void 0;
260
+ }
261
+ function HardwareSelection2() {
262
+ return {
263
+ id: "hardware-acceleration",
264
+ form: {
265
+ help: "Where available, use the specified hardware for encodes/compose operations",
266
+ hint: {
267
+ type: "select",
268
+ optional: true,
269
+ options: [
270
+ { value: "ma35d", display: "MA35D" },
271
+ { value: "quadra", display: "Quadra" },
272
+ { value: "nvidia", display: "Nvidia" },
273
+ { value: "logan", display: "Logan" }
274
+ ]
275
+ }
276
+ }
277
+ };
278
+ }
279
+ function RootDataDir() {
280
+ return {
281
+ id: "root-data-dir",
282
+ form: {
283
+ help: "The root data dir to use against relative file paths in components/etc",
284
+ hint: {
285
+ type: "text",
286
+ defaultValue: "/"
287
+ }
288
+ }
289
+ };
290
+ }
291
+ }
292
+ });
293
+
294
+ // build/inline-view.js
295
+ var inline_view_exports = {};
296
+ __export(inline_view_exports, {
297
+ default: () => inline_view_default
298
+ });
299
+ function InlineView({ state }) {
300
+ return (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [(0, import_jsx_runtime.jsx)("h5", { children: "Sources" }), (0, import_jsx_runtime.jsx)("ul", { children: state.knownSources.map((s, i) => state.activeSource.id == s.id && state.activeSource.key == s.key ? (0, import_jsx_runtime.jsxs)("li", { className: activeClasses, children: [s.key ?? s.id, " <--"] }, i) : state.availableSources.find((a) => a.id == s.id && a.key == s.key) ? (0, import_jsx_runtime.jsxs)("li", { className: availableClasses, children: [s.key ?? s.id, " (available)"] }, i) : (0, import_jsx_runtime.jsxs)("li", { className: inactiveClasses, children: [s.key ?? s.id, " (inactive)"] }, i)) })] });
301
+ }
302
+ var import_jsx_runtime, activeClasses, availableClasses, inactiveClasses, inline_view_default;
303
+ var init_inline_view = __esm({
304
+ "build/inline-view.js"() {
305
+ "use strict";
306
+ import_jsx_runtime = __toESM(require_jsx_runtime());
307
+ activeClasses = "active text-green-500 dark:text-green-300";
308
+ availableClasses = "available text-green-500 dark:text-green-300";
309
+ inactiveClasses = "inactive text-orange-500 dark:text-orange-300";
310
+ inline_view_default = InlineView;
311
+ }
312
+ });
313
+
314
+ // external-global-plugin:@norskvideo/webrtc-client
315
+ var require_webrtc_client = __commonJS({
316
+ "external-global-plugin:@norskvideo/webrtc-client"(exports, module) {
317
+ module.exports = window.WebRtcClient;
318
+ }
319
+ });
320
+
321
+ // build/summary-view.js
322
+ var summary_view_exports = {};
323
+ __export(summary_view_exports, {
324
+ default: () => summary_view_default
325
+ });
326
+ function SummaryView({ state, config, sendCommand }) {
327
+ const [previewSource, setPreviewSource] = (0, import_react.useState)(void 0);
328
+ const [activePlayerSource, setActivePlayerSource] = (0, import_react.useState)(void 0);
329
+ const [initialLoad, setInitialLoad] = (0, import_react.useState)(true);
330
+ (0, import_react.useEffect)(() => {
331
+ if (previewSource !== activePlayerSource || initialLoad) {
332
+ const player = previewSource == void 0 ? state.previewPlayerUrl : state.players.find((p) => p.source.id == previewSource.id && p.source.key == previewSource.key)?.player;
333
+ if (!player)
334
+ return;
335
+ if (currentClient) {
336
+ currentClient.videoElements.forEach((e) => {
337
+ e.remove();
338
+ });
339
+ }
340
+ currentClient = new import_webrtc_client.WhepClient({ url: player, container: document.getElementById(`${config.id}-preview`) ?? void 0 });
341
+ void currentClient.start();
342
+ setActivePlayerSource(previewSource);
343
+ setInitialLoad(false);
344
+ }
345
+ }, [
346
+ previewSource,
347
+ activePlayerSource,
348
+ initialLoad,
349
+ state.players
350
+ ]);
351
+ return (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [(0, import_jsx_runtime2.jsx)("h5", { children: "Sources" }), (0, import_jsx_runtime2.jsx)("ul", { children: state.knownSources.map((s, i) => state.activeSource.id == s.id && state.activeSource.key == s.key ? (0, import_jsx_runtime2.jsxs)("li", { className: activeClasses2, children: [s.key ?? s.id, " <--"] }, i) : state.availableSources.find((a) => s.id == a.id && s.key == a.key) ? (0, import_jsx_runtime2.jsxs)("li", { className: availableClasses2, children: [s.key ?? s.id, " (available)"] }, i) : (0, import_jsx_runtime2.jsxs)("li", { className: inactiveClasses2, children: [s.key ?? s.id, " (inactive)"] }, i)) }), config.enablePreviews ? (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [(0, import_jsx_runtime2.jsx)("h4", { children: previewSource ? previewSource.key ?? previewSource.id : "Preview" }), (0, import_jsx_runtime2.jsx)("div", { id: `${config.id}-preview` })] }) : null, (0, import_jsx_runtime2.jsx)("label", { htmlFor: "select-preview", className: "mt-2", children: "Source" }), (0, import_jsx_runtime2.jsxs)("select", { id: "select-preview", className: "mt-2 node-editor-select-input", onChange: (e) => {
352
+ setPreviewSource(JSON.parse(e.currentTarget.value));
353
+ }, children: [(0, import_jsx_runtime2.jsx)("option", { selected: previewSource === void 0, children: "---" }), state.availableSources.map((s, i) => (0, import_jsx_runtime2.jsx)("option", { selected: previewSource == s, value: JSON.stringify(s), children: s.key ?? s.id }, i))] }), previewSource ? (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "mt-2 mb-2 text-white w-full justify-center bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800", onClick: (e) => {
354
+ e.preventDefault();
355
+ sendCommand({ type: "select-source", source: previewSource, overlays: [] });
356
+ setPreviewSource(void 0);
357
+ }, children: "Make Active" }) : (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, {})] });
358
+ }
359
+ var import_jsx_runtime2, import_react, import_webrtc_client, activeClasses2, availableClasses2, inactiveClasses2, currentClient, summary_view_default;
360
+ var init_summary_view = __esm({
361
+ "build/summary-view.js"() {
362
+ "use strict";
363
+ import_jsx_runtime2 = __toESM(require_jsx_runtime());
364
+ import_react = __toESM(require_react());
365
+ import_webrtc_client = __toESM(require_webrtc_client());
366
+ activeClasses2 = "active text-green-500 dark:text-green-300";
367
+ availableClasses2 = "available text-green-500 dark:text-green-300";
368
+ inactiveClasses2 = "inactive text-orange-500 dark:text-orange-300";
369
+ currentClient = void 0;
370
+ summary_view_default = SummaryView;
371
+ }
372
+ });
373
+
374
+ // ../../node_modules/interactjs/dist/interact.min.js
375
+ var require_interact_min = __commonJS({
376
+ "../../node_modules/interactjs/dist/interact.min.js"(exports, module) {
377
+ !function(t, e) {
378
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).interact = e();
379
+ }(exports, function() {
380
+ "use strict";
381
+ function t(t2, e2) {
382
+ var n2 = Object.keys(t2);
383
+ if (Object.getOwnPropertySymbols) {
384
+ var r2 = Object.getOwnPropertySymbols(t2);
385
+ e2 && (r2 = r2.filter(function(e3) {
386
+ return Object.getOwnPropertyDescriptor(t2, e3).enumerable;
387
+ })), n2.push.apply(n2, r2);
388
+ }
389
+ return n2;
390
+ }
391
+ function e(e2) {
392
+ for (var n2 = 1; n2 < arguments.length; n2++) {
393
+ var r2 = null != arguments[n2] ? arguments[n2] : {};
394
+ n2 % 2 ? t(Object(r2), true).forEach(function(t2) {
395
+ a(e2, t2, r2[t2]);
396
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(r2)) : t(Object(r2)).forEach(function(t2) {
397
+ Object.defineProperty(e2, t2, Object.getOwnPropertyDescriptor(r2, t2));
398
+ });
399
+ }
400
+ return e2;
401
+ }
402
+ function n(t2) {
403
+ return n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t3) {
404
+ return typeof t3;
405
+ } : function(t3) {
406
+ return t3 && "function" == typeof Symbol && t3.constructor === Symbol && t3 !== Symbol.prototype ? "symbol" : typeof t3;
407
+ }, n(t2);
408
+ }
409
+ function r(t2, e2) {
410
+ if (!(t2 instanceof e2))
411
+ throw new TypeError("Cannot call a class as a function");
412
+ }
413
+ function i(t2, e2) {
414
+ for (var n2 = 0; n2 < e2.length; n2++) {
415
+ var r2 = e2[n2];
416
+ r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(t2, d(r2.key), r2);
417
+ }
418
+ }
419
+ function o(t2, e2, n2) {
420
+ return e2 && i(t2.prototype, e2), n2 && i(t2, n2), Object.defineProperty(t2, "prototype", { writable: false }), t2;
421
+ }
422
+ function a(t2, e2, n2) {
423
+ return (e2 = d(e2)) in t2 ? Object.defineProperty(t2, e2, { value: n2, enumerable: true, configurable: true, writable: true }) : t2[e2] = n2, t2;
424
+ }
425
+ function s(t2, e2) {
426
+ if ("function" != typeof e2 && null !== e2)
427
+ throw new TypeError("Super expression must either be null or a function");
428
+ t2.prototype = Object.create(e2 && e2.prototype, { constructor: { value: t2, writable: true, configurable: true } }), Object.defineProperty(t2, "prototype", { writable: false }), e2 && l(t2, e2);
429
+ }
430
+ function c(t2) {
431
+ return c = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
432
+ return t3.__proto__ || Object.getPrototypeOf(t3);
433
+ }, c(t2);
434
+ }
435
+ function l(t2, e2) {
436
+ return l = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
437
+ return t3.__proto__ = e3, t3;
438
+ }, l(t2, e2);
439
+ }
440
+ function u(t2) {
441
+ if (void 0 === t2)
442
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
443
+ return t2;
444
+ }
445
+ function p(t2) {
446
+ var e2 = function() {
447
+ if ("undefined" == typeof Reflect || !Reflect.construct)
448
+ return false;
449
+ if (Reflect.construct.sham)
450
+ return false;
451
+ if ("function" == typeof Proxy)
452
+ return true;
453
+ try {
454
+ return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
455
+ })), true;
456
+ } catch (t3) {
457
+ return false;
458
+ }
459
+ }();
460
+ return function() {
461
+ var n2, r2 = c(t2);
462
+ if (e2) {
463
+ var i2 = c(this).constructor;
464
+ n2 = Reflect.construct(r2, arguments, i2);
465
+ } else
466
+ n2 = r2.apply(this, arguments);
467
+ return function(t3, e3) {
468
+ if (e3 && ("object" == typeof e3 || "function" == typeof e3))
469
+ return e3;
470
+ if (void 0 !== e3)
471
+ throw new TypeError("Derived constructors may only return object or undefined");
472
+ return u(t3);
473
+ }(this, n2);
474
+ };
475
+ }
476
+ function f() {
477
+ return f = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(t2, e2, n2) {
478
+ var r2 = function(t3, e3) {
479
+ for (; !Object.prototype.hasOwnProperty.call(t3, e3) && null !== (t3 = c(t3)); )
480
+ ;
481
+ return t3;
482
+ }(t2, e2);
483
+ if (r2) {
484
+ var i2 = Object.getOwnPropertyDescriptor(r2, e2);
485
+ return i2.get ? i2.get.call(arguments.length < 3 ? t2 : n2) : i2.value;
486
+ }
487
+ }, f.apply(this, arguments);
488
+ }
489
+ function d(t2) {
490
+ var e2 = function(t3, e3) {
491
+ if ("object" != typeof t3 || null === t3)
492
+ return t3;
493
+ var n2 = t3[Symbol.toPrimitive];
494
+ if (void 0 !== n2) {
495
+ var r2 = n2.call(t3, e3 || "default");
496
+ if ("object" != typeof r2)
497
+ return r2;
498
+ throw new TypeError("@@toPrimitive must return a primitive value.");
499
+ }
500
+ return ("string" === e3 ? String : Number)(t3);
501
+ }(t2, "string");
502
+ return "symbol" == typeof e2 ? e2 : e2 + "";
503
+ }
504
+ var h = function(t2) {
505
+ return !(!t2 || !t2.Window) && t2 instanceof t2.Window;
506
+ }, v = void 0, g = void 0;
507
+ function m(t2) {
508
+ v = t2;
509
+ var e2 = t2.document.createTextNode("");
510
+ e2.ownerDocument !== t2.document && "function" == typeof t2.wrap && t2.wrap(e2) === e2 && (t2 = t2.wrap(t2)), g = t2;
511
+ }
512
+ function y(t2) {
513
+ return h(t2) ? t2 : (t2.ownerDocument || t2).defaultView || g.window;
514
+ }
515
+ "undefined" != typeof window && window && m(window);
516
+ var b = function(t2) {
517
+ return !!t2 && "object" === n(t2);
518
+ }, x = function(t2) {
519
+ return "function" == typeof t2;
520
+ }, w = { window: function(t2) {
521
+ return t2 === g || h(t2);
522
+ }, docFrag: function(t2) {
523
+ return b(t2) && 11 === t2.nodeType;
524
+ }, object: b, func: x, number: function(t2) {
525
+ return "number" == typeof t2;
526
+ }, bool: function(t2) {
527
+ return "boolean" == typeof t2;
528
+ }, string: function(t2) {
529
+ return "string" == typeof t2;
530
+ }, element: function(t2) {
531
+ if (!t2 || "object" !== n(t2))
532
+ return false;
533
+ var e2 = y(t2) || g;
534
+ return /object|function/.test("undefined" == typeof Element ? "undefined" : n(Element)) ? t2 instanceof Element || t2 instanceof e2.Element : 1 === t2.nodeType && "string" == typeof t2.nodeName;
535
+ }, plainObject: function(t2) {
536
+ return b(t2) && !!t2.constructor && /function Object\b/.test(t2.constructor.toString());
537
+ }, array: function(t2) {
538
+ return b(t2) && void 0 !== t2.length && x(t2.splice);
539
+ } };
540
+ function E(t2) {
541
+ var e2 = t2.interaction;
542
+ if ("drag" === e2.prepared.name) {
543
+ var n2 = e2.prepared.axis;
544
+ "x" === n2 ? (e2.coords.cur.page.y = e2.coords.start.page.y, e2.coords.cur.client.y = e2.coords.start.client.y, e2.coords.velocity.client.y = 0, e2.coords.velocity.page.y = 0) : "y" === n2 && (e2.coords.cur.page.x = e2.coords.start.page.x, e2.coords.cur.client.x = e2.coords.start.client.x, e2.coords.velocity.client.x = 0, e2.coords.velocity.page.x = 0);
545
+ }
546
+ }
547
+ function T(t2) {
548
+ var e2 = t2.iEvent, n2 = t2.interaction;
549
+ if ("drag" === n2.prepared.name) {
550
+ var r2 = n2.prepared.axis;
551
+ if ("x" === r2 || "y" === r2) {
552
+ var i2 = "x" === r2 ? "y" : "x";
553
+ e2.page[i2] = n2.coords.start.page[i2], e2.client[i2] = n2.coords.start.client[i2], e2.delta[i2] = 0;
554
+ }
555
+ }
556
+ }
557
+ var S = { id: "actions/drag", install: function(t2) {
558
+ var e2 = t2.actions, n2 = t2.Interactable, r2 = t2.defaults;
559
+ n2.prototype.draggable = S.draggable, e2.map.drag = S, e2.methodDict.drag = "draggable", r2.actions.drag = S.defaults;
560
+ }, listeners: { "interactions:before-action-move": E, "interactions:action-resume": E, "interactions:action-move": T, "auto-start:check": function(t2) {
561
+ var e2 = t2.interaction, n2 = t2.interactable, r2 = t2.buttons, i2 = n2.options.drag;
562
+ if (i2 && i2.enabled && (!e2.pointerIsDown || !/mouse|pointer/.test(e2.pointerType) || 0 != (r2 & n2.options.drag.mouseButtons)))
563
+ return t2.action = { name: "drag", axis: "start" === i2.lockAxis ? i2.startAxis : i2.lockAxis }, false;
564
+ } }, draggable: function(t2) {
565
+ return w.object(t2) ? (this.options.drag.enabled = false !== t2.enabled, this.setPerAction("drag", t2), this.setOnEvents("drag", t2), /^(xy|x|y|start)$/.test(t2.lockAxis) && (this.options.drag.lockAxis = t2.lockAxis), /^(xy|x|y)$/.test(t2.startAxis) && (this.options.drag.startAxis = t2.startAxis), this) : w.bool(t2) ? (this.options.drag.enabled = t2, this) : this.options.drag;
566
+ }, beforeMove: E, move: T, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
567
+ return "move";
568
+ }, filterEventType: function(t2) {
569
+ return 0 === t2.search("drag");
570
+ } }, _ = S, P = { init: function(t2) {
571
+ var e2 = t2;
572
+ P.document = e2.document, P.DocumentFragment = e2.DocumentFragment || O, P.SVGElement = e2.SVGElement || O, P.SVGSVGElement = e2.SVGSVGElement || O, P.SVGElementInstance = e2.SVGElementInstance || O, P.Element = e2.Element || O, P.HTMLElement = e2.HTMLElement || P.Element, P.Event = e2.Event, P.Touch = e2.Touch || O, P.PointerEvent = e2.PointerEvent || e2.MSPointerEvent;
573
+ }, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
574
+ function O() {
575
+ }
576
+ var k = P;
577
+ var D = { init: function(t2) {
578
+ var e2 = k.Element, n2 = t2.navigator || {};
579
+ D.supportsTouch = "ontouchstart" in t2 || w.func(t2.DocumentTouch) && k.document instanceof t2.DocumentTouch, D.supportsPointerEvent = false !== n2.pointerEnabled && !!k.PointerEvent, D.isIOS = /iP(hone|od|ad)/.test(n2.platform), D.isIOS7 = /iP(hone|od|ad)/.test(n2.platform) && /OS 7[^\d]/.test(n2.appVersion), D.isIe9 = /MSIE 9/.test(n2.userAgent), D.isOperaMobile = "Opera" === n2.appName && D.supportsTouch && /Presto/.test(n2.userAgent), D.prefixedMatchesSelector = "matches" in e2.prototype ? "matches" : "webkitMatchesSelector" in e2.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e2.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e2.prototype ? "oMatchesSelector" : "msMatchesSelector", D.pEventTypes = D.supportsPointerEvent ? k.PointerEvent === t2.MSPointerEvent ? { up: "MSPointerUp", down: "MSPointerDown", over: "mouseover", out: "mouseout", move: "MSPointerMove", cancel: "MSPointerCancel" } : { up: "pointerup", down: "pointerdown", over: "pointerover", out: "pointerout", move: "pointermove", cancel: "pointercancel" } : null, D.wheelEvent = k.document && "onmousewheel" in k.document ? "mousewheel" : "wheel";
580
+ }, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null };
581
+ var I = D;
582
+ function M(t2, e2) {
583
+ if (t2.contains)
584
+ return t2.contains(e2);
585
+ for (; e2; ) {
586
+ if (e2 === t2)
587
+ return true;
588
+ e2 = e2.parentNode;
589
+ }
590
+ return false;
591
+ }
592
+ function z(t2, e2) {
593
+ for (; w.element(t2); ) {
594
+ if (R(t2, e2))
595
+ return t2;
596
+ t2 = A(t2);
597
+ }
598
+ return null;
599
+ }
600
+ function A(t2) {
601
+ var e2 = t2.parentNode;
602
+ if (w.docFrag(e2)) {
603
+ for (; (e2 = e2.host) && w.docFrag(e2); )
604
+ ;
605
+ return e2;
606
+ }
607
+ return e2;
608
+ }
609
+ function R(t2, e2) {
610
+ return g !== v && (e2 = e2.replace(/\/deep\//g, " ")), t2[I.prefixedMatchesSelector](e2);
611
+ }
612
+ var C = function(t2) {
613
+ return t2.parentNode || t2.host;
614
+ };
615
+ function j(t2, e2) {
616
+ for (var n2, r2 = [], i2 = t2; (n2 = C(i2)) && i2 !== e2 && n2 !== i2.ownerDocument; )
617
+ r2.unshift(i2), i2 = n2;
618
+ return r2;
619
+ }
620
+ function F(t2, e2, n2) {
621
+ for (; w.element(t2); ) {
622
+ if (R(t2, e2))
623
+ return true;
624
+ if ((t2 = A(t2)) === n2)
625
+ return R(t2, e2);
626
+ }
627
+ return false;
628
+ }
629
+ function X(t2) {
630
+ return t2.correspondingUseElement || t2;
631
+ }
632
+ function Y(t2) {
633
+ var e2 = t2 instanceof k.SVGElement ? t2.getBoundingClientRect() : t2.getClientRects()[0];
634
+ return e2 && { left: e2.left, right: e2.right, top: e2.top, bottom: e2.bottom, width: e2.width || e2.right - e2.left, height: e2.height || e2.bottom - e2.top };
635
+ }
636
+ function L(t2) {
637
+ var e2, n2 = Y(t2);
638
+ if (!I.isIOS7 && n2) {
639
+ var r2 = { x: (e2 = (e2 = y(t2)) || g).scrollX || e2.document.documentElement.scrollLeft, y: e2.scrollY || e2.document.documentElement.scrollTop };
640
+ n2.left += r2.x, n2.right += r2.x, n2.top += r2.y, n2.bottom += r2.y;
641
+ }
642
+ return n2;
643
+ }
644
+ function q(t2) {
645
+ for (var e2 = []; t2; )
646
+ e2.push(t2), t2 = A(t2);
647
+ return e2;
648
+ }
649
+ function B(t2) {
650
+ return !!w.string(t2) && (k.document.querySelector(t2), true);
651
+ }
652
+ function V(t2, e2) {
653
+ for (var n2 in e2)
654
+ t2[n2] = e2[n2];
655
+ return t2;
656
+ }
657
+ function W(t2, e2, n2) {
658
+ return "parent" === t2 ? A(n2) : "self" === t2 ? e2.getRect(n2) : z(n2, t2);
659
+ }
660
+ function G(t2, e2, n2, r2) {
661
+ var i2 = t2;
662
+ return w.string(i2) ? i2 = W(i2, e2, n2) : w.func(i2) && (i2 = i2.apply(void 0, r2)), w.element(i2) && (i2 = L(i2)), i2;
663
+ }
664
+ function N(t2) {
665
+ return t2 && { x: "x" in t2 ? t2.x : t2.left, y: "y" in t2 ? t2.y : t2.top };
666
+ }
667
+ function U(t2) {
668
+ return !t2 || "x" in t2 && "y" in t2 || ((t2 = V({}, t2)).x = t2.left || 0, t2.y = t2.top || 0, t2.width = t2.width || (t2.right || 0) - t2.x, t2.height = t2.height || (t2.bottom || 0) - t2.y), t2;
669
+ }
670
+ function H(t2, e2, n2) {
671
+ t2.left && (e2.left += n2.x), t2.right && (e2.right += n2.x), t2.top && (e2.top += n2.y), t2.bottom && (e2.bottom += n2.y), e2.width = e2.right - e2.left, e2.height = e2.bottom - e2.top;
672
+ }
673
+ function K(t2, e2, n2) {
674
+ var r2 = n2 && t2.options[n2];
675
+ return N(G(r2 && r2.origin || t2.options.origin, t2, e2, [t2 && e2])) || { x: 0, y: 0 };
676
+ }
677
+ function $(t2, e2) {
678
+ var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : function(t3) {
679
+ return true;
680
+ }, r2 = arguments.length > 3 ? arguments[3] : void 0;
681
+ if (r2 = r2 || {}, w.string(t2) && -1 !== t2.search(" ") && (t2 = J(t2)), w.array(t2))
682
+ return t2.forEach(function(t3) {
683
+ return $(t3, e2, n2, r2);
684
+ }), r2;
685
+ if (w.object(t2) && (e2 = t2, t2 = ""), w.func(e2) && n2(t2))
686
+ r2[t2] = r2[t2] || [], r2[t2].push(e2);
687
+ else if (w.array(e2))
688
+ for (var i2 = 0, o2 = e2; i2 < o2.length; i2++) {
689
+ var a2 = o2[i2];
690
+ $(t2, a2, n2, r2);
691
+ }
692
+ else if (w.object(e2))
693
+ for (var s2 in e2) {
694
+ $(J(s2).map(function(e3) {
695
+ return "".concat(t2).concat(e3);
696
+ }), e2[s2], n2, r2);
697
+ }
698
+ return r2;
699
+ }
700
+ function J(t2) {
701
+ return t2.trim().split(/ +/);
702
+ }
703
+ var Q = function(t2, e2) {
704
+ return Math.sqrt(t2 * t2 + e2 * e2);
705
+ }, Z = ["webkit", "moz"];
706
+ function tt(t2, e2) {
707
+ t2.__set || (t2.__set = {});
708
+ var n2 = function(n3) {
709
+ if (Z.some(function(t3) {
710
+ return 0 === n3.indexOf(t3);
711
+ }))
712
+ return 1;
713
+ "function" != typeof t2[n3] && "__set" !== n3 && Object.defineProperty(t2, n3, { get: function() {
714
+ return n3 in t2.__set ? t2.__set[n3] : t2.__set[n3] = e2[n3];
715
+ }, set: function(e3) {
716
+ t2.__set[n3] = e3;
717
+ }, configurable: true });
718
+ };
719
+ for (var r2 in e2)
720
+ n2(r2);
721
+ return t2;
722
+ }
723
+ function et(t2, e2) {
724
+ t2.page = t2.page || {}, t2.page.x = e2.page.x, t2.page.y = e2.page.y, t2.client = t2.client || {}, t2.client.x = e2.client.x, t2.client.y = e2.client.y, t2.timeStamp = e2.timeStamp;
725
+ }
726
+ function nt(t2) {
727
+ t2.page.x = 0, t2.page.y = 0, t2.client.x = 0, t2.client.y = 0;
728
+ }
729
+ function rt(t2) {
730
+ return t2 instanceof k.Event || t2 instanceof k.Touch;
731
+ }
732
+ function it(t2, e2, n2) {
733
+ return t2 = t2 || "page", (n2 = n2 || {}).x = e2[t2 + "X"], n2.y = e2[t2 + "Y"], n2;
734
+ }
735
+ function ot(t2, e2) {
736
+ return e2 = e2 || { x: 0, y: 0 }, I.isOperaMobile && rt(t2) ? (it("screen", t2, e2), e2.x += window.scrollX, e2.y += window.scrollY) : it("page", t2, e2), e2;
737
+ }
738
+ function at(t2) {
739
+ return w.number(t2.pointerId) ? t2.pointerId : t2.identifier;
740
+ }
741
+ function st(t2, e2, n2) {
742
+ var r2 = e2.length > 1 ? lt(e2) : e2[0];
743
+ ot(r2, t2.page), function(t3, e3) {
744
+ e3 = e3 || {}, I.isOperaMobile && rt(t3) ? it("screen", t3, e3) : it("client", t3, e3);
745
+ }(r2, t2.client), t2.timeStamp = n2;
746
+ }
747
+ function ct(t2) {
748
+ var e2 = [];
749
+ return w.array(t2) ? (e2[0] = t2[0], e2[1] = t2[1]) : "touchend" === t2.type ? 1 === t2.touches.length ? (e2[0] = t2.touches[0], e2[1] = t2.changedTouches[0]) : 0 === t2.touches.length && (e2[0] = t2.changedTouches[0], e2[1] = t2.changedTouches[1]) : (e2[0] = t2.touches[0], e2[1] = t2.touches[1]), e2;
750
+ }
751
+ function lt(t2) {
752
+ for (var e2 = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, n2 = 0; n2 < t2.length; n2++) {
753
+ var r2 = t2[n2];
754
+ for (var i2 in e2)
755
+ e2[i2] += r2[i2];
756
+ }
757
+ for (var o2 in e2)
758
+ e2[o2] /= t2.length;
759
+ return e2;
760
+ }
761
+ function ut(t2) {
762
+ if (!t2.length)
763
+ return null;
764
+ var e2 = ct(t2), n2 = Math.min(e2[0].pageX, e2[1].pageX), r2 = Math.min(e2[0].pageY, e2[1].pageY), i2 = Math.max(e2[0].pageX, e2[1].pageX), o2 = Math.max(e2[0].pageY, e2[1].pageY);
765
+ return { x: n2, y: r2, left: n2, top: r2, right: i2, bottom: o2, width: i2 - n2, height: o2 - r2 };
766
+ }
767
+ function pt(t2, e2) {
768
+ var n2 = e2 + "X", r2 = e2 + "Y", i2 = ct(t2), o2 = i2[0][n2] - i2[1][n2], a2 = i2[0][r2] - i2[1][r2];
769
+ return Q(o2, a2);
770
+ }
771
+ function ft(t2, e2) {
772
+ var n2 = e2 + "X", r2 = e2 + "Y", i2 = ct(t2), o2 = i2[1][n2] - i2[0][n2], a2 = i2[1][r2] - i2[0][r2];
773
+ return 180 * Math.atan2(a2, o2) / Math.PI;
774
+ }
775
+ function dt(t2) {
776
+ return w.string(t2.pointerType) ? t2.pointerType : w.number(t2.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t2.pointerType] : /touch/.test(t2.type || "") || t2 instanceof k.Touch ? "touch" : "mouse";
777
+ }
778
+ function ht(t2) {
779
+ var e2 = w.func(t2.composedPath) ? t2.composedPath() : t2.path;
780
+ return [X(e2 ? e2[0] : t2.target), X(t2.currentTarget)];
781
+ }
782
+ var vt = function() {
783
+ function t2(e2) {
784
+ r(this, t2), this.immediatePropagationStopped = false, this.propagationStopped = false, this._interaction = e2;
785
+ }
786
+ return o(t2, [{ key: "preventDefault", value: function() {
787
+ } }, { key: "stopPropagation", value: function() {
788
+ this.propagationStopped = true;
789
+ } }, { key: "stopImmediatePropagation", value: function() {
790
+ this.immediatePropagationStopped = this.propagationStopped = true;
791
+ } }]), t2;
792
+ }();
793
+ Object.defineProperty(vt.prototype, "interaction", { get: function() {
794
+ return this._interaction._proxy;
795
+ }, set: function() {
796
+ } });
797
+ var gt = function(t2, e2) {
798
+ for (var n2 = 0; n2 < e2.length; n2++) {
799
+ var r2 = e2[n2];
800
+ t2.push(r2);
801
+ }
802
+ return t2;
803
+ }, mt = function(t2) {
804
+ return gt([], t2);
805
+ }, yt = function(t2, e2) {
806
+ for (var n2 = 0; n2 < t2.length; n2++)
807
+ if (e2(t2[n2], n2, t2))
808
+ return n2;
809
+ return -1;
810
+ }, bt = function(t2, e2) {
811
+ return t2[yt(t2, e2)];
812
+ }, xt = function(t2) {
813
+ s(n2, t2);
814
+ var e2 = p(n2);
815
+ function n2(t3, i2, o2) {
816
+ var a2;
817
+ r(this, n2), (a2 = e2.call(this, i2._interaction)).dropzone = void 0, a2.dragEvent = void 0, a2.relatedTarget = void 0, a2.draggable = void 0, a2.propagationStopped = false, a2.immediatePropagationStopped = false;
818
+ var s2 = "dragleave" === o2 ? t3.prev : t3.cur, c2 = s2.element, l2 = s2.dropzone;
819
+ return a2.type = o2, a2.target = c2, a2.currentTarget = c2, a2.dropzone = l2, a2.dragEvent = i2, a2.relatedTarget = i2.target, a2.draggable = i2.interactable, a2.timeStamp = i2.timeStamp, a2;
820
+ }
821
+ return o(n2, [{ key: "reject", value: function() {
822
+ var t3 = this, e3 = this._interaction.dropState;
823
+ if ("dropactivate" === this.type || this.dropzone && e3.cur.dropzone === this.dropzone && e3.cur.element === this.target)
824
+ if (e3.prev.dropzone = this.dropzone, e3.prev.element = this.target, e3.rejected = true, e3.events.enter = null, this.stopImmediatePropagation(), "dropactivate" === this.type) {
825
+ var r2 = e3.activeDrops, i2 = yt(r2, function(e4) {
826
+ var n3 = e4.dropzone, r3 = e4.element;
827
+ return n3 === t3.dropzone && r3 === t3.target;
828
+ });
829
+ e3.activeDrops.splice(i2, 1);
830
+ var o2 = new n2(e3, this.dragEvent, "dropdeactivate");
831
+ o2.dropzone = this.dropzone, o2.target = this.target, this.dropzone.fire(o2);
832
+ } else
833
+ this.dropzone.fire(new n2(e3, this.dragEvent, "dragleave"));
834
+ } }, { key: "preventDefault", value: function() {
835
+ } }, { key: "stopPropagation", value: function() {
836
+ this.propagationStopped = true;
837
+ } }, { key: "stopImmediatePropagation", value: function() {
838
+ this.immediatePropagationStopped = this.propagationStopped = true;
839
+ } }]), n2;
840
+ }(vt);
841
+ function wt(t2, e2) {
842
+ for (var n2 = 0, r2 = t2.slice(); n2 < r2.length; n2++) {
843
+ var i2 = r2[n2], o2 = i2.dropzone, a2 = i2.element;
844
+ e2.dropzone = o2, e2.target = a2, o2.fire(e2), e2.propagationStopped = e2.immediatePropagationStopped = false;
845
+ }
846
+ }
847
+ function Et(t2, e2) {
848
+ for (var n2 = function(t3, e3) {
849
+ for (var n3 = [], r3 = 0, i3 = t3.interactables.list; r3 < i3.length; r3++) {
850
+ var o2 = i3[r3];
851
+ if (o2.options.drop.enabled) {
852
+ var a2 = o2.options.drop.accept;
853
+ if (!(w.element(a2) && a2 !== e3 || w.string(a2) && !R(e3, a2) || w.func(a2) && !a2({ dropzone: o2, draggableElement: e3 })))
854
+ for (var s2 = 0, c2 = o2.getAllElements(); s2 < c2.length; s2++) {
855
+ var l2 = c2[s2];
856
+ l2 !== e3 && n3.push({ dropzone: o2, element: l2, rect: o2.getRect(l2) });
857
+ }
858
+ }
859
+ }
860
+ return n3;
861
+ }(t2, e2), r2 = 0; r2 < n2.length; r2++) {
862
+ var i2 = n2[r2];
863
+ i2.rect = i2.dropzone.getRect(i2.element);
864
+ }
865
+ return n2;
866
+ }
867
+ function Tt(t2, e2, n2) {
868
+ for (var r2 = t2.dropState, i2 = t2.interactable, o2 = t2.element, a2 = [], s2 = 0, c2 = r2.activeDrops; s2 < c2.length; s2++) {
869
+ var l2 = c2[s2], u2 = l2.dropzone, p2 = l2.element, f2 = l2.rect, d2 = u2.dropCheck(e2, n2, i2, o2, p2, f2);
870
+ a2.push(d2 ? p2 : null);
871
+ }
872
+ var h2 = function(t3) {
873
+ for (var e3, n3, r3, i3 = [], o3 = 0; o3 < t3.length; o3++) {
874
+ var a3 = t3[o3], s3 = t3[e3];
875
+ if (a3 && o3 !== e3)
876
+ if (s3) {
877
+ var c3 = C(a3), l3 = C(s3);
878
+ if (c3 !== a3.ownerDocument)
879
+ if (l3 !== a3.ownerDocument)
880
+ if (c3 !== l3) {
881
+ i3 = i3.length ? i3 : j(s3);
882
+ var u3 = void 0;
883
+ if (s3 instanceof k.HTMLElement && a3 instanceof k.SVGElement && !(a3 instanceof k.SVGSVGElement)) {
884
+ if (a3 === l3)
885
+ continue;
886
+ u3 = a3.ownerSVGElement;
887
+ } else
888
+ u3 = a3;
889
+ for (var p3 = j(u3, s3.ownerDocument), f3 = 0; p3[f3] && p3[f3] === i3[f3]; )
890
+ f3++;
891
+ var d3 = [p3[f3 - 1], p3[f3], i3[f3]];
892
+ if (d3[0])
893
+ for (var h3 = d3[0].lastChild; h3; ) {
894
+ if (h3 === d3[1]) {
895
+ e3 = o3, i3 = p3;
896
+ break;
897
+ }
898
+ if (h3 === d3[2])
899
+ break;
900
+ h3 = h3.previousSibling;
901
+ }
902
+ } else
903
+ r3 = s3, void 0, void 0, (parseInt(y(n3 = a3).getComputedStyle(n3).zIndex, 10) || 0) >= (parseInt(y(r3).getComputedStyle(r3).zIndex, 10) || 0) && (e3 = o3);
904
+ else
905
+ e3 = o3;
906
+ } else
907
+ e3 = o3;
908
+ }
909
+ return e3;
910
+ }(a2);
911
+ return r2.activeDrops[h2] || null;
912
+ }
913
+ function St(t2, e2, n2) {
914
+ var r2 = t2.dropState, i2 = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
915
+ return "dragstart" === n2.type && (i2.activate = new xt(r2, n2, "dropactivate"), i2.activate.target = null, i2.activate.dropzone = null), "dragend" === n2.type && (i2.deactivate = new xt(r2, n2, "dropdeactivate"), i2.deactivate.target = null, i2.deactivate.dropzone = null), r2.rejected || (r2.cur.element !== r2.prev.element && (r2.prev.dropzone && (i2.leave = new xt(r2, n2, "dragleave"), n2.dragLeave = i2.leave.target = r2.prev.element, n2.prevDropzone = i2.leave.dropzone = r2.prev.dropzone), r2.cur.dropzone && (i2.enter = new xt(r2, n2, "dragenter"), n2.dragEnter = r2.cur.element, n2.dropzone = r2.cur.dropzone)), "dragend" === n2.type && r2.cur.dropzone && (i2.drop = new xt(r2, n2, "drop"), n2.dropzone = r2.cur.dropzone, n2.relatedTarget = r2.cur.element), "dragmove" === n2.type && r2.cur.dropzone && (i2.move = new xt(r2, n2, "dropmove"), n2.dropzone = r2.cur.dropzone)), i2;
916
+ }
917
+ function _t(t2, e2) {
918
+ var n2 = t2.dropState, r2 = n2.activeDrops, i2 = n2.cur, o2 = n2.prev;
919
+ e2.leave && o2.dropzone.fire(e2.leave), e2.enter && i2.dropzone.fire(e2.enter), e2.move && i2.dropzone.fire(e2.move), e2.drop && i2.dropzone.fire(e2.drop), e2.deactivate && wt(r2, e2.deactivate), n2.prev.dropzone = i2.dropzone, n2.prev.element = i2.element;
920
+ }
921
+ function Pt(t2, e2) {
922
+ var n2 = t2.interaction, r2 = t2.iEvent, i2 = t2.event;
923
+ if ("dragmove" === r2.type || "dragend" === r2.type) {
924
+ var o2 = n2.dropState;
925
+ e2.dynamicDrop && (o2.activeDrops = Et(e2, n2.element));
926
+ var a2 = r2, s2 = Tt(n2, a2, i2);
927
+ o2.rejected = o2.rejected && !!s2 && s2.dropzone === o2.cur.dropzone && s2.element === o2.cur.element, o2.cur.dropzone = s2 && s2.dropzone, o2.cur.element = s2 && s2.element, o2.events = St(n2, 0, a2);
928
+ }
929
+ }
930
+ var Ot = { id: "actions/drop", install: function(t2) {
931
+ var e2 = t2.actions, n2 = t2.interactStatic, r2 = t2.Interactable, i2 = t2.defaults;
932
+ t2.usePlugin(_), r2.prototype.dropzone = function(t3) {
933
+ return function(t4, e3) {
934
+ if (w.object(e3)) {
935
+ if (t4.options.drop.enabled = false !== e3.enabled, e3.listeners) {
936
+ var n3 = $(e3.listeners), r3 = Object.keys(n3).reduce(function(t5, e4) {
937
+ return t5[/^(enter|leave)/.test(e4) ? "drag".concat(e4) : /^(activate|deactivate|move)/.test(e4) ? "drop".concat(e4) : e4] = n3[e4], t5;
938
+ }, {}), i3 = t4.options.drop.listeners;
939
+ i3 && t4.off(i3), t4.on(r3), t4.options.drop.listeners = r3;
940
+ }
941
+ return w.func(e3.ondrop) && t4.on("drop", e3.ondrop), w.func(e3.ondropactivate) && t4.on("dropactivate", e3.ondropactivate), w.func(e3.ondropdeactivate) && t4.on("dropdeactivate", e3.ondropdeactivate), w.func(e3.ondragenter) && t4.on("dragenter", e3.ondragenter), w.func(e3.ondragleave) && t4.on("dragleave", e3.ondragleave), w.func(e3.ondropmove) && t4.on("dropmove", e3.ondropmove), /^(pointer|center)$/.test(e3.overlap) ? t4.options.drop.overlap = e3.overlap : w.number(e3.overlap) && (t4.options.drop.overlap = Math.max(Math.min(1, e3.overlap), 0)), "accept" in e3 && (t4.options.drop.accept = e3.accept), "checker" in e3 && (t4.options.drop.checker = e3.checker), t4;
942
+ }
943
+ if (w.bool(e3))
944
+ return t4.options.drop.enabled = e3, t4;
945
+ return t4.options.drop;
946
+ }(this, t3);
947
+ }, r2.prototype.dropCheck = function(t3, e3, n3, r3, i3, o2) {
948
+ return function(t4, e4, n4, r4, i4, o3, a2) {
949
+ var s2 = false;
950
+ if (!(a2 = a2 || t4.getRect(o3)))
951
+ return !!t4.options.drop.checker && t4.options.drop.checker(e4, n4, s2, t4, o3, r4, i4);
952
+ var c2 = t4.options.drop.overlap;
953
+ if ("pointer" === c2) {
954
+ var l2 = K(r4, i4, "drag"), u2 = ot(e4);
955
+ u2.x += l2.x, u2.y += l2.y;
956
+ var p2 = u2.x > a2.left && u2.x < a2.right, f2 = u2.y > a2.top && u2.y < a2.bottom;
957
+ s2 = p2 && f2;
958
+ }
959
+ var d2 = r4.getRect(i4);
960
+ if (d2 && "center" === c2) {
961
+ var h2 = d2.left + d2.width / 2, v2 = d2.top + d2.height / 2;
962
+ s2 = h2 >= a2.left && h2 <= a2.right && v2 >= a2.top && v2 <= a2.bottom;
963
+ }
964
+ if (d2 && w.number(c2)) {
965
+ s2 = Math.max(0, Math.min(a2.right, d2.right) - Math.max(a2.left, d2.left)) * Math.max(0, Math.min(a2.bottom, d2.bottom) - Math.max(a2.top, d2.top)) / (d2.width * d2.height) >= c2;
966
+ }
967
+ t4.options.drop.checker && (s2 = t4.options.drop.checker(e4, n4, s2, t4, o3, r4, i4));
968
+ return s2;
969
+ }(this, t3, e3, n3, r3, i3, o2);
970
+ }, n2.dynamicDrop = function(e3) {
971
+ return w.bool(e3) ? (t2.dynamicDrop = e3, n2) : t2.dynamicDrop;
972
+ }, V(e2.phaselessTypes, { dragenter: true, dragleave: true, dropactivate: true, dropdeactivate: true, dropmove: true, drop: true }), e2.methodDict.drop = "dropzone", t2.dynamicDrop = false, i2.actions.drop = Ot.defaults;
973
+ }, listeners: { "interactions:before-action-start": function(t2) {
974
+ var e2 = t2.interaction;
975
+ "drag" === e2.prepared.name && (e2.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
976
+ }, "interactions:after-action-start": function(t2, e2) {
977
+ var n2 = t2.interaction, r2 = (t2.event, t2.iEvent);
978
+ if ("drag" === n2.prepared.name) {
979
+ var i2 = n2.dropState;
980
+ i2.activeDrops = [], i2.events = {}, i2.activeDrops = Et(e2, n2.element), i2.events = St(n2, 0, r2), i2.events.activate && (wt(i2.activeDrops, i2.events.activate), e2.fire("actions/drop:start", { interaction: n2, dragEvent: r2 }));
981
+ }
982
+ }, "interactions:action-move": Pt, "interactions:after-action-move": function(t2, e2) {
983
+ var n2 = t2.interaction, r2 = t2.iEvent;
984
+ if ("drag" === n2.prepared.name) {
985
+ var i2 = n2.dropState;
986
+ _t(n2, i2.events), e2.fire("actions/drop:move", { interaction: n2, dragEvent: r2 }), i2.events = {};
987
+ }
988
+ }, "interactions:action-end": function(t2, e2) {
989
+ if ("drag" === t2.interaction.prepared.name) {
990
+ var n2 = t2.interaction, r2 = t2.iEvent;
991
+ Pt(t2, e2), _t(n2, n2.dropState.events), e2.fire("actions/drop:end", { interaction: n2, dragEvent: r2 });
992
+ }
993
+ }, "interactions:stop": function(t2) {
994
+ var e2 = t2.interaction;
995
+ if ("drag" === e2.prepared.name) {
996
+ var n2 = e2.dropState;
997
+ n2 && (n2.activeDrops = null, n2.events = null, n2.cur.dropzone = null, n2.cur.element = null, n2.prev.dropzone = null, n2.prev.element = null, n2.rejected = false);
998
+ }
999
+ } }, getActiveDrops: Et, getDrop: Tt, getDropEvents: St, fireDropEvents: _t, filterEventType: function(t2) {
1000
+ return 0 === t2.search("drag") || 0 === t2.search("drop");
1001
+ }, defaults: { enabled: false, accept: null, overlap: "pointer" } }, kt = Ot;
1002
+ function Dt(t2) {
1003
+ var e2 = t2.interaction, n2 = t2.iEvent, r2 = t2.phase;
1004
+ if ("gesture" === e2.prepared.name) {
1005
+ var i2 = e2.pointers.map(function(t3) {
1006
+ return t3.pointer;
1007
+ }), o2 = "start" === r2, a2 = "end" === r2, s2 = e2.interactable.options.deltaSource;
1008
+ if (n2.touches = [i2[0], i2[1]], o2)
1009
+ n2.distance = pt(i2, s2), n2.box = ut(i2), n2.scale = 1, n2.ds = 0, n2.angle = ft(i2, s2), n2.da = 0, e2.gesture.startDistance = n2.distance, e2.gesture.startAngle = n2.angle;
1010
+ else if (a2 || e2.pointers.length < 2) {
1011
+ var c2 = e2.prevEvent;
1012
+ n2.distance = c2.distance, n2.box = c2.box, n2.scale = c2.scale, n2.ds = 0, n2.angle = c2.angle, n2.da = 0;
1013
+ } else
1014
+ n2.distance = pt(i2, s2), n2.box = ut(i2), n2.scale = n2.distance / e2.gesture.startDistance, n2.angle = ft(i2, s2), n2.ds = n2.scale - e2.gesture.scale, n2.da = n2.angle - e2.gesture.angle;
1015
+ e2.gesture.distance = n2.distance, e2.gesture.angle = n2.angle, w.number(n2.scale) && n2.scale !== 1 / 0 && !isNaN(n2.scale) && (e2.gesture.scale = n2.scale);
1016
+ }
1017
+ }
1018
+ var It = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t2) {
1019
+ var e2 = t2.actions, n2 = t2.Interactable, r2 = t2.defaults;
1020
+ n2.prototype.gesturable = function(t3) {
1021
+ return w.object(t3) ? (this.options.gesture.enabled = false !== t3.enabled, this.setPerAction("gesture", t3), this.setOnEvents("gesture", t3), this) : w.bool(t3) ? (this.options.gesture.enabled = t3, this) : this.options.gesture;
1022
+ }, e2.map.gesture = It, e2.methodDict.gesture = "gesturable", r2.actions.gesture = It.defaults;
1023
+ }, listeners: { "interactions:action-start": Dt, "interactions:action-move": Dt, "interactions:action-end": Dt, "interactions:new": function(t2) {
1024
+ t2.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
1025
+ }, "auto-start:check": function(t2) {
1026
+ if (!(t2.interaction.pointers.length < 2)) {
1027
+ var e2 = t2.interactable.options.gesture;
1028
+ if (e2 && e2.enabled)
1029
+ return t2.action = { name: "gesture" }, false;
1030
+ }
1031
+ } }, defaults: {}, getCursor: function() {
1032
+ return "";
1033
+ }, filterEventType: function(t2) {
1034
+ return 0 === t2.search("gesture");
1035
+ } }, Mt = It;
1036
+ function zt(t2, e2, n2, r2, i2, o2, a2) {
1037
+ if (!e2)
1038
+ return false;
1039
+ if (true === e2) {
1040
+ var s2 = w.number(o2.width) ? o2.width : o2.right - o2.left, c2 = w.number(o2.height) ? o2.height : o2.bottom - o2.top;
1041
+ if (a2 = Math.min(a2, Math.abs(("left" === t2 || "right" === t2 ? s2 : c2) / 2)), s2 < 0 && ("left" === t2 ? t2 = "right" : "right" === t2 && (t2 = "left")), c2 < 0 && ("top" === t2 ? t2 = "bottom" : "bottom" === t2 && (t2 = "top")), "left" === t2) {
1042
+ var l2 = s2 >= 0 ? o2.left : o2.right;
1043
+ return n2.x < l2 + a2;
1044
+ }
1045
+ if ("top" === t2) {
1046
+ var u2 = c2 >= 0 ? o2.top : o2.bottom;
1047
+ return n2.y < u2 + a2;
1048
+ }
1049
+ if ("right" === t2)
1050
+ return n2.x > (s2 >= 0 ? o2.right : o2.left) - a2;
1051
+ if ("bottom" === t2)
1052
+ return n2.y > (c2 >= 0 ? o2.bottom : o2.top) - a2;
1053
+ }
1054
+ return !!w.element(r2) && (w.element(e2) ? e2 === r2 : F(r2, e2, i2));
1055
+ }
1056
+ function At(t2) {
1057
+ var e2 = t2.iEvent, n2 = t2.interaction;
1058
+ if ("resize" === n2.prepared.name && n2.resizeAxes) {
1059
+ var r2 = e2;
1060
+ n2.interactable.options.resize.square ? ("y" === n2.resizeAxes ? r2.delta.x = r2.delta.y : r2.delta.y = r2.delta.x, r2.axes = "xy") : (r2.axes = n2.resizeAxes, "x" === n2.resizeAxes ? r2.delta.y = 0 : "y" === n2.resizeAxes && (r2.delta.x = 0));
1061
+ }
1062
+ }
1063
+ var Rt, Ct, jt = { id: "actions/resize", before: ["actions/drag"], install: function(t2) {
1064
+ var e2 = t2.actions, n2 = t2.browser, r2 = t2.Interactable, i2 = t2.defaults;
1065
+ jt.cursors = function(t3) {
1066
+ return t3.isIe9 ? { x: "e-resize", y: "s-resize", xy: "se-resize", top: "n-resize", left: "w-resize", bottom: "s-resize", right: "e-resize", topleft: "se-resize", bottomright: "se-resize", topright: "ne-resize", bottomleft: "ne-resize" } : { x: "ew-resize", y: "ns-resize", xy: "nwse-resize", top: "ns-resize", left: "ew-resize", bottom: "ns-resize", right: "ew-resize", topleft: "nwse-resize", bottomright: "nwse-resize", topright: "nesw-resize", bottomleft: "nesw-resize" };
1067
+ }(n2), jt.defaultMargin = n2.supportsTouch || n2.supportsPointerEvent ? 20 : 10, r2.prototype.resizable = function(e3) {
1068
+ return function(t3, e4, n3) {
1069
+ if (w.object(e4))
1070
+ return t3.options.resize.enabled = false !== e4.enabled, t3.setPerAction("resize", e4), t3.setOnEvents("resize", e4), w.string(e4.axis) && /^x$|^y$|^xy$/.test(e4.axis) ? t3.options.resize.axis = e4.axis : null === e4.axis && (t3.options.resize.axis = n3.defaults.actions.resize.axis), w.bool(e4.preserveAspectRatio) ? t3.options.resize.preserveAspectRatio = e4.preserveAspectRatio : w.bool(e4.square) && (t3.options.resize.square = e4.square), t3;
1071
+ if (w.bool(e4))
1072
+ return t3.options.resize.enabled = e4, t3;
1073
+ return t3.options.resize;
1074
+ }(this, e3, t2);
1075
+ }, e2.map.resize = jt, e2.methodDict.resize = "resizable", i2.actions.resize = jt.defaults;
1076
+ }, listeners: { "interactions:new": function(t2) {
1077
+ t2.interaction.resizeAxes = "xy";
1078
+ }, "interactions:action-start": function(t2) {
1079
+ !function(t3) {
1080
+ var e2 = t3.iEvent, n2 = t3.interaction;
1081
+ if ("resize" === n2.prepared.name && n2.prepared.edges) {
1082
+ var r2 = e2, i2 = n2.rect;
1083
+ n2._rects = { start: V({}, i2), corrected: V({}, i2), previous: V({}, i2), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, r2.edges = n2.prepared.edges, r2.rect = n2._rects.corrected, r2.deltaRect = n2._rects.delta;
1084
+ }
1085
+ }(t2), At(t2);
1086
+ }, "interactions:action-move": function(t2) {
1087
+ !function(t3) {
1088
+ var e2 = t3.iEvent, n2 = t3.interaction;
1089
+ if ("resize" === n2.prepared.name && n2.prepared.edges) {
1090
+ var r2 = e2, i2 = n2.interactable.options.resize.invert, o2 = "reposition" === i2 || "negate" === i2, a2 = n2.rect, s2 = n2._rects, c2 = s2.start, l2 = s2.corrected, u2 = s2.delta, p2 = s2.previous;
1091
+ if (V(p2, l2), o2) {
1092
+ if (V(l2, a2), "reposition" === i2) {
1093
+ if (l2.top > l2.bottom) {
1094
+ var f2 = l2.top;
1095
+ l2.top = l2.bottom, l2.bottom = f2;
1096
+ }
1097
+ if (l2.left > l2.right) {
1098
+ var d2 = l2.left;
1099
+ l2.left = l2.right, l2.right = d2;
1100
+ }
1101
+ }
1102
+ } else
1103
+ l2.top = Math.min(a2.top, c2.bottom), l2.bottom = Math.max(a2.bottom, c2.top), l2.left = Math.min(a2.left, c2.right), l2.right = Math.max(a2.right, c2.left);
1104
+ for (var h2 in l2.width = l2.right - l2.left, l2.height = l2.bottom - l2.top, l2)
1105
+ u2[h2] = l2[h2] - p2[h2];
1106
+ r2.edges = n2.prepared.edges, r2.rect = l2, r2.deltaRect = u2;
1107
+ }
1108
+ }(t2), At(t2);
1109
+ }, "interactions:action-end": function(t2) {
1110
+ var e2 = t2.iEvent, n2 = t2.interaction;
1111
+ if ("resize" === n2.prepared.name && n2.prepared.edges) {
1112
+ var r2 = e2;
1113
+ r2.edges = n2.prepared.edges, r2.rect = n2._rects.corrected, r2.deltaRect = n2._rects.delta;
1114
+ }
1115
+ }, "auto-start:check": function(t2) {
1116
+ var e2 = t2.interaction, n2 = t2.interactable, r2 = t2.element, i2 = t2.rect, o2 = t2.buttons;
1117
+ if (i2) {
1118
+ var a2 = V({}, e2.coords.cur.page), s2 = n2.options.resize;
1119
+ if (s2 && s2.enabled && (!e2.pointerIsDown || !/mouse|pointer/.test(e2.pointerType) || 0 != (o2 & s2.mouseButtons))) {
1120
+ if (w.object(s2.edges)) {
1121
+ var c2 = { left: false, right: false, top: false, bottom: false };
1122
+ for (var l2 in c2)
1123
+ c2[l2] = zt(l2, s2.edges[l2], a2, e2._latestPointer.eventTarget, r2, i2, s2.margin || jt.defaultMargin);
1124
+ c2.left = c2.left && !c2.right, c2.top = c2.top && !c2.bottom, (c2.left || c2.right || c2.top || c2.bottom) && (t2.action = { name: "resize", edges: c2 });
1125
+ } else {
1126
+ var u2 = "y" !== s2.axis && a2.x > i2.right - jt.defaultMargin, p2 = "x" !== s2.axis && a2.y > i2.bottom - jt.defaultMargin;
1127
+ (u2 || p2) && (t2.action = { name: "resize", axes: (u2 ? "x" : "") + (p2 ? "y" : "") });
1128
+ }
1129
+ return !t2.action && void 0;
1130
+ }
1131
+ }
1132
+ } }, defaults: { square: false, preserveAspectRatio: false, axis: "xy", margin: NaN, edges: null, invert: "none" }, cursors: null, getCursor: function(t2) {
1133
+ var e2 = t2.edges, n2 = t2.axis, r2 = t2.name, i2 = jt.cursors, o2 = null;
1134
+ if (n2)
1135
+ o2 = i2[r2 + n2];
1136
+ else if (e2) {
1137
+ for (var a2 = "", s2 = 0, c2 = ["top", "bottom", "left", "right"]; s2 < c2.length; s2++) {
1138
+ var l2 = c2[s2];
1139
+ e2[l2] && (a2 += l2);
1140
+ }
1141
+ o2 = i2[a2];
1142
+ }
1143
+ return o2;
1144
+ }, filterEventType: function(t2) {
1145
+ return 0 === t2.search("resize");
1146
+ }, defaultMargin: null }, Ft = jt, Xt = { id: "actions", install: function(t2) {
1147
+ t2.usePlugin(Mt), t2.usePlugin(Ft), t2.usePlugin(_), t2.usePlugin(kt);
1148
+ } }, Yt = 0;
1149
+ var Lt = { request: function(t2) {
1150
+ return Rt(t2);
1151
+ }, cancel: function(t2) {
1152
+ return Ct(t2);
1153
+ }, init: function(t2) {
1154
+ if (Rt = t2.requestAnimationFrame, Ct = t2.cancelAnimationFrame, !Rt)
1155
+ for (var e2 = ["ms", "moz", "webkit", "o"], n2 = 0; n2 < e2.length; n2++) {
1156
+ var r2 = e2[n2];
1157
+ Rt = t2["".concat(r2, "RequestAnimationFrame")], Ct = t2["".concat(r2, "CancelAnimationFrame")] || t2["".concat(r2, "CancelRequestAnimationFrame")];
1158
+ }
1159
+ Rt = Rt && Rt.bind(t2), Ct = Ct && Ct.bind(t2), Rt || (Rt = function(e3) {
1160
+ var n3 = Date.now(), r3 = Math.max(0, 16 - (n3 - Yt)), i2 = t2.setTimeout(function() {
1161
+ e3(n3 + r3);
1162
+ }, r3);
1163
+ return Yt = n3 + r3, i2;
1164
+ }, Ct = function(t3) {
1165
+ return clearTimeout(t3);
1166
+ });
1167
+ } };
1168
+ var qt = { defaults: { enabled: false, margin: 60, container: null, speed: 300 }, now: Date.now, interaction: null, i: 0, x: 0, y: 0, isScrolling: false, prevTime: 0, margin: 0, speed: 0, start: function(t2) {
1169
+ qt.isScrolling = true, Lt.cancel(qt.i), t2.autoScroll = qt, qt.interaction = t2, qt.prevTime = qt.now(), qt.i = Lt.request(qt.scroll);
1170
+ }, stop: function() {
1171
+ qt.isScrolling = false, qt.interaction && (qt.interaction.autoScroll = null), Lt.cancel(qt.i);
1172
+ }, scroll: function() {
1173
+ var t2 = qt.interaction, e2 = t2.interactable, n2 = t2.element, r2 = t2.prepared.name, i2 = e2.options[r2].autoScroll, o2 = Bt(i2.container, e2, n2), a2 = qt.now(), s2 = (a2 - qt.prevTime) / 1e3, c2 = i2.speed * s2;
1174
+ if (c2 >= 1) {
1175
+ var l2 = { x: qt.x * c2, y: qt.y * c2 };
1176
+ if (l2.x || l2.y) {
1177
+ var u2 = Vt(o2);
1178
+ w.window(o2) ? o2.scrollBy(l2.x, l2.y) : o2 && (o2.scrollLeft += l2.x, o2.scrollTop += l2.y);
1179
+ var p2 = Vt(o2), f2 = { x: p2.x - u2.x, y: p2.y - u2.y };
1180
+ (f2.x || f2.y) && e2.fire({ type: "autoscroll", target: n2, interactable: e2, delta: f2, interaction: t2, container: o2 });
1181
+ }
1182
+ qt.prevTime = a2;
1183
+ }
1184
+ qt.isScrolling && (Lt.cancel(qt.i), qt.i = Lt.request(qt.scroll));
1185
+ }, check: function(t2, e2) {
1186
+ var n2;
1187
+ return null == (n2 = t2.options[e2].autoScroll) ? void 0 : n2.enabled;
1188
+ }, onInteractionMove: function(t2) {
1189
+ var e2 = t2.interaction, n2 = t2.pointer;
1190
+ if (e2.interacting() && qt.check(e2.interactable, e2.prepared.name))
1191
+ if (e2.simulation)
1192
+ qt.x = qt.y = 0;
1193
+ else {
1194
+ var r2, i2, o2, a2, s2 = e2.interactable, c2 = e2.element, l2 = e2.prepared.name, u2 = s2.options[l2].autoScroll, p2 = Bt(u2.container, s2, c2);
1195
+ if (w.window(p2))
1196
+ a2 = n2.clientX < qt.margin, r2 = n2.clientY < qt.margin, i2 = n2.clientX > p2.innerWidth - qt.margin, o2 = n2.clientY > p2.innerHeight - qt.margin;
1197
+ else {
1198
+ var f2 = Y(p2);
1199
+ a2 = n2.clientX < f2.left + qt.margin, r2 = n2.clientY < f2.top + qt.margin, i2 = n2.clientX > f2.right - qt.margin, o2 = n2.clientY > f2.bottom - qt.margin;
1200
+ }
1201
+ qt.x = i2 ? 1 : a2 ? -1 : 0, qt.y = o2 ? 1 : r2 ? -1 : 0, qt.isScrolling || (qt.margin = u2.margin, qt.speed = u2.speed, qt.start(e2));
1202
+ }
1203
+ } };
1204
+ function Bt(t2, e2, n2) {
1205
+ return (w.string(t2) ? W(t2, e2, n2) : t2) || y(n2);
1206
+ }
1207
+ function Vt(t2) {
1208
+ return w.window(t2) && (t2 = window.document.body), { x: t2.scrollLeft, y: t2.scrollTop };
1209
+ }
1210
+ var Wt = { id: "auto-scroll", install: function(t2) {
1211
+ var e2 = t2.defaults, n2 = t2.actions;
1212
+ t2.autoScroll = qt, qt.now = function() {
1213
+ return t2.now();
1214
+ }, n2.phaselessTypes.autoscroll = true, e2.perAction.autoScroll = qt.defaults;
1215
+ }, listeners: { "interactions:new": function(t2) {
1216
+ t2.interaction.autoScroll = null;
1217
+ }, "interactions:destroy": function(t2) {
1218
+ t2.interaction.autoScroll = null, qt.stop(), qt.interaction && (qt.interaction = null);
1219
+ }, "interactions:stop": qt.stop, "interactions:action-move": function(t2) {
1220
+ return qt.onInteractionMove(t2);
1221
+ } } }, Gt = Wt;
1222
+ function Nt(t2, e2) {
1223
+ var n2 = false;
1224
+ return function() {
1225
+ return n2 || (g.console.warn(e2), n2 = true), t2.apply(this, arguments);
1226
+ };
1227
+ }
1228
+ function Ut(t2, e2) {
1229
+ return t2.name = e2.name, t2.axis = e2.axis, t2.edges = e2.edges, t2;
1230
+ }
1231
+ function Ht(t2) {
1232
+ return w.bool(t2) ? (this.options.styleCursor = t2, this) : null === t2 ? (delete this.options.styleCursor, this) : this.options.styleCursor;
1233
+ }
1234
+ function Kt(t2) {
1235
+ return w.func(t2) ? (this.options.actionChecker = t2, this) : null === t2 ? (delete this.options.actionChecker, this) : this.options.actionChecker;
1236
+ }
1237
+ var $t = { id: "auto-start/interactableMethods", install: function(t2) {
1238
+ var e2 = t2.Interactable;
1239
+ e2.prototype.getAction = function(e3, n2, r2, i2) {
1240
+ var o2 = function(t3, e4, n3, r3, i3) {
1241
+ var o3 = t3.getRect(r3), a2 = e4.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[e4.button], s2 = { action: null, interactable: t3, interaction: n3, element: r3, rect: o3, buttons: a2 };
1242
+ return i3.fire("auto-start:check", s2), s2.action;
1243
+ }(this, n2, r2, i2, t2);
1244
+ return this.options.actionChecker ? this.options.actionChecker(e3, n2, o2, this, i2, r2) : o2;
1245
+ }, e2.prototype.ignoreFrom = Nt(function(t3) {
1246
+ return this._backCompatOption("ignoreFrom", t3);
1247
+ }, "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), e2.prototype.allowFrom = Nt(function(t3) {
1248
+ return this._backCompatOption("allowFrom", t3);
1249
+ }, "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), e2.prototype.actionChecker = Kt, e2.prototype.styleCursor = Ht;
1250
+ } };
1251
+ function Jt(t2, e2, n2, r2, i2) {
1252
+ return e2.testIgnoreAllow(e2.options[t2.name], n2, r2) && e2.options[t2.name].enabled && ee(e2, n2, t2, i2) ? t2 : null;
1253
+ }
1254
+ function Qt(t2, e2, n2, r2, i2, o2, a2) {
1255
+ for (var s2 = 0, c2 = r2.length; s2 < c2; s2++) {
1256
+ var l2 = r2[s2], u2 = i2[s2], p2 = l2.getAction(e2, n2, t2, u2);
1257
+ if (p2) {
1258
+ var f2 = Jt(p2, l2, u2, o2, a2);
1259
+ if (f2)
1260
+ return { action: f2, interactable: l2, element: u2 };
1261
+ }
1262
+ }
1263
+ return { action: null, interactable: null, element: null };
1264
+ }
1265
+ function Zt(t2, e2, n2, r2, i2) {
1266
+ var o2 = [], a2 = [], s2 = r2;
1267
+ function c2(t3) {
1268
+ o2.push(t3), a2.push(s2);
1269
+ }
1270
+ for (; w.element(s2); ) {
1271
+ o2 = [], a2 = [], i2.interactables.forEachMatch(s2, c2);
1272
+ var l2 = Qt(t2, e2, n2, o2, a2, r2, i2);
1273
+ if (l2.action && !l2.interactable.options[l2.action.name].manualStart)
1274
+ return l2;
1275
+ s2 = A(s2);
1276
+ }
1277
+ return { action: null, interactable: null, element: null };
1278
+ }
1279
+ function te(t2, e2, n2) {
1280
+ var r2 = e2.action, i2 = e2.interactable, o2 = e2.element;
1281
+ r2 = r2 || { name: null }, t2.interactable = i2, t2.element = o2, Ut(t2.prepared, r2), t2.rect = i2 && r2.name ? i2.getRect(o2) : null, ie(t2, n2), n2.fire("autoStart:prepared", { interaction: t2 });
1282
+ }
1283
+ function ee(t2, e2, n2, r2) {
1284
+ var i2 = t2.options, o2 = i2[n2.name].max, a2 = i2[n2.name].maxPerElement, s2 = r2.autoStart.maxInteractions, c2 = 0, l2 = 0, u2 = 0;
1285
+ if (!(o2 && a2 && s2))
1286
+ return false;
1287
+ for (var p2 = 0, f2 = r2.interactions.list; p2 < f2.length; p2++) {
1288
+ var d2 = f2[p2], h2 = d2.prepared.name;
1289
+ if (d2.interacting()) {
1290
+ if (++c2 >= s2)
1291
+ return false;
1292
+ if (d2.interactable === t2) {
1293
+ if ((l2 += h2 === n2.name ? 1 : 0) >= o2)
1294
+ return false;
1295
+ if (d2.element === e2 && (u2++, h2 === n2.name && u2 >= a2))
1296
+ return false;
1297
+ }
1298
+ }
1299
+ }
1300
+ return s2 > 0;
1301
+ }
1302
+ function ne(t2, e2) {
1303
+ return w.number(t2) ? (e2.autoStart.maxInteractions = t2, this) : e2.autoStart.maxInteractions;
1304
+ }
1305
+ function re(t2, e2, n2) {
1306
+ var r2 = n2.autoStart.cursorElement;
1307
+ r2 && r2 !== t2 && (r2.style.cursor = ""), t2.ownerDocument.documentElement.style.cursor = e2, t2.style.cursor = e2, n2.autoStart.cursorElement = e2 ? t2 : null;
1308
+ }
1309
+ function ie(t2, e2) {
1310
+ var n2 = t2.interactable, r2 = t2.element, i2 = t2.prepared;
1311
+ if ("mouse" === t2.pointerType && n2 && n2.options.styleCursor) {
1312
+ var o2 = "";
1313
+ if (i2.name) {
1314
+ var a2 = n2.options[i2.name].cursorChecker;
1315
+ o2 = w.func(a2) ? a2(i2, n2, r2, t2._interacting) : e2.actions.map[i2.name].getCursor(i2);
1316
+ }
1317
+ re(t2.element, o2 || "", e2);
1318
+ } else
1319
+ e2.autoStart.cursorElement && re(e2.autoStart.cursorElement, "", e2);
1320
+ }
1321
+ var oe = { id: "auto-start/base", before: ["actions"], install: function(t2) {
1322
+ var e2 = t2.interactStatic, n2 = t2.defaults;
1323
+ t2.usePlugin($t), n2.base.actionChecker = null, n2.base.styleCursor = true, V(n2.perAction, { manualStart: false, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e2.maxInteractions = function(e3) {
1324
+ return ne(e3, t2);
1325
+ }, t2.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: ee, cursorElement: null };
1326
+ }, listeners: { "interactions:down": function(t2, e2) {
1327
+ var n2 = t2.interaction, r2 = t2.pointer, i2 = t2.event, o2 = t2.eventTarget;
1328
+ n2.interacting() || te(n2, Zt(n2, r2, i2, o2, e2), e2);
1329
+ }, "interactions:move": function(t2, e2) {
1330
+ !function(t3, e3) {
1331
+ var n2 = t3.interaction, r2 = t3.pointer, i2 = t3.event, o2 = t3.eventTarget;
1332
+ "mouse" !== n2.pointerType || n2.pointerIsDown || n2.interacting() || te(n2, Zt(n2, r2, i2, o2, e3), e3);
1333
+ }(t2, e2), function(t3, e3) {
1334
+ var n2 = t3.interaction;
1335
+ if (n2.pointerIsDown && !n2.interacting() && n2.pointerWasMoved && n2.prepared.name) {
1336
+ e3.fire("autoStart:before-start", t3);
1337
+ var r2 = n2.interactable, i2 = n2.prepared.name;
1338
+ i2 && r2 && (r2.options[i2].manualStart || !ee(r2, n2.element, n2.prepared, e3) ? n2.stop() : (n2.start(n2.prepared, r2, n2.element), ie(n2, e3)));
1339
+ }
1340
+ }(t2, e2);
1341
+ }, "interactions:stop": function(t2, e2) {
1342
+ var n2 = t2.interaction, r2 = n2.interactable;
1343
+ r2 && r2.options.styleCursor && re(n2.element, "", e2);
1344
+ } }, maxInteractions: ne, withinInteractionLimit: ee, validateAction: Jt }, ae = oe;
1345
+ var se = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(t2, e2) {
1346
+ var n2 = t2.interaction, r2 = t2.eventTarget, i2 = t2.dx, o2 = t2.dy;
1347
+ if ("drag" === n2.prepared.name) {
1348
+ var a2 = Math.abs(i2), s2 = Math.abs(o2), c2 = n2.interactable.options.drag, l2 = c2.startAxis, u2 = a2 > s2 ? "x" : a2 < s2 ? "y" : "xy";
1349
+ if (n2.prepared.axis = "start" === c2.lockAxis ? u2[0] : c2.lockAxis, "xy" !== u2 && "xy" !== l2 && l2 !== u2) {
1350
+ n2.prepared.name = null;
1351
+ for (var p2 = r2, f2 = function(t3) {
1352
+ if (t3 !== n2.interactable) {
1353
+ var i3 = n2.interactable.options.drag;
1354
+ if (!i3.manualStart && t3.testIgnoreAllow(i3, p2, r2)) {
1355
+ var o3 = t3.getAction(n2.downPointer, n2.downEvent, n2, p2);
1356
+ if (o3 && "drag" === o3.name && function(t4, e3) {
1357
+ if (!e3)
1358
+ return false;
1359
+ var n3 = e3.options.drag.startAxis;
1360
+ return "xy" === t4 || "xy" === n3 || n3 === t4;
1361
+ }(u2, t3) && ae.validateAction(o3, t3, p2, r2, e2))
1362
+ return t3;
1363
+ }
1364
+ }
1365
+ }; w.element(p2); ) {
1366
+ var d2 = e2.interactables.forEachMatch(p2, f2);
1367
+ if (d2) {
1368
+ n2.prepared.name = "drag", n2.interactable = d2, n2.element = p2;
1369
+ break;
1370
+ }
1371
+ p2 = A(p2);
1372
+ }
1373
+ }
1374
+ }
1375
+ } } };
1376
+ function ce(t2) {
1377
+ var e2 = t2.prepared && t2.prepared.name;
1378
+ if (!e2)
1379
+ return null;
1380
+ var n2 = t2.interactable.options;
1381
+ return n2[e2].hold || n2[e2].delay;
1382
+ }
1383
+ var le = { id: "auto-start/hold", install: function(t2) {
1384
+ var e2 = t2.defaults;
1385
+ t2.usePlugin(ae), e2.perAction.hold = 0, e2.perAction.delay = 0;
1386
+ }, listeners: { "interactions:new": function(t2) {
1387
+ t2.interaction.autoStartHoldTimer = null;
1388
+ }, "autoStart:prepared": function(t2) {
1389
+ var e2 = t2.interaction, n2 = ce(e2);
1390
+ n2 > 0 && (e2.autoStartHoldTimer = setTimeout(function() {
1391
+ e2.start(e2.prepared, e2.interactable, e2.element);
1392
+ }, n2));
1393
+ }, "interactions:move": function(t2) {
1394
+ var e2 = t2.interaction, n2 = t2.duplicate;
1395
+ e2.autoStartHoldTimer && e2.pointerWasMoved && !n2 && (clearTimeout(e2.autoStartHoldTimer), e2.autoStartHoldTimer = null);
1396
+ }, "autoStart:before-start": function(t2) {
1397
+ var e2 = t2.interaction;
1398
+ ce(e2) > 0 && (e2.prepared.name = null);
1399
+ } }, getHoldDuration: ce }, ue = le, pe = { id: "auto-start", install: function(t2) {
1400
+ t2.usePlugin(ae), t2.usePlugin(ue), t2.usePlugin(se);
1401
+ } }, fe = function(t2) {
1402
+ return /^(always|never|auto)$/.test(t2) ? (this.options.preventDefault = t2, this) : w.bool(t2) ? (this.options.preventDefault = t2 ? "always" : "never", this) : this.options.preventDefault;
1403
+ };
1404
+ function de(t2) {
1405
+ var e2 = t2.interaction, n2 = t2.event;
1406
+ e2.interactable && e2.interactable.checkAndPreventDefault(n2);
1407
+ }
1408
+ var he = { id: "core/interactablePreventDefault", install: function(t2) {
1409
+ var e2 = t2.Interactable;
1410
+ e2.prototype.preventDefault = fe, e2.prototype.checkAndPreventDefault = function(e3) {
1411
+ return function(t3, e4, n2) {
1412
+ var r2 = t3.options.preventDefault;
1413
+ if ("never" !== r2)
1414
+ if ("always" !== r2) {
1415
+ if (e4.events.supportsPassive && /^touch(start|move)$/.test(n2.type)) {
1416
+ var i2 = y(n2.target).document, o2 = e4.getDocOptions(i2);
1417
+ if (!o2 || !o2.events || false !== o2.events.passive)
1418
+ return;
1419
+ }
1420
+ /^(mouse|pointer|touch)*(down|start)/i.test(n2.type) || w.element(n2.target) && R(n2.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *") || n2.preventDefault();
1421
+ } else
1422
+ n2.preventDefault();
1423
+ }(this, t2, e3);
1424
+ }, t2.interactions.docEvents.push({ type: "dragstart", listener: function(e3) {
1425
+ for (var n2 = 0, r2 = t2.interactions.list; n2 < r2.length; n2++) {
1426
+ var i2 = r2[n2];
1427
+ if (i2.element && (i2.element === e3.target || M(i2.element, e3.target)))
1428
+ return void i2.interactable.checkAndPreventDefault(e3);
1429
+ }
1430
+ } });
1431
+ }, listeners: ["down", "move", "up", "cancel"].reduce(function(t2, e2) {
1432
+ return t2["interactions:".concat(e2)] = de, t2;
1433
+ }, {}) };
1434
+ function ve(t2, e2) {
1435
+ if (e2.phaselessTypes[t2])
1436
+ return true;
1437
+ for (var n2 in e2.map)
1438
+ if (0 === t2.indexOf(n2) && t2.substr(n2.length) in e2.phases)
1439
+ return true;
1440
+ return false;
1441
+ }
1442
+ function ge(t2) {
1443
+ var e2 = {};
1444
+ for (var n2 in t2) {
1445
+ var r2 = t2[n2];
1446
+ w.plainObject(r2) ? e2[n2] = ge(r2) : w.array(r2) ? e2[n2] = mt(r2) : e2[n2] = r2;
1447
+ }
1448
+ return e2;
1449
+ }
1450
+ var me = function() {
1451
+ function t2(e2) {
1452
+ r(this, t2), this.states = [], this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 }, this.startDelta = void 0, this.result = void 0, this.endResult = void 0, this.startEdges = void 0, this.edges = void 0, this.interaction = void 0, this.interaction = e2, this.result = ye(), this.edges = { left: false, right: false, top: false, bottom: false };
1453
+ }
1454
+ return o(t2, [{ key: "start", value: function(t3, e2) {
1455
+ var n2, r2, i2 = t3.phase, o2 = this.interaction, a2 = function(t4) {
1456
+ var e3 = t4.interactable.options[t4.prepared.name], n3 = e3.modifiers;
1457
+ if (n3 && n3.length)
1458
+ return n3;
1459
+ return ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map(function(t5) {
1460
+ var n4 = e3[t5];
1461
+ return n4 && n4.enabled && { options: n4, methods: n4._methods };
1462
+ }).filter(function(t5) {
1463
+ return !!t5;
1464
+ });
1465
+ }(o2);
1466
+ this.prepareStates(a2), this.startEdges = V({}, o2.edges), this.edges = V({}, this.startEdges), this.startOffset = (n2 = o2.rect, r2 = e2, n2 ? { left: r2.x - n2.left, top: r2.y - n2.top, right: n2.right - r2.x, bottom: n2.bottom - r2.y } : { left: 0, top: 0, right: 0, bottom: 0 }), this.startDelta = { x: 0, y: 0 };
1467
+ var s2 = this.fillArg({ phase: i2, pageCoords: e2, preEnd: false });
1468
+ return this.result = ye(), this.startAll(s2), this.result = this.setAll(s2);
1469
+ } }, { key: "fillArg", value: function(t3) {
1470
+ var e2 = this.interaction;
1471
+ return t3.interaction = e2, t3.interactable = e2.interactable, t3.element = e2.element, t3.rect || (t3.rect = e2.rect), t3.edges || (t3.edges = this.startEdges), t3.startOffset = this.startOffset, t3;
1472
+ } }, { key: "startAll", value: function(t3) {
1473
+ for (var e2 = 0, n2 = this.states; e2 < n2.length; e2++) {
1474
+ var r2 = n2[e2];
1475
+ r2.methods.start && (t3.state = r2, r2.methods.start(t3));
1476
+ }
1477
+ } }, { key: "setAll", value: function(t3) {
1478
+ var e2 = t3.phase, n2 = t3.preEnd, r2 = t3.skipModifiers, i2 = t3.rect, o2 = t3.edges;
1479
+ t3.coords = V({}, t3.pageCoords), t3.rect = V({}, i2), t3.edges = V({}, o2);
1480
+ for (var a2 = r2 ? this.states.slice(r2) : this.states, s2 = ye(t3.coords, t3.rect), c2 = 0; c2 < a2.length; c2++) {
1481
+ var l2, u2 = a2[c2], p2 = u2.options, f2 = V({}, t3.coords), d2 = null;
1482
+ null != (l2 = u2.methods) && l2.set && this.shouldDo(p2, n2, e2) && (t3.state = u2, d2 = u2.methods.set(t3), H(t3.edges, t3.rect, { x: t3.coords.x - f2.x, y: t3.coords.y - f2.y })), s2.eventProps.push(d2);
1483
+ }
1484
+ V(this.edges, t3.edges), s2.delta.x = t3.coords.x - t3.pageCoords.x, s2.delta.y = t3.coords.y - t3.pageCoords.y, s2.rectDelta.left = t3.rect.left - i2.left, s2.rectDelta.right = t3.rect.right - i2.right, s2.rectDelta.top = t3.rect.top - i2.top, s2.rectDelta.bottom = t3.rect.bottom - i2.bottom;
1485
+ var h2 = this.result.coords, v2 = this.result.rect;
1486
+ if (h2 && v2) {
1487
+ var g2 = s2.rect.left !== v2.left || s2.rect.right !== v2.right || s2.rect.top !== v2.top || s2.rect.bottom !== v2.bottom;
1488
+ s2.changed = g2 || h2.x !== s2.coords.x || h2.y !== s2.coords.y;
1489
+ }
1490
+ return s2;
1491
+ } }, { key: "applyToInteraction", value: function(t3) {
1492
+ var e2 = this.interaction, n2 = t3.phase, r2 = e2.coords.cur, i2 = e2.coords.start, o2 = this.result, a2 = this.startDelta, s2 = o2.delta;
1493
+ "start" === n2 && V(this.startDelta, o2.delta);
1494
+ for (var c2 = 0, l2 = [[i2, a2], [r2, s2]]; c2 < l2.length; c2++) {
1495
+ var u2 = l2[c2], p2 = u2[0], f2 = u2[1];
1496
+ p2.page.x += f2.x, p2.page.y += f2.y, p2.client.x += f2.x, p2.client.y += f2.y;
1497
+ }
1498
+ var d2 = this.result.rectDelta, h2 = t3.rect || e2.rect;
1499
+ h2.left += d2.left, h2.right += d2.right, h2.top += d2.top, h2.bottom += d2.bottom, h2.width = h2.right - h2.left, h2.height = h2.bottom - h2.top;
1500
+ } }, { key: "setAndApply", value: function(t3) {
1501
+ var e2 = this.interaction, n2 = t3.phase, r2 = t3.preEnd, i2 = t3.skipModifiers, o2 = this.setAll(this.fillArg({ preEnd: r2, phase: n2, pageCoords: t3.modifiedCoords || e2.coords.cur.page }));
1502
+ if (this.result = o2, !o2.changed && (!i2 || i2 < this.states.length) && e2.interacting())
1503
+ return false;
1504
+ if (t3.modifiedCoords) {
1505
+ var a2 = e2.coords.cur.page, s2 = { x: t3.modifiedCoords.x - a2.x, y: t3.modifiedCoords.y - a2.y };
1506
+ o2.coords.x += s2.x, o2.coords.y += s2.y, o2.delta.x += s2.x, o2.delta.y += s2.y;
1507
+ }
1508
+ this.applyToInteraction(t3);
1509
+ } }, { key: "beforeEnd", value: function(t3) {
1510
+ var e2 = t3.interaction, n2 = t3.event, r2 = this.states;
1511
+ if (r2 && r2.length) {
1512
+ for (var i2 = false, o2 = 0; o2 < r2.length; o2++) {
1513
+ var a2 = r2[o2];
1514
+ t3.state = a2;
1515
+ var s2 = a2.options, c2 = a2.methods, l2 = c2.beforeEnd && c2.beforeEnd(t3);
1516
+ if (l2)
1517
+ return this.endResult = l2, false;
1518
+ i2 = i2 || !i2 && this.shouldDo(s2, true, t3.phase, true);
1519
+ }
1520
+ i2 && e2.move({ event: n2, preEnd: true });
1521
+ }
1522
+ } }, { key: "stop", value: function(t3) {
1523
+ var e2 = t3.interaction;
1524
+ if (this.states && this.states.length) {
1525
+ var n2 = V({ states: this.states, interactable: e2.interactable, element: e2.element, rect: null }, t3);
1526
+ this.fillArg(n2);
1527
+ for (var r2 = 0, i2 = this.states; r2 < i2.length; r2++) {
1528
+ var o2 = i2[r2];
1529
+ n2.state = o2, o2.methods.stop && o2.methods.stop(n2);
1530
+ }
1531
+ this.states = null, this.endResult = null;
1532
+ }
1533
+ } }, { key: "prepareStates", value: function(t3) {
1534
+ this.states = [];
1535
+ for (var e2 = 0; e2 < t3.length; e2++) {
1536
+ var n2 = t3[e2], r2 = n2.options, i2 = n2.methods, o2 = n2.name;
1537
+ this.states.push({ options: r2, methods: i2, index: e2, name: o2 });
1538
+ }
1539
+ return this.states;
1540
+ } }, { key: "restoreInteractionCoords", value: function(t3) {
1541
+ var e2 = t3.interaction, n2 = e2.coords, r2 = e2.rect, i2 = e2.modification;
1542
+ if (i2.result) {
1543
+ for (var o2 = i2.startDelta, a2 = i2.result, s2 = a2.delta, c2 = a2.rectDelta, l2 = 0, u2 = [[n2.start, o2], [n2.cur, s2]]; l2 < u2.length; l2++) {
1544
+ var p2 = u2[l2], f2 = p2[0], d2 = p2[1];
1545
+ f2.page.x -= d2.x, f2.page.y -= d2.y, f2.client.x -= d2.x, f2.client.y -= d2.y;
1546
+ }
1547
+ r2.left -= c2.left, r2.right -= c2.right, r2.top -= c2.top, r2.bottom -= c2.bottom;
1548
+ }
1549
+ } }, { key: "shouldDo", value: function(t3, e2, n2, r2) {
1550
+ return !(!t3 || false === t3.enabled || r2 && !t3.endOnly || t3.endOnly && !e2 || "start" === n2 && !t3.setStart);
1551
+ } }, { key: "copyFrom", value: function(t3) {
1552
+ this.startOffset = t3.startOffset, this.startDelta = t3.startDelta, this.startEdges = t3.startEdges, this.edges = t3.edges, this.states = t3.states.map(function(t4) {
1553
+ return ge(t4);
1554
+ }), this.result = ye(V({}, t3.result.coords), V({}, t3.result.rect));
1555
+ } }, { key: "destroy", value: function() {
1556
+ for (var t3 in this)
1557
+ this[t3] = null;
1558
+ } }]), t2;
1559
+ }();
1560
+ function ye(t2, e2) {
1561
+ return { rect: e2, coords: t2, delta: { x: 0, y: 0 }, rectDelta: { left: 0, right: 0, top: 0, bottom: 0 }, eventProps: [], changed: true };
1562
+ }
1563
+ function be(t2, e2) {
1564
+ var n2 = t2.defaults, r2 = { start: t2.start, set: t2.set, beforeEnd: t2.beforeEnd, stop: t2.stop }, i2 = function(t3) {
1565
+ var i3 = t3 || {};
1566
+ for (var o2 in i3.enabled = false !== i3.enabled, n2)
1567
+ o2 in i3 || (i3[o2] = n2[o2]);
1568
+ var a2 = { options: i3, methods: r2, name: e2, enable: function() {
1569
+ return i3.enabled = true, a2;
1570
+ }, disable: function() {
1571
+ return i3.enabled = false, a2;
1572
+ } };
1573
+ return a2;
1574
+ };
1575
+ return e2 && "string" == typeof e2 && (i2._defaults = n2, i2._methods = r2), i2;
1576
+ }
1577
+ function xe(t2) {
1578
+ var e2 = t2.iEvent, n2 = t2.interaction.modification.result;
1579
+ n2 && (e2.modifiers = n2.eventProps);
1580
+ }
1581
+ var we = { id: "modifiers/base", before: ["actions"], install: function(t2) {
1582
+ t2.defaults.perAction.modifiers = [];
1583
+ }, listeners: { "interactions:new": function(t2) {
1584
+ var e2 = t2.interaction;
1585
+ e2.modification = new me(e2);
1586
+ }, "interactions:before-action-start": function(t2) {
1587
+ var e2 = t2.interaction, n2 = t2.interaction.modification;
1588
+ n2.start(t2, e2.coords.start.page), e2.edges = n2.edges, n2.applyToInteraction(t2);
1589
+ }, "interactions:before-action-move": function(t2) {
1590
+ var e2 = t2.interaction, n2 = e2.modification, r2 = n2.setAndApply(t2);
1591
+ return e2.edges = n2.edges, r2;
1592
+ }, "interactions:before-action-end": function(t2) {
1593
+ var e2 = t2.interaction, n2 = e2.modification, r2 = n2.beforeEnd(t2);
1594
+ return e2.edges = n2.startEdges, r2;
1595
+ }, "interactions:action-start": xe, "interactions:action-move": xe, "interactions:action-end": xe, "interactions:after-action-start": function(t2) {
1596
+ return t2.interaction.modification.restoreInteractionCoords(t2);
1597
+ }, "interactions:after-action-move": function(t2) {
1598
+ return t2.interaction.modification.restoreInteractionCoords(t2);
1599
+ }, "interactions:stop": function(t2) {
1600
+ return t2.interaction.modification.stop(t2);
1601
+ } } }, Ee = we, Te = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: false, origin: { x: 0, y: 0 } }, actions: {} }, Se = function(t2) {
1602
+ s(n2, t2);
1603
+ var e2 = p(n2);
1604
+ function n2(t3, i2, o2, a2, s2, c2, l2) {
1605
+ var p2;
1606
+ r(this, n2), (p2 = e2.call(this, t3)).relatedTarget = null, p2.screenX = void 0, p2.screenY = void 0, p2.button = void 0, p2.buttons = void 0, p2.ctrlKey = void 0, p2.shiftKey = void 0, p2.altKey = void 0, p2.metaKey = void 0, p2.page = void 0, p2.client = void 0, p2.delta = void 0, p2.rect = void 0, p2.x0 = void 0, p2.y0 = void 0, p2.t0 = void 0, p2.dt = void 0, p2.duration = void 0, p2.clientX0 = void 0, p2.clientY0 = void 0, p2.velocity = void 0, p2.speed = void 0, p2.swipe = void 0, p2.axes = void 0, p2.preEnd = void 0, s2 = s2 || t3.element;
1607
+ var f2 = t3.interactable, d2 = (f2 && f2.options || Te).deltaSource, h2 = K(f2, s2, o2), v2 = "start" === a2, g2 = "end" === a2, m2 = v2 ? u(p2) : t3.prevEvent, y2 = v2 ? t3.coords.start : g2 ? { page: m2.page, client: m2.client, timeStamp: t3.coords.cur.timeStamp } : t3.coords.cur;
1608
+ return p2.page = V({}, y2.page), p2.client = V({}, y2.client), p2.rect = V({}, t3.rect), p2.timeStamp = y2.timeStamp, g2 || (p2.page.x -= h2.x, p2.page.y -= h2.y, p2.client.x -= h2.x, p2.client.y -= h2.y), p2.ctrlKey = i2.ctrlKey, p2.altKey = i2.altKey, p2.shiftKey = i2.shiftKey, p2.metaKey = i2.metaKey, p2.button = i2.button, p2.buttons = i2.buttons, p2.target = s2, p2.currentTarget = s2, p2.preEnd = c2, p2.type = l2 || o2 + (a2 || ""), p2.interactable = f2, p2.t0 = v2 ? t3.pointers[t3.pointers.length - 1].downTime : m2.t0, p2.x0 = t3.coords.start.page.x - h2.x, p2.y0 = t3.coords.start.page.y - h2.y, p2.clientX0 = t3.coords.start.client.x - h2.x, p2.clientY0 = t3.coords.start.client.y - h2.y, p2.delta = v2 || g2 ? { x: 0, y: 0 } : { x: p2[d2].x - m2[d2].x, y: p2[d2].y - m2[d2].y }, p2.dt = t3.coords.delta.timeStamp, p2.duration = p2.timeStamp - p2.t0, p2.velocity = V({}, t3.coords.velocity[d2]), p2.speed = Q(p2.velocity.x, p2.velocity.y), p2.swipe = g2 || "inertiastart" === a2 ? p2.getSwipe() : null, p2;
1609
+ }
1610
+ return o(n2, [{ key: "getSwipe", value: function() {
1611
+ var t3 = this._interaction;
1612
+ if (t3.prevEvent.speed < 600 || this.timeStamp - t3.prevEvent.timeStamp > 150)
1613
+ return null;
1614
+ var e3 = 180 * Math.atan2(t3.prevEvent.velocityY, t3.prevEvent.velocityX) / Math.PI;
1615
+ e3 < 0 && (e3 += 360);
1616
+ var n3 = 112.5 <= e3 && e3 < 247.5, r2 = 202.5 <= e3 && e3 < 337.5;
1617
+ return { up: r2, down: !r2 && 22.5 <= e3 && e3 < 157.5, left: n3, right: !n3 && (292.5 <= e3 || e3 < 67.5), angle: e3, speed: t3.prevEvent.speed, velocity: { x: t3.prevEvent.velocityX, y: t3.prevEvent.velocityY } };
1618
+ } }, { key: "preventDefault", value: function() {
1619
+ } }, { key: "stopImmediatePropagation", value: function() {
1620
+ this.immediatePropagationStopped = this.propagationStopped = true;
1621
+ } }, { key: "stopPropagation", value: function() {
1622
+ this.propagationStopped = true;
1623
+ } }]), n2;
1624
+ }(vt);
1625
+ Object.defineProperties(Se.prototype, { pageX: { get: function() {
1626
+ return this.page.x;
1627
+ }, set: function(t2) {
1628
+ this.page.x = t2;
1629
+ } }, pageY: { get: function() {
1630
+ return this.page.y;
1631
+ }, set: function(t2) {
1632
+ this.page.y = t2;
1633
+ } }, clientX: { get: function() {
1634
+ return this.client.x;
1635
+ }, set: function(t2) {
1636
+ this.client.x = t2;
1637
+ } }, clientY: { get: function() {
1638
+ return this.client.y;
1639
+ }, set: function(t2) {
1640
+ this.client.y = t2;
1641
+ } }, dx: { get: function() {
1642
+ return this.delta.x;
1643
+ }, set: function(t2) {
1644
+ this.delta.x = t2;
1645
+ } }, dy: { get: function() {
1646
+ return this.delta.y;
1647
+ }, set: function(t2) {
1648
+ this.delta.y = t2;
1649
+ } }, velocityX: { get: function() {
1650
+ return this.velocity.x;
1651
+ }, set: function(t2) {
1652
+ this.velocity.x = t2;
1653
+ } }, velocityY: { get: function() {
1654
+ return this.velocity.y;
1655
+ }, set: function(t2) {
1656
+ this.velocity.y = t2;
1657
+ } } });
1658
+ var _e = o(function t2(e2, n2, i2, o2, a2) {
1659
+ r(this, t2), this.id = void 0, this.pointer = void 0, this.event = void 0, this.downTime = void 0, this.downTarget = void 0, this.id = e2, this.pointer = n2, this.event = i2, this.downTime = o2, this.downTarget = a2;
1660
+ }), Pe = function(t2) {
1661
+ return t2.interactable = "", t2.element = "", t2.prepared = "", t2.pointerIsDown = "", t2.pointerWasMoved = "", t2._proxy = "", t2;
1662
+ }({}), Oe = function(t2) {
1663
+ return t2.start = "", t2.move = "", t2.end = "", t2.stop = "", t2.interacting = "", t2;
1664
+ }({}), ke = 0, De = function() {
1665
+ function t2(e2) {
1666
+ var n2 = this, i2 = e2.pointerType, o2 = e2.scopeFire;
1667
+ r(this, t2), this.interactable = null, this.element = null, this.rect = null, this._rects = void 0, this.edges = null, this._scopeFire = void 0, this.prepared = { name: null, axis: null, edges: null }, this.pointerType = void 0, this.pointers = [], this.downEvent = null, this.downPointer = {}, this._latestPointer = { pointer: null, event: null, eventTarget: null }, this.prevEvent = null, this.pointerIsDown = false, this.pointerWasMoved = false, this._interacting = false, this._ending = false, this._stopped = true, this._proxy = void 0, this.simulation = null, this.doMove = Nt(function(t3) {
1668
+ this.move(t3);
1669
+ }, "The interaction.doMove() method has been renamed to interaction.move()"), this.coords = { start: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, prev: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, cur: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, delta: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, velocity: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 } }, this._id = ke++, this._scopeFire = o2, this.pointerType = i2;
1670
+ var a2 = this;
1671
+ this._proxy = {};
1672
+ var s2 = function(t3) {
1673
+ Object.defineProperty(n2._proxy, t3, { get: function() {
1674
+ return a2[t3];
1675
+ } });
1676
+ };
1677
+ for (var c2 in Pe)
1678
+ s2(c2);
1679
+ var l2 = function(t3) {
1680
+ Object.defineProperty(n2._proxy, t3, { value: function() {
1681
+ return a2[t3].apply(a2, arguments);
1682
+ } });
1683
+ };
1684
+ for (var u2 in Oe)
1685
+ l2(u2);
1686
+ this._scopeFire("interactions:new", { interaction: this });
1687
+ }
1688
+ return o(t2, [{ key: "pointerMoveTolerance", get: function() {
1689
+ return 1;
1690
+ } }, { key: "pointerDown", value: function(t3, e2, n2) {
1691
+ var r2 = this.updatePointer(t3, e2, n2, true), i2 = this.pointers[r2];
1692
+ this._scopeFire("interactions:down", { pointer: t3, event: e2, eventTarget: n2, pointerIndex: r2, pointerInfo: i2, type: "down", interaction: this });
1693
+ } }, { key: "start", value: function(t3, e2, n2) {
1694
+ return !(this.interacting() || !this.pointerIsDown || this.pointers.length < ("gesture" === t3.name ? 2 : 1) || !e2.options[t3.name].enabled) && (Ut(this.prepared, t3), this.interactable = e2, this.element = n2, this.rect = e2.getRect(n2), this.edges = this.prepared.edges ? V({}, this.prepared.edges) : { left: true, right: true, top: true, bottom: true }, this._stopped = false, this._interacting = this._doPhase({ interaction: this, event: this.downEvent, phase: "start" }) && !this._stopped, this._interacting);
1695
+ } }, { key: "pointerMove", value: function(t3, e2, n2) {
1696
+ this.simulation || this.modification && this.modification.endResult || this.updatePointer(t3, e2, n2, false);
1697
+ var r2, i2, o2 = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y;
1698
+ this.pointerIsDown && !this.pointerWasMoved && (r2 = this.coords.cur.client.x - this.coords.start.client.x, i2 = this.coords.cur.client.y - this.coords.start.client.y, this.pointerWasMoved = Q(r2, i2) > this.pointerMoveTolerance);
1699
+ var a2, s2, c2, l2 = this.getPointerIndex(t3), u2 = { pointer: t3, pointerIndex: l2, pointerInfo: this.pointers[l2], event: e2, type: "move", eventTarget: n2, dx: r2, dy: i2, duplicate: o2, interaction: this };
1700
+ o2 || (a2 = this.coords.velocity, s2 = this.coords.delta, c2 = Math.max(s2.timeStamp / 1e3, 1e-3), a2.page.x = s2.page.x / c2, a2.page.y = s2.page.y / c2, a2.client.x = s2.client.x / c2, a2.client.y = s2.client.y / c2, a2.timeStamp = c2), this._scopeFire("interactions:move", u2), o2 || this.simulation || (this.interacting() && (u2.type = null, this.move(u2)), this.pointerWasMoved && et(this.coords.prev, this.coords.cur));
1701
+ } }, { key: "move", value: function(t3) {
1702
+ t3 && t3.event || nt(this.coords.delta), (t3 = V({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, t3 || {})).phase = "move", this._doPhase(t3);
1703
+ } }, { key: "pointerUp", value: function(t3, e2, n2, r2) {
1704
+ var i2 = this.getPointerIndex(t3);
1705
+ -1 === i2 && (i2 = this.updatePointer(t3, e2, n2, false));
1706
+ var o2 = /cancel$/i.test(e2.type) ? "cancel" : "up";
1707
+ this._scopeFire("interactions:".concat(o2), { pointer: t3, pointerIndex: i2, pointerInfo: this.pointers[i2], event: e2, eventTarget: n2, type: o2, curEventTarget: r2, interaction: this }), this.simulation || this.end(e2), this.removePointer(t3, e2);
1708
+ } }, { key: "documentBlur", value: function(t3) {
1709
+ this.end(t3), this._scopeFire("interactions:blur", { event: t3, type: "blur", interaction: this });
1710
+ } }, { key: "end", value: function(t3) {
1711
+ var e2;
1712
+ this._ending = true, t3 = t3 || this._latestPointer.event, this.interacting() && (e2 = this._doPhase({ event: t3, interaction: this, phase: "end" })), this._ending = false, true === e2 && this.stop();
1713
+ } }, { key: "currentAction", value: function() {
1714
+ return this._interacting ? this.prepared.name : null;
1715
+ } }, { key: "interacting", value: function() {
1716
+ return this._interacting;
1717
+ } }, { key: "stop", value: function() {
1718
+ this._scopeFire("interactions:stop", { interaction: this }), this.interactable = this.element = null, this._interacting = false, this._stopped = true, this.prepared.name = this.prevEvent = null;
1719
+ } }, { key: "getPointerIndex", value: function(t3) {
1720
+ var e2 = at(t3);
1721
+ return "mouse" === this.pointerType || "pen" === this.pointerType ? this.pointers.length - 1 : yt(this.pointers, function(t4) {
1722
+ return t4.id === e2;
1723
+ });
1724
+ } }, { key: "getPointerInfo", value: function(t3) {
1725
+ return this.pointers[this.getPointerIndex(t3)];
1726
+ } }, { key: "updatePointer", value: function(t3, e2, n2, r2) {
1727
+ var i2, o2, a2, s2 = at(t3), c2 = this.getPointerIndex(t3), l2 = this.pointers[c2];
1728
+ return r2 = false !== r2 && (r2 || /(down|start)$/i.test(e2.type)), l2 ? l2.pointer = t3 : (l2 = new _e(s2, t3, e2, null, null), c2 = this.pointers.length, this.pointers.push(l2)), st(this.coords.cur, this.pointers.map(function(t4) {
1729
+ return t4.pointer;
1730
+ }), this._now()), i2 = this.coords.delta, o2 = this.coords.prev, a2 = this.coords.cur, i2.page.x = a2.page.x - o2.page.x, i2.page.y = a2.page.y - o2.page.y, i2.client.x = a2.client.x - o2.client.x, i2.client.y = a2.client.y - o2.client.y, i2.timeStamp = a2.timeStamp - o2.timeStamp, r2 && (this.pointerIsDown = true, l2.downTime = this.coords.cur.timeStamp, l2.downTarget = n2, tt(this.downPointer, t3), this.interacting() || (et(this.coords.start, this.coords.cur), et(this.coords.prev, this.coords.cur), this.downEvent = e2, this.pointerWasMoved = false)), this._updateLatestPointer(t3, e2, n2), this._scopeFire("interactions:update-pointer", { pointer: t3, event: e2, eventTarget: n2, down: r2, pointerInfo: l2, pointerIndex: c2, interaction: this }), c2;
1731
+ } }, { key: "removePointer", value: function(t3, e2) {
1732
+ var n2 = this.getPointerIndex(t3);
1733
+ if (-1 !== n2) {
1734
+ var r2 = this.pointers[n2];
1735
+ this._scopeFire("interactions:remove-pointer", { pointer: t3, event: e2, eventTarget: null, pointerIndex: n2, pointerInfo: r2, interaction: this }), this.pointers.splice(n2, 1), this.pointerIsDown = false;
1736
+ }
1737
+ } }, { key: "_updateLatestPointer", value: function(t3, e2, n2) {
1738
+ this._latestPointer.pointer = t3, this._latestPointer.event = e2, this._latestPointer.eventTarget = n2;
1739
+ } }, { key: "destroy", value: function() {
1740
+ this._latestPointer.pointer = null, this._latestPointer.event = null, this._latestPointer.eventTarget = null;
1741
+ } }, { key: "_createPreparedEvent", value: function(t3, e2, n2, r2) {
1742
+ return new Se(this, t3, this.prepared.name, e2, this.element, n2, r2);
1743
+ } }, { key: "_fireEvent", value: function(t3) {
1744
+ var e2;
1745
+ null == (e2 = this.interactable) || e2.fire(t3), (!this.prevEvent || t3.timeStamp >= this.prevEvent.timeStamp) && (this.prevEvent = t3);
1746
+ } }, { key: "_doPhase", value: function(t3) {
1747
+ var e2 = t3.event, n2 = t3.phase, r2 = t3.preEnd, i2 = t3.type, o2 = this.rect;
1748
+ if (o2 && "move" === n2 && (H(this.edges, o2, this.coords.delta[this.interactable.options.deltaSource]), o2.width = o2.right - o2.left, o2.height = o2.bottom - o2.top), false === this._scopeFire("interactions:before-action-".concat(n2), t3))
1749
+ return false;
1750
+ var a2 = t3.iEvent = this._createPreparedEvent(e2, n2, r2, i2);
1751
+ return this._scopeFire("interactions:action-".concat(n2), t3), "start" === n2 && (this.prevEvent = a2), this._fireEvent(a2), this._scopeFire("interactions:after-action-".concat(n2), t3), true;
1752
+ } }, { key: "_now", value: function() {
1753
+ return Date.now();
1754
+ } }]), t2;
1755
+ }();
1756
+ function Ie(t2) {
1757
+ Me(t2.interaction);
1758
+ }
1759
+ function Me(t2) {
1760
+ if (!function(t3) {
1761
+ return !(!t3.offset.pending.x && !t3.offset.pending.y);
1762
+ }(t2))
1763
+ return false;
1764
+ var e2 = t2.offset.pending;
1765
+ return Ae(t2.coords.cur, e2), Ae(t2.coords.delta, e2), H(t2.edges, t2.rect, e2), e2.x = 0, e2.y = 0, true;
1766
+ }
1767
+ function ze(t2) {
1768
+ var e2 = t2.x, n2 = t2.y;
1769
+ this.offset.pending.x += e2, this.offset.pending.y += n2, this.offset.total.x += e2, this.offset.total.y += n2;
1770
+ }
1771
+ function Ae(t2, e2) {
1772
+ var n2 = t2.page, r2 = t2.client, i2 = e2.x, o2 = e2.y;
1773
+ n2.x += i2, n2.y += o2, r2.x += i2, r2.y += o2;
1774
+ }
1775
+ Oe.offsetBy = "";
1776
+ var Re = { id: "offset", before: ["modifiers", "pointer-events", "actions", "inertia"], install: function(t2) {
1777
+ t2.Interaction.prototype.offsetBy = ze;
1778
+ }, listeners: { "interactions:new": function(t2) {
1779
+ t2.interaction.offset = { total: { x: 0, y: 0 }, pending: { x: 0, y: 0 } };
1780
+ }, "interactions:update-pointer": function(t2) {
1781
+ return function(t3) {
1782
+ t3.pointerIsDown && (Ae(t3.coords.cur, t3.offset.total), t3.offset.pending.x = 0, t3.offset.pending.y = 0);
1783
+ }(t2.interaction);
1784
+ }, "interactions:before-action-start": Ie, "interactions:before-action-move": Ie, "interactions:before-action-end": function(t2) {
1785
+ var e2 = t2.interaction;
1786
+ if (Me(e2))
1787
+ return e2.move({ offset: true }), e2.end(), false;
1788
+ }, "interactions:stop": function(t2) {
1789
+ var e2 = t2.interaction;
1790
+ e2.offset.total.x = 0, e2.offset.total.y = 0, e2.offset.pending.x = 0, e2.offset.pending.y = 0;
1791
+ } } }, Ce = Re;
1792
+ var je = function() {
1793
+ function t2(e2) {
1794
+ r(this, t2), this.active = false, this.isModified = false, this.smoothEnd = false, this.allowResume = false, this.modification = void 0, this.modifierCount = 0, this.modifierArg = void 0, this.startCoords = void 0, this.t0 = 0, this.v0 = 0, this.te = 0, this.targetOffset = void 0, this.modifiedOffset = void 0, this.currentOffset = void 0, this.lambda_v0 = 0, this.one_ve_v0 = 0, this.timeout = void 0, this.interaction = void 0, this.interaction = e2;
1795
+ }
1796
+ return o(t2, [{ key: "start", value: function(t3) {
1797
+ var e2 = this.interaction, n2 = Fe(e2);
1798
+ if (!n2 || !n2.enabled)
1799
+ return false;
1800
+ var r2 = e2.coords.velocity.client, i2 = Q(r2.x, r2.y), o2 = this.modification || (this.modification = new me(e2));
1801
+ if (o2.copyFrom(e2.modification), this.t0 = e2._now(), this.allowResume = n2.allowResume, this.v0 = i2, this.currentOffset = { x: 0, y: 0 }, this.startCoords = e2.coords.cur.page, this.modifierArg = o2.fillArg({ pageCoords: this.startCoords, preEnd: true, phase: "inertiastart" }), this.t0 - e2.coords.cur.timeStamp < 50 && i2 > n2.minSpeed && i2 > n2.endSpeed)
1802
+ this.startInertia();
1803
+ else {
1804
+ if (o2.result = o2.setAll(this.modifierArg), !o2.result.changed)
1805
+ return false;
1806
+ this.startSmoothEnd();
1807
+ }
1808
+ return e2.modification.result.rect = null, e2.offsetBy(this.targetOffset), e2._doPhase({ interaction: e2, event: t3, phase: "inertiastart" }), e2.offsetBy({ x: -this.targetOffset.x, y: -this.targetOffset.y }), e2.modification.result.rect = null, this.active = true, e2.simulation = this, true;
1809
+ } }, { key: "startInertia", value: function() {
1810
+ var t3 = this, e2 = this.interaction.coords.velocity.client, n2 = Fe(this.interaction), r2 = n2.resistance, i2 = -Math.log(n2.endSpeed / this.v0) / r2;
1811
+ this.targetOffset = { x: (e2.x - i2) / r2, y: (e2.y - i2) / r2 }, this.te = i2, this.lambda_v0 = r2 / this.v0, this.one_ve_v0 = 1 - n2.endSpeed / this.v0;
1812
+ var o2 = this.modification, a2 = this.modifierArg;
1813
+ a2.pageCoords = { x: this.startCoords.x + this.targetOffset.x, y: this.startCoords.y + this.targetOffset.y }, o2.result = o2.setAll(a2), o2.result.changed && (this.isModified = true, this.modifiedOffset = { x: this.targetOffset.x + o2.result.delta.x, y: this.targetOffset.y + o2.result.delta.y }), this.onNextFrame(function() {
1814
+ return t3.inertiaTick();
1815
+ });
1816
+ } }, { key: "startSmoothEnd", value: function() {
1817
+ var t3 = this;
1818
+ this.smoothEnd = true, this.isModified = true, this.targetOffset = { x: this.modification.result.delta.x, y: this.modification.result.delta.y }, this.onNextFrame(function() {
1819
+ return t3.smoothEndTick();
1820
+ });
1821
+ } }, { key: "onNextFrame", value: function(t3) {
1822
+ var e2 = this;
1823
+ this.timeout = Lt.request(function() {
1824
+ e2.active && t3();
1825
+ });
1826
+ } }, { key: "inertiaTick", value: function() {
1827
+ var t3, e2, n2, r2, i2, o2, a2, s2 = this, c2 = this.interaction, l2 = Fe(c2).resistance, u2 = (c2._now() - this.t0) / 1e3;
1828
+ if (u2 < this.te) {
1829
+ var p2, f2 = 1 - (Math.exp(-l2 * u2) - this.lambda_v0) / this.one_ve_v0;
1830
+ this.isModified ? (t3 = 0, e2 = 0, n2 = this.targetOffset.x, r2 = this.targetOffset.y, i2 = this.modifiedOffset.x, o2 = this.modifiedOffset.y, p2 = { x: Ye(a2 = f2, t3, n2, i2), y: Ye(a2, e2, r2, o2) }) : p2 = { x: this.targetOffset.x * f2, y: this.targetOffset.y * f2 };
1831
+ var d2 = { x: p2.x - this.currentOffset.x, y: p2.y - this.currentOffset.y };
1832
+ this.currentOffset.x += d2.x, this.currentOffset.y += d2.y, c2.offsetBy(d2), c2.move(), this.onNextFrame(function() {
1833
+ return s2.inertiaTick();
1834
+ });
1835
+ } else
1836
+ c2.offsetBy({ x: this.modifiedOffset.x - this.currentOffset.x, y: this.modifiedOffset.y - this.currentOffset.y }), this.end();
1837
+ } }, { key: "smoothEndTick", value: function() {
1838
+ var t3 = this, e2 = this.interaction, n2 = e2._now() - this.t0, r2 = Fe(e2).smoothEndDuration;
1839
+ if (n2 < r2) {
1840
+ var i2 = { x: Le(n2, 0, this.targetOffset.x, r2), y: Le(n2, 0, this.targetOffset.y, r2) }, o2 = { x: i2.x - this.currentOffset.x, y: i2.y - this.currentOffset.y };
1841
+ this.currentOffset.x += o2.x, this.currentOffset.y += o2.y, e2.offsetBy(o2), e2.move({ skipModifiers: this.modifierCount }), this.onNextFrame(function() {
1842
+ return t3.smoothEndTick();
1843
+ });
1844
+ } else
1845
+ e2.offsetBy({ x: this.targetOffset.x - this.currentOffset.x, y: this.targetOffset.y - this.currentOffset.y }), this.end();
1846
+ } }, { key: "resume", value: function(t3) {
1847
+ var e2 = t3.pointer, n2 = t3.event, r2 = t3.eventTarget, i2 = this.interaction;
1848
+ i2.offsetBy({ x: -this.currentOffset.x, y: -this.currentOffset.y }), i2.updatePointer(e2, n2, r2, true), i2._doPhase({ interaction: i2, event: n2, phase: "resume" }), et(i2.coords.prev, i2.coords.cur), this.stop();
1849
+ } }, { key: "end", value: function() {
1850
+ this.interaction.move(), this.interaction.end(), this.stop();
1851
+ } }, { key: "stop", value: function() {
1852
+ this.active = this.smoothEnd = false, this.interaction.simulation = null, Lt.cancel(this.timeout);
1853
+ } }]), t2;
1854
+ }();
1855
+ function Fe(t2) {
1856
+ var e2 = t2.interactable, n2 = t2.prepared;
1857
+ return e2 && e2.options && n2.name && e2.options[n2.name].inertia;
1858
+ }
1859
+ var Xe = { id: "inertia", before: ["modifiers", "actions"], install: function(t2) {
1860
+ var e2 = t2.defaults;
1861
+ t2.usePlugin(Ce), t2.usePlugin(Ee), t2.actions.phases.inertiastart = true, t2.actions.phases.resume = true, e2.perAction.inertia = { enabled: false, resistance: 10, minSpeed: 100, endSpeed: 10, allowResume: true, smoothEndDuration: 300 };
1862
+ }, listeners: { "interactions:new": function(t2) {
1863
+ var e2 = t2.interaction;
1864
+ e2.inertia = new je(e2);
1865
+ }, "interactions:before-action-end": function(t2) {
1866
+ var e2 = t2.interaction, n2 = t2.event;
1867
+ return (!e2._interacting || e2.simulation || !e2.inertia.start(n2)) && null;
1868
+ }, "interactions:down": function(t2) {
1869
+ var e2 = t2.interaction, n2 = t2.eventTarget, r2 = e2.inertia;
1870
+ if (r2.active)
1871
+ for (var i2 = n2; w.element(i2); ) {
1872
+ if (i2 === e2.element) {
1873
+ r2.resume(t2);
1874
+ break;
1875
+ }
1876
+ i2 = A(i2);
1877
+ }
1878
+ }, "interactions:stop": function(t2) {
1879
+ var e2 = t2.interaction.inertia;
1880
+ e2.active && e2.stop();
1881
+ }, "interactions:before-action-resume": function(t2) {
1882
+ var e2 = t2.interaction.modification;
1883
+ e2.stop(t2), e2.start(t2, t2.interaction.coords.cur.page), e2.applyToInteraction(t2);
1884
+ }, "interactions:before-action-inertiastart": function(t2) {
1885
+ return t2.interaction.modification.setAndApply(t2);
1886
+ }, "interactions:action-resume": xe, "interactions:action-inertiastart": xe, "interactions:after-action-inertiastart": function(t2) {
1887
+ return t2.interaction.modification.restoreInteractionCoords(t2);
1888
+ }, "interactions:after-action-resume": function(t2) {
1889
+ return t2.interaction.modification.restoreInteractionCoords(t2);
1890
+ } } };
1891
+ function Ye(t2, e2, n2, r2) {
1892
+ var i2 = 1 - t2;
1893
+ return i2 * i2 * e2 + 2 * i2 * t2 * n2 + t2 * t2 * r2;
1894
+ }
1895
+ function Le(t2, e2, n2, r2) {
1896
+ return -n2 * (t2 /= r2) * (t2 - 2) + e2;
1897
+ }
1898
+ var qe = Xe;
1899
+ function Be(t2, e2) {
1900
+ for (var n2 = 0; n2 < e2.length; n2++) {
1901
+ var r2 = e2[n2];
1902
+ if (t2.immediatePropagationStopped)
1903
+ break;
1904
+ r2(t2);
1905
+ }
1906
+ }
1907
+ var Ve = function() {
1908
+ function t2(e2) {
1909
+ r(this, t2), this.options = void 0, this.types = {}, this.propagationStopped = false, this.immediatePropagationStopped = false, this.global = void 0, this.options = V({}, e2 || {});
1910
+ }
1911
+ return o(t2, [{ key: "fire", value: function(t3) {
1912
+ var e2, n2 = this.global;
1913
+ (e2 = this.types[t3.type]) && Be(t3, e2), !t3.propagationStopped && n2 && (e2 = n2[t3.type]) && Be(t3, e2);
1914
+ } }, { key: "on", value: function(t3, e2) {
1915
+ var n2 = $(t3, e2);
1916
+ for (t3 in n2)
1917
+ this.types[t3] = gt(this.types[t3] || [], n2[t3]);
1918
+ } }, { key: "off", value: function(t3, e2) {
1919
+ var n2 = $(t3, e2);
1920
+ for (t3 in n2) {
1921
+ var r2 = this.types[t3];
1922
+ if (r2 && r2.length)
1923
+ for (var i2 = 0, o2 = n2[t3]; i2 < o2.length; i2++) {
1924
+ var a2 = o2[i2], s2 = r2.indexOf(a2);
1925
+ -1 !== s2 && r2.splice(s2, 1);
1926
+ }
1927
+ }
1928
+ } }, { key: "getRect", value: function(t3) {
1929
+ return null;
1930
+ } }]), t2;
1931
+ }();
1932
+ var We = function() {
1933
+ function t2(e2) {
1934
+ r(this, t2), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e2, tt(this, e2);
1935
+ }
1936
+ return o(t2, [{ key: "preventOriginalDefault", value: function() {
1937
+ this.originalEvent.preventDefault();
1938
+ } }, { key: "stopPropagation", value: function() {
1939
+ this.originalEvent.stopPropagation();
1940
+ } }, { key: "stopImmediatePropagation", value: function() {
1941
+ this.originalEvent.stopImmediatePropagation();
1942
+ } }]), t2;
1943
+ }();
1944
+ function Ge(t2) {
1945
+ return w.object(t2) ? { capture: !!t2.capture, passive: !!t2.passive } : { capture: !!t2, passive: false };
1946
+ }
1947
+ function Ne(t2, e2) {
1948
+ return t2 === e2 || ("boolean" == typeof t2 ? !!e2.capture === t2 && false == !!e2.passive : !!t2.capture == !!e2.capture && !!t2.passive == !!e2.passive);
1949
+ }
1950
+ var Ue = { id: "events", install: function(t2) {
1951
+ var e2, n2 = [], r2 = {}, i2 = [], o2 = { add: a2, remove: s2, addDelegate: function(t3, e3, n3, o3, s3) {
1952
+ var u2 = Ge(s3);
1953
+ if (!r2[n3]) {
1954
+ r2[n3] = [];
1955
+ for (var p2 = 0; p2 < i2.length; p2++) {
1956
+ var f2 = i2[p2];
1957
+ a2(f2, n3, c2), a2(f2, n3, l2, true);
1958
+ }
1959
+ }
1960
+ var d2 = r2[n3], h2 = bt(d2, function(n4) {
1961
+ return n4.selector === t3 && n4.context === e3;
1962
+ });
1963
+ h2 || (h2 = { selector: t3, context: e3, listeners: [] }, d2.push(h2));
1964
+ h2.listeners.push({ func: o3, options: u2 });
1965
+ }, removeDelegate: function(t3, e3, n3, i3, o3) {
1966
+ var a3, u2 = Ge(o3), p2 = r2[n3], f2 = false;
1967
+ if (!p2)
1968
+ return;
1969
+ for (a3 = p2.length - 1; a3 >= 0; a3--) {
1970
+ var d2 = p2[a3];
1971
+ if (d2.selector === t3 && d2.context === e3) {
1972
+ for (var h2 = d2.listeners, v2 = h2.length - 1; v2 >= 0; v2--) {
1973
+ var g2 = h2[v2];
1974
+ if (g2.func === i3 && Ne(g2.options, u2)) {
1975
+ h2.splice(v2, 1), h2.length || (p2.splice(a3, 1), s2(e3, n3, c2), s2(e3, n3, l2, true)), f2 = true;
1976
+ break;
1977
+ }
1978
+ }
1979
+ if (f2)
1980
+ break;
1981
+ }
1982
+ }
1983
+ }, delegateListener: c2, delegateUseCapture: l2, delegatedEvents: r2, documents: i2, targets: n2, supportsOptions: false, supportsPassive: false };
1984
+ function a2(t3, e3, r3, i3) {
1985
+ if (t3.addEventListener) {
1986
+ var a3 = Ge(i3), s3 = bt(n2, function(e4) {
1987
+ return e4.eventTarget === t3;
1988
+ });
1989
+ s3 || (s3 = { eventTarget: t3, events: {} }, n2.push(s3)), s3.events[e3] || (s3.events[e3] = []), bt(s3.events[e3], function(t4) {
1990
+ return t4.func === r3 && Ne(t4.options, a3);
1991
+ }) || (t3.addEventListener(e3, r3, o2.supportsOptions ? a3 : a3.capture), s3.events[e3].push({ func: r3, options: a3 }));
1992
+ }
1993
+ }
1994
+ function s2(t3, e3, r3, i3) {
1995
+ if (t3.addEventListener && t3.removeEventListener) {
1996
+ var a3 = yt(n2, function(e4) {
1997
+ return e4.eventTarget === t3;
1998
+ }), c3 = n2[a3];
1999
+ if (c3 && c3.events)
2000
+ if ("all" !== e3) {
2001
+ var l3 = false, u2 = c3.events[e3];
2002
+ if (u2) {
2003
+ if ("all" === r3) {
2004
+ for (var p2 = u2.length - 1; p2 >= 0; p2--) {
2005
+ var f2 = u2[p2];
2006
+ s2(t3, e3, f2.func, f2.options);
2007
+ }
2008
+ return;
2009
+ }
2010
+ for (var d2 = Ge(i3), h2 = 0; h2 < u2.length; h2++) {
2011
+ var v2 = u2[h2];
2012
+ if (v2.func === r3 && Ne(v2.options, d2)) {
2013
+ t3.removeEventListener(e3, r3, o2.supportsOptions ? d2 : d2.capture), u2.splice(h2, 1), 0 === u2.length && (delete c3.events[e3], l3 = true);
2014
+ break;
2015
+ }
2016
+ }
2017
+ }
2018
+ l3 && !Object.keys(c3.events).length && n2.splice(a3, 1);
2019
+ } else
2020
+ for (e3 in c3.events)
2021
+ c3.events.hasOwnProperty(e3) && s2(t3, e3, "all");
2022
+ }
2023
+ }
2024
+ function c2(t3, e3) {
2025
+ for (var n3 = Ge(e3), i3 = new We(t3), o3 = r2[t3.type], a3 = ht(t3)[0], s3 = a3; w.element(s3); ) {
2026
+ for (var c3 = 0; c3 < o3.length; c3++) {
2027
+ var l3 = o3[c3], u2 = l3.selector, p2 = l3.context;
2028
+ if (R(s3, u2) && M(p2, a3) && M(p2, s3)) {
2029
+ var f2 = l3.listeners;
2030
+ i3.currentTarget = s3;
2031
+ for (var d2 = 0; d2 < f2.length; d2++) {
2032
+ var h2 = f2[d2];
2033
+ Ne(h2.options, n3) && h2.func(i3);
2034
+ }
2035
+ }
2036
+ }
2037
+ s3 = A(s3);
2038
+ }
2039
+ }
2040
+ function l2(t3) {
2041
+ return c2(t3, true);
2042
+ }
2043
+ return null == (e2 = t2.document) || e2.createElement("div").addEventListener("test", null, { get capture() {
2044
+ return o2.supportsOptions = true;
2045
+ }, get passive() {
2046
+ return o2.supportsPassive = true;
2047
+ } }), t2.events = o2, o2;
2048
+ } }, He = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function(t2) {
2049
+ for (var e2 = 0, n2 = He.methodOrder; e2 < n2.length; e2++) {
2050
+ var r2 = n2[e2], i2 = He[r2](t2);
2051
+ if (i2)
2052
+ return i2;
2053
+ }
2054
+ return null;
2055
+ }, simulationResume: function(t2) {
2056
+ var e2 = t2.pointerType, n2 = t2.eventType, r2 = t2.eventTarget, i2 = t2.scope;
2057
+ if (!/down|start/i.test(n2))
2058
+ return null;
2059
+ for (var o2 = 0, a2 = i2.interactions.list; o2 < a2.length; o2++) {
2060
+ var s2 = a2[o2], c2 = r2;
2061
+ if (s2.simulation && s2.simulation.allowResume && s2.pointerType === e2)
2062
+ for (; c2; ) {
2063
+ if (c2 === s2.element)
2064
+ return s2;
2065
+ c2 = A(c2);
2066
+ }
2067
+ }
2068
+ return null;
2069
+ }, mouseOrPen: function(t2) {
2070
+ var e2, n2 = t2.pointerId, r2 = t2.pointerType, i2 = t2.eventType, o2 = t2.scope;
2071
+ if ("mouse" !== r2 && "pen" !== r2)
2072
+ return null;
2073
+ for (var a2 = 0, s2 = o2.interactions.list; a2 < s2.length; a2++) {
2074
+ var c2 = s2[a2];
2075
+ if (c2.pointerType === r2) {
2076
+ if (c2.simulation && !Ke(c2, n2))
2077
+ continue;
2078
+ if (c2.interacting())
2079
+ return c2;
2080
+ e2 || (e2 = c2);
2081
+ }
2082
+ }
2083
+ if (e2)
2084
+ return e2;
2085
+ for (var l2 = 0, u2 = o2.interactions.list; l2 < u2.length; l2++) {
2086
+ var p2 = u2[l2];
2087
+ if (!(p2.pointerType !== r2 || /down/i.test(i2) && p2.simulation))
2088
+ return p2;
2089
+ }
2090
+ return null;
2091
+ }, hasPointer: function(t2) {
2092
+ for (var e2 = t2.pointerId, n2 = 0, r2 = t2.scope.interactions.list; n2 < r2.length; n2++) {
2093
+ var i2 = r2[n2];
2094
+ if (Ke(i2, e2))
2095
+ return i2;
2096
+ }
2097
+ return null;
2098
+ }, idle: function(t2) {
2099
+ for (var e2 = t2.pointerType, n2 = 0, r2 = t2.scope.interactions.list; n2 < r2.length; n2++) {
2100
+ var i2 = r2[n2];
2101
+ if (1 === i2.pointers.length) {
2102
+ var o2 = i2.interactable;
2103
+ if (o2 && (!o2.options.gesture || !o2.options.gesture.enabled))
2104
+ continue;
2105
+ } else if (i2.pointers.length >= 2)
2106
+ continue;
2107
+ if (!i2.interacting() && e2 === i2.pointerType)
2108
+ return i2;
2109
+ }
2110
+ return null;
2111
+ } };
2112
+ function Ke(t2, e2) {
2113
+ return t2.pointers.some(function(t3) {
2114
+ return t3.id === e2;
2115
+ });
2116
+ }
2117
+ var $e = He, Je = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
2118
+ function Qe(t2, e2) {
2119
+ return function(n2) {
2120
+ var r2 = e2.interactions.list, i2 = dt(n2), o2 = ht(n2), a2 = o2[0], s2 = o2[1], c2 = [];
2121
+ if (/^touch/.test(n2.type)) {
2122
+ e2.prevTouchTime = e2.now();
2123
+ for (var l2 = 0, u2 = n2.changedTouches; l2 < u2.length; l2++) {
2124
+ var p2 = u2[l2], f2 = { pointer: p2, pointerId: at(p2), pointerType: i2, eventType: n2.type, eventTarget: a2, curEventTarget: s2, scope: e2 }, d2 = Ze(f2);
2125
+ c2.push([f2.pointer, f2.eventTarget, f2.curEventTarget, d2]);
2126
+ }
2127
+ } else {
2128
+ var h2 = false;
2129
+ if (!I.supportsPointerEvent && /mouse/.test(n2.type)) {
2130
+ for (var v2 = 0; v2 < r2.length && !h2; v2++)
2131
+ h2 = "mouse" !== r2[v2].pointerType && r2[v2].pointerIsDown;
2132
+ h2 = h2 || e2.now() - e2.prevTouchTime < 500 || 0 === n2.timeStamp;
2133
+ }
2134
+ if (!h2) {
2135
+ var g2 = { pointer: n2, pointerId: at(n2), pointerType: i2, eventType: n2.type, curEventTarget: s2, eventTarget: a2, scope: e2 }, m2 = Ze(g2);
2136
+ c2.push([g2.pointer, g2.eventTarget, g2.curEventTarget, m2]);
2137
+ }
2138
+ }
2139
+ for (var y2 = 0; y2 < c2.length; y2++) {
2140
+ var b2 = c2[y2], x2 = b2[0], w2 = b2[1], E2 = b2[2];
2141
+ b2[3][t2](x2, n2, w2, E2);
2142
+ }
2143
+ };
2144
+ }
2145
+ function Ze(t2) {
2146
+ var e2 = t2.pointerType, n2 = t2.scope, r2 = { interaction: $e.search(t2), searchDetails: t2 };
2147
+ return n2.fire("interactions:find", r2), r2.interaction || n2.interactions.new({ pointerType: e2 });
2148
+ }
2149
+ function tn(t2, e2) {
2150
+ var n2 = t2.doc, r2 = t2.scope, i2 = t2.options, o2 = r2.interactions.docEvents, a2 = r2.events, s2 = a2[e2];
2151
+ for (var c2 in r2.browser.isIOS && !i2.events && (i2.events = { passive: false }), a2.delegatedEvents)
2152
+ s2(n2, c2, a2.delegateListener), s2(n2, c2, a2.delegateUseCapture, true);
2153
+ for (var l2 = i2 && i2.events, u2 = 0; u2 < o2.length; u2++) {
2154
+ var p2 = o2[u2];
2155
+ s2(n2, p2.type, p2.listener, l2);
2156
+ }
2157
+ }
2158
+ var en = { id: "core/interactions", install: function(t2) {
2159
+ for (var e2 = {}, n2 = 0; n2 < Je.length; n2++) {
2160
+ var i2 = Je[n2];
2161
+ e2[i2] = Qe(i2, t2);
2162
+ }
2163
+ var a2, c2 = I.pEventTypes;
2164
+ function l2() {
2165
+ for (var e3 = 0, n3 = t2.interactions.list; e3 < n3.length; e3++) {
2166
+ var r2 = n3[e3];
2167
+ if (r2.pointerIsDown && "touch" === r2.pointerType && !r2._interacting)
2168
+ for (var i3 = function() {
2169
+ var e4 = a3[o2];
2170
+ t2.documents.some(function(t3) {
2171
+ return M(t3.doc, e4.downTarget);
2172
+ }) || r2.removePointer(e4.pointer, e4.event);
2173
+ }, o2 = 0, a3 = r2.pointers; o2 < a3.length; o2++)
2174
+ i3();
2175
+ }
2176
+ }
2177
+ (a2 = k.PointerEvent ? [{ type: c2.down, listener: l2 }, { type: c2.down, listener: e2.pointerDown }, { type: c2.move, listener: e2.pointerMove }, { type: c2.up, listener: e2.pointerUp }, { type: c2.cancel, listener: e2.pointerUp }] : [{ type: "mousedown", listener: e2.pointerDown }, { type: "mousemove", listener: e2.pointerMove }, { type: "mouseup", listener: e2.pointerUp }, { type: "touchstart", listener: l2 }, { type: "touchstart", listener: e2.pointerDown }, { type: "touchmove", listener: e2.pointerMove }, { type: "touchend", listener: e2.pointerUp }, { type: "touchcancel", listener: e2.pointerUp }]).push({ type: "blur", listener: function(e3) {
2178
+ for (var n3 = 0, r2 = t2.interactions.list; n3 < r2.length; n3++) {
2179
+ r2[n3].documentBlur(e3);
2180
+ }
2181
+ } }), t2.prevTouchTime = 0, t2.Interaction = function(e3) {
2182
+ s(i3, e3);
2183
+ var n3 = p(i3);
2184
+ function i3() {
2185
+ return r(this, i3), n3.apply(this, arguments);
2186
+ }
2187
+ return o(i3, [{ key: "pointerMoveTolerance", get: function() {
2188
+ return t2.interactions.pointerMoveTolerance;
2189
+ }, set: function(e4) {
2190
+ t2.interactions.pointerMoveTolerance = e4;
2191
+ } }, { key: "_now", value: function() {
2192
+ return t2.now();
2193
+ } }]), i3;
2194
+ }(De), t2.interactions = { list: [], new: function(e3) {
2195
+ e3.scopeFire = function(e4, n4) {
2196
+ return t2.fire(e4, n4);
2197
+ };
2198
+ var n3 = new t2.Interaction(e3);
2199
+ return t2.interactions.list.push(n3), n3;
2200
+ }, listeners: e2, docEvents: a2, pointerMoveTolerance: 1 }, t2.usePlugin(he);
2201
+ }, listeners: { "scope:add-document": function(t2) {
2202
+ return tn(t2, "add");
2203
+ }, "scope:remove-document": function(t2) {
2204
+ return tn(t2, "remove");
2205
+ }, "interactable:unset": function(t2, e2) {
2206
+ for (var n2 = t2.interactable, r2 = e2.interactions.list.length - 1; r2 >= 0; r2--) {
2207
+ var i2 = e2.interactions.list[r2];
2208
+ i2.interactable === n2 && (i2.stop(), e2.fire("interactions:destroy", { interaction: i2 }), i2.destroy(), e2.interactions.list.length > 2 && e2.interactions.list.splice(r2, 1));
2209
+ }
2210
+ } }, onDocSignal: tn, doOnInteractions: Qe, methodNames: Je }, nn = en, rn = function(t2) {
2211
+ return t2[t2.On = 0] = "On", t2[t2.Off = 1] = "Off", t2;
2212
+ }(rn || {}), on = function() {
2213
+ function t2(e2, n2, i2, o2) {
2214
+ r(this, t2), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new Ve(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n2.actions, this.target = e2, this._context = n2.context || i2, this._win = y(B(e2) ? this._context : e2), this._doc = this._win.document, this._scopeEvents = o2, this.set(n2);
2215
+ }
2216
+ return o(t2, [{ key: "_defaults", get: function() {
2217
+ return { base: {}, perAction: {}, actions: {} };
2218
+ } }, { key: "setOnEvents", value: function(t3, e2) {
2219
+ return w.func(e2.onstart) && this.on("".concat(t3, "start"), e2.onstart), w.func(e2.onmove) && this.on("".concat(t3, "move"), e2.onmove), w.func(e2.onend) && this.on("".concat(t3, "end"), e2.onend), w.func(e2.oninertiastart) && this.on("".concat(t3, "inertiastart"), e2.oninertiastart), this;
2220
+ } }, { key: "updatePerActionListeners", value: function(t3, e2, n2) {
2221
+ var r2, i2 = this, o2 = null == (r2 = this._actions.map[t3]) ? void 0 : r2.filterEventType, a2 = function(t4) {
2222
+ return (null == o2 || o2(t4)) && ve(t4, i2._actions);
2223
+ };
2224
+ (w.array(e2) || w.object(e2)) && this._onOff(rn.Off, t3, e2, void 0, a2), (w.array(n2) || w.object(n2)) && this._onOff(rn.On, t3, n2, void 0, a2);
2225
+ } }, { key: "setPerAction", value: function(t3, e2) {
2226
+ var n2 = this._defaults;
2227
+ for (var r2 in e2) {
2228
+ var i2 = r2, o2 = this.options[t3], a2 = e2[i2];
2229
+ "listeners" === i2 && this.updatePerActionListeners(t3, o2.listeners, a2), w.array(a2) ? o2[i2] = mt(a2) : w.plainObject(a2) ? (o2[i2] = V(o2[i2] || {}, ge(a2)), w.object(n2.perAction[i2]) && "enabled" in n2.perAction[i2] && (o2[i2].enabled = false !== a2.enabled)) : w.bool(a2) && w.object(n2.perAction[i2]) ? o2[i2].enabled = a2 : o2[i2] = a2;
2230
+ }
2231
+ } }, { key: "getRect", value: function(t3) {
2232
+ return t3 = t3 || (w.element(this.target) ? this.target : null), w.string(this.target) && (t3 = t3 || this._context.querySelector(this.target)), L(t3);
2233
+ } }, { key: "rectChecker", value: function(t3) {
2234
+ var e2 = this;
2235
+ return w.func(t3) ? (this.getRect = function(n2) {
2236
+ var r2 = V({}, t3.apply(e2, n2));
2237
+ return "width" in r2 || (r2.width = r2.right - r2.left, r2.height = r2.bottom - r2.top), r2;
2238
+ }, this) : null === t3 ? (delete this.getRect, this) : this.getRect;
2239
+ } }, { key: "_backCompatOption", value: function(t3, e2) {
2240
+ if (B(e2) || w.object(e2)) {
2241
+ for (var n2 in this.options[t3] = e2, this._actions.map)
2242
+ this.options[n2][t3] = e2;
2243
+ return this;
2244
+ }
2245
+ return this.options[t3];
2246
+ } }, { key: "origin", value: function(t3) {
2247
+ return this._backCompatOption("origin", t3);
2248
+ } }, { key: "deltaSource", value: function(t3) {
2249
+ return "page" === t3 || "client" === t3 ? (this.options.deltaSource = t3, this) : this.options.deltaSource;
2250
+ } }, { key: "getAllElements", value: function() {
2251
+ var t3 = this.target;
2252
+ return w.string(t3) ? Array.from(this._context.querySelectorAll(t3)) : w.func(t3) && t3.getAllElements ? t3.getAllElements() : w.element(t3) ? [t3] : [];
2253
+ } }, { key: "context", value: function() {
2254
+ return this._context;
2255
+ } }, { key: "inContext", value: function(t3) {
2256
+ return this._context === t3.ownerDocument || M(this._context, t3);
2257
+ } }, { key: "testIgnoreAllow", value: function(t3, e2, n2) {
2258
+ return !this.testIgnore(t3.ignoreFrom, e2, n2) && this.testAllow(t3.allowFrom, e2, n2);
2259
+ } }, { key: "testAllow", value: function(t3, e2, n2) {
2260
+ return !t3 || !!w.element(n2) && (w.string(t3) ? F(n2, t3, e2) : !!w.element(t3) && M(t3, n2));
2261
+ } }, { key: "testIgnore", value: function(t3, e2, n2) {
2262
+ return !(!t3 || !w.element(n2)) && (w.string(t3) ? F(n2, t3, e2) : !!w.element(t3) && M(t3, n2));
2263
+ } }, { key: "fire", value: function(t3) {
2264
+ return this.events.fire(t3), this;
2265
+ } }, { key: "_onOff", value: function(t3, e2, n2, r2, i2) {
2266
+ w.object(e2) && !w.array(e2) && (r2 = n2, n2 = null);
2267
+ var o2 = $(e2, n2, i2);
2268
+ for (var a2 in o2) {
2269
+ "wheel" === a2 && (a2 = I.wheelEvent);
2270
+ for (var s2 = 0, c2 = o2[a2]; s2 < c2.length; s2++) {
2271
+ var l2 = c2[s2];
2272
+ ve(a2, this._actions) ? this.events[t3 === rn.On ? "on" : "off"](a2, l2) : w.string(this.target) ? this._scopeEvents[t3 === rn.On ? "addDelegate" : "removeDelegate"](this.target, this._context, a2, l2, r2) : this._scopeEvents[t3 === rn.On ? "add" : "remove"](this.target, a2, l2, r2);
2273
+ }
2274
+ }
2275
+ return this;
2276
+ } }, { key: "on", value: function(t3, e2, n2) {
2277
+ return this._onOff(rn.On, t3, e2, n2);
2278
+ } }, { key: "off", value: function(t3, e2, n2) {
2279
+ return this._onOff(rn.Off, t3, e2, n2);
2280
+ } }, { key: "set", value: function(t3) {
2281
+ var e2 = this._defaults;
2282
+ for (var n2 in w.object(t3) || (t3 = {}), this.options = ge(e2.base), this._actions.methodDict) {
2283
+ var r2 = n2, i2 = this._actions.methodDict[r2];
2284
+ this.options[r2] = {}, this.setPerAction(r2, V(V({}, e2.perAction), e2.actions[r2])), this[i2](t3[r2]);
2285
+ }
2286
+ for (var o2 in t3)
2287
+ "getRect" !== o2 ? w.func(this[o2]) && this[o2](t3[o2]) : this.rectChecker(t3.getRect);
2288
+ return this;
2289
+ } }, { key: "unset", value: function() {
2290
+ if (w.string(this.target))
2291
+ for (var t3 in this._scopeEvents.delegatedEvents)
2292
+ for (var e2 = this._scopeEvents.delegatedEvents[t3], n2 = e2.length - 1; n2 >= 0; n2--) {
2293
+ var r2 = e2[n2], i2 = r2.selector, o2 = r2.context, a2 = r2.listeners;
2294
+ i2 === this.target && o2 === this._context && e2.splice(n2, 1);
2295
+ for (var s2 = a2.length - 1; s2 >= 0; s2--)
2296
+ this._scopeEvents.removeDelegate(this.target, this._context, t3, a2[s2][0], a2[s2][1]);
2297
+ }
2298
+ else
2299
+ this._scopeEvents.remove(this.target, "all");
2300
+ } }]), t2;
2301
+ }(), an = function() {
2302
+ function t2(e2) {
2303
+ var n2 = this;
2304
+ r(this, t2), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e2, e2.addListeners({ "interactable:unset": function(t3) {
2305
+ var e3 = t3.interactable, r2 = e3.target, i2 = w.string(r2) ? n2.selectorMap[r2] : r2[n2.scope.id], o2 = yt(i2, function(t4) {
2306
+ return t4 === e3;
2307
+ });
2308
+ i2.splice(o2, 1);
2309
+ } });
2310
+ }
2311
+ return o(t2, [{ key: "new", value: function(t3, e2) {
2312
+ e2 = V(e2 || {}, { actions: this.scope.actions });
2313
+ var n2 = new this.scope.Interactable(t3, e2, this.scope.document, this.scope.events);
2314
+ return this.scope.addDocument(n2._doc), this.list.push(n2), w.string(t3) ? (this.selectorMap[t3] || (this.selectorMap[t3] = []), this.selectorMap[t3].push(n2)) : (n2.target[this.scope.id] || Object.defineProperty(t3, this.scope.id, { value: [], configurable: true }), t3[this.scope.id].push(n2)), this.scope.fire("interactable:new", { target: t3, options: e2, interactable: n2, win: this.scope._win }), n2;
2315
+ } }, { key: "getExisting", value: function(t3, e2) {
2316
+ var n2 = e2 && e2.context || this.scope.document, r2 = w.string(t3), i2 = r2 ? this.selectorMap[t3] : t3[this.scope.id];
2317
+ if (i2)
2318
+ return bt(i2, function(e3) {
2319
+ return e3._context === n2 && (r2 || e3.inContext(t3));
2320
+ });
2321
+ } }, { key: "forEachMatch", value: function(t3, e2) {
2322
+ for (var n2 = 0, r2 = this.list; n2 < r2.length; n2++) {
2323
+ var i2 = r2[n2], o2 = void 0;
2324
+ if ((w.string(i2.target) ? w.element(t3) && R(t3, i2.target) : t3 === i2.target) && i2.inContext(t3) && (o2 = e2(i2)), void 0 !== o2)
2325
+ return o2;
2326
+ }
2327
+ } }]), t2;
2328
+ }();
2329
+ var sn = function() {
2330
+ function t2() {
2331
+ var e2 = this;
2332
+ r(this, t2), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = false, this.listenerMaps = [], this.browser = I, this.defaults = ge(Te), this.Eventable = Ve, this.actions = { map: {}, phases: { start: true, move: true, end: true }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = function(t3) {
2333
+ var e3 = function e4(n3, r2) {
2334
+ var i2 = t3.interactables.getExisting(n3, r2);
2335
+ return i2 || ((i2 = t3.interactables.new(n3, r2)).events.global = e4.globalEvents), i2;
2336
+ };
2337
+ return e3.getPointerAverage = lt, e3.getTouchBBox = ut, e3.getTouchDistance = pt, e3.getTouchAngle = ft, e3.getElementRect = L, e3.getElementClientRect = Y, e3.matchesSelector = R, e3.closest = z, e3.globalEvents = {}, e3.version = "1.10.27", e3.scope = t3, e3.use = function(t4, e4) {
2338
+ return this.scope.usePlugin(t4, e4), this;
2339
+ }, e3.isSet = function(t4, e4) {
2340
+ return !!this.scope.interactables.get(t4, e4 && e4.context);
2341
+ }, e3.on = Nt(function(t4, e4, n3) {
2342
+ if (w.string(t4) && -1 !== t4.search(" ") && (t4 = t4.trim().split(/ +/)), w.array(t4)) {
2343
+ for (var r2 = 0, i2 = t4; r2 < i2.length; r2++) {
2344
+ var o2 = i2[r2];
2345
+ this.on(o2, e4, n3);
2346
+ }
2347
+ return this;
2348
+ }
2349
+ if (w.object(t4)) {
2350
+ for (var a2 in t4)
2351
+ this.on(a2, t4[a2], e4);
2352
+ return this;
2353
+ }
2354
+ return ve(t4, this.scope.actions) ? this.globalEvents[t4] ? this.globalEvents[t4].push(e4) : this.globalEvents[t4] = [e4] : this.scope.events.add(this.scope.document, t4, e4, { options: n3 }), this;
2355
+ }, "The interact.on() method is being deprecated"), e3.off = Nt(function(t4, e4, n3) {
2356
+ if (w.string(t4) && -1 !== t4.search(" ") && (t4 = t4.trim().split(/ +/)), w.array(t4)) {
2357
+ for (var r2 = 0, i2 = t4; r2 < i2.length; r2++) {
2358
+ var o2 = i2[r2];
2359
+ this.off(o2, e4, n3);
2360
+ }
2361
+ return this;
2362
+ }
2363
+ if (w.object(t4)) {
2364
+ for (var a2 in t4)
2365
+ this.off(a2, t4[a2], e4);
2366
+ return this;
2367
+ }
2368
+ var s2;
2369
+ return ve(t4, this.scope.actions) ? t4 in this.globalEvents && -1 !== (s2 = this.globalEvents[t4].indexOf(e4)) && this.globalEvents[t4].splice(s2, 1) : this.scope.events.remove(this.scope.document, t4, e4, n3), this;
2370
+ }, "The interact.off() method is being deprecated"), e3.debug = function() {
2371
+ return this.scope;
2372
+ }, e3.supportsTouch = function() {
2373
+ return I.supportsTouch;
2374
+ }, e3.supportsPointerEvent = function() {
2375
+ return I.supportsPointerEvent;
2376
+ }, e3.stop = function() {
2377
+ for (var t4 = 0, e4 = this.scope.interactions.list; t4 < e4.length; t4++)
2378
+ e4[t4].stop();
2379
+ return this;
2380
+ }, e3.pointerMoveTolerance = function(t4) {
2381
+ return w.number(t4) ? (this.scope.interactions.pointerMoveTolerance = t4, this) : this.scope.interactions.pointerMoveTolerance;
2382
+ }, e3.addDocument = function(t4, e4) {
2383
+ this.scope.addDocument(t4, e4);
2384
+ }, e3.removeDocument = function(t4) {
2385
+ this.scope.removeDocument(t4);
2386
+ }, e3;
2387
+ }(this), this.InteractEvent = Se, this.Interactable = void 0, this.interactables = new an(this), this._win = void 0, this.document = void 0, this.window = void 0, this.documents = [], this._plugins = { list: [], map: {} }, this.onWindowUnload = function(t3) {
2388
+ return e2.removeDocument(t3.target);
2389
+ };
2390
+ var n2 = this;
2391
+ this.Interactable = function(t3) {
2392
+ s(i2, t3);
2393
+ var e3 = p(i2);
2394
+ function i2() {
2395
+ return r(this, i2), e3.apply(this, arguments);
2396
+ }
2397
+ return o(i2, [{ key: "_defaults", get: function() {
2398
+ return n2.defaults;
2399
+ } }, { key: "set", value: function(t4) {
2400
+ return f(c(i2.prototype), "set", this).call(this, t4), n2.fire("interactable:set", { options: t4, interactable: this }), this;
2401
+ } }, { key: "unset", value: function() {
2402
+ f(c(i2.prototype), "unset", this).call(this);
2403
+ var t4 = n2.interactables.list.indexOf(this);
2404
+ t4 < 0 || (n2.interactables.list.splice(t4, 1), n2.fire("interactable:unset", { interactable: this }));
2405
+ } }]), i2;
2406
+ }(on);
2407
+ }
2408
+ return o(t2, [{ key: "addListeners", value: function(t3, e2) {
2409
+ this.listenerMaps.push({ id: e2, map: t3 });
2410
+ } }, { key: "fire", value: function(t3, e2) {
2411
+ for (var n2 = 0, r2 = this.listenerMaps; n2 < r2.length; n2++) {
2412
+ var i2 = r2[n2].map[t3];
2413
+ if (i2 && false === i2(e2, this, t3))
2414
+ return false;
2415
+ }
2416
+ } }, { key: "init", value: function(t3) {
2417
+ return this.isInitialized ? this : function(t4, e2) {
2418
+ t4.isInitialized = true, w.window(e2) && m(e2);
2419
+ return k.init(e2), I.init(e2), Lt.init(e2), t4.window = e2, t4.document = e2.document, t4.usePlugin(nn), t4.usePlugin(Ue), t4;
2420
+ }(this, t3);
2421
+ } }, { key: "pluginIsInstalled", value: function(t3) {
2422
+ var e2 = t3.id;
2423
+ return e2 ? !!this._plugins.map[e2] : -1 !== this._plugins.list.indexOf(t3);
2424
+ } }, { key: "usePlugin", value: function(t3, e2) {
2425
+ if (!this.isInitialized)
2426
+ return this;
2427
+ if (this.pluginIsInstalled(t3))
2428
+ return this;
2429
+ if (t3.id && (this._plugins.map[t3.id] = t3), this._plugins.list.push(t3), t3.install && t3.install(this, e2), t3.listeners && t3.before) {
2430
+ for (var n2 = 0, r2 = this.listenerMaps.length, i2 = t3.before.reduce(function(t4, e3) {
2431
+ return t4[e3] = true, t4[cn(e3)] = true, t4;
2432
+ }, {}); n2 < r2; n2++) {
2433
+ var o2 = this.listenerMaps[n2].id;
2434
+ if (o2 && (i2[o2] || i2[cn(o2)]))
2435
+ break;
2436
+ }
2437
+ this.listenerMaps.splice(n2, 0, { id: t3.id, map: t3.listeners });
2438
+ } else
2439
+ t3.listeners && this.listenerMaps.push({ id: t3.id, map: t3.listeners });
2440
+ return this;
2441
+ } }, { key: "addDocument", value: function(t3, e2) {
2442
+ if (-1 !== this.getDocIndex(t3))
2443
+ return false;
2444
+ var n2 = y(t3);
2445
+ e2 = e2 ? V({}, e2) : {}, this.documents.push({ doc: t3, options: e2 }), this.events.documents.push(t3), t3 !== this.document && this.events.add(n2, "unload", this.onWindowUnload), this.fire("scope:add-document", { doc: t3, window: n2, scope: this, options: e2 });
2446
+ } }, { key: "removeDocument", value: function(t3) {
2447
+ var e2 = this.getDocIndex(t3), n2 = y(t3), r2 = this.documents[e2].options;
2448
+ this.events.remove(n2, "unload", this.onWindowUnload), this.documents.splice(e2, 1), this.events.documents.splice(e2, 1), this.fire("scope:remove-document", { doc: t3, window: n2, scope: this, options: r2 });
2449
+ } }, { key: "getDocIndex", value: function(t3) {
2450
+ for (var e2 = 0; e2 < this.documents.length; e2++)
2451
+ if (this.documents[e2].doc === t3)
2452
+ return e2;
2453
+ return -1;
2454
+ } }, { key: "getDocOptions", value: function(t3) {
2455
+ var e2 = this.getDocIndex(t3);
2456
+ return -1 === e2 ? null : this.documents[e2].options;
2457
+ } }, { key: "now", value: function() {
2458
+ return (this.window.Date || Date).now();
2459
+ } }]), t2;
2460
+ }();
2461
+ function cn(t2) {
2462
+ return t2 && t2.replace(/\/.*$/, "");
2463
+ }
2464
+ var ln = new sn(), un = ln.interactStatic, pn = "undefined" != typeof globalThis ? globalThis : window;
2465
+ ln.init(pn);
2466
+ var fn = Object.freeze({ __proto__: null, edgeTarget: function() {
2467
+ }, elements: function() {
2468
+ }, grid: function(t2) {
2469
+ var e2 = [["x", "y"], ["left", "top"], ["right", "bottom"], ["width", "height"]].filter(function(e3) {
2470
+ var n3 = e3[0], r2 = e3[1];
2471
+ return n3 in t2 || r2 in t2;
2472
+ }), n2 = function(n3, r2) {
2473
+ for (var i2 = t2.range, o2 = t2.limits, a2 = void 0 === o2 ? { left: -1 / 0, right: 1 / 0, top: -1 / 0, bottom: 1 / 0 } : o2, s2 = t2.offset, c2 = void 0 === s2 ? { x: 0, y: 0 } : s2, l2 = { range: i2, grid: t2, x: null, y: null }, u2 = 0; u2 < e2.length; u2++) {
2474
+ var p2 = e2[u2], f2 = p2[0], d2 = p2[1], h2 = Math.round((n3 - c2.x) / t2[f2]), v2 = Math.round((r2 - c2.y) / t2[d2]);
2475
+ l2[f2] = Math.max(a2.left, Math.min(a2.right, h2 * t2[f2] + c2.x)), l2[d2] = Math.max(a2.top, Math.min(a2.bottom, v2 * t2[d2] + c2.y));
2476
+ }
2477
+ return l2;
2478
+ };
2479
+ return n2.grid = t2, n2.coordFields = e2, n2;
2480
+ } }), dn = { id: "snappers", install: function(t2) {
2481
+ var e2 = t2.interactStatic;
2482
+ e2.snappers = V(e2.snappers || {}, fn), e2.createSnapGrid = e2.snappers.grid;
2483
+ } }, hn = dn, vn = { start: function(t2) {
2484
+ var n2 = t2.state, r2 = t2.rect, i2 = t2.edges, o2 = t2.pageCoords, a2 = n2.options, s2 = a2.ratio, c2 = a2.enabled, l2 = n2.options, u2 = l2.equalDelta, p2 = l2.modifiers;
2485
+ "preserve" === s2 && (s2 = r2.width / r2.height), n2.startCoords = V({}, o2), n2.startRect = V({}, r2), n2.ratio = s2, n2.equalDelta = u2;
2486
+ var f2 = n2.linkedEdges = { top: i2.top || i2.left && !i2.bottom, left: i2.left || i2.top && !i2.right, bottom: i2.bottom || i2.right && !i2.top, right: i2.right || i2.bottom && !i2.left };
2487
+ if (n2.xIsPrimaryAxis = !(!i2.left && !i2.right), n2.equalDelta) {
2488
+ var d2 = (f2.left ? 1 : -1) * (f2.top ? 1 : -1);
2489
+ n2.edgeSign = { x: d2, y: d2 };
2490
+ } else
2491
+ n2.edgeSign = { x: f2.left ? -1 : 1, y: f2.top ? -1 : 1 };
2492
+ if (false !== c2 && V(i2, f2), null != p2 && p2.length) {
2493
+ var h2 = new me(t2.interaction);
2494
+ h2.copyFrom(t2.interaction.modification), h2.prepareStates(p2), n2.subModification = h2, h2.startAll(e({}, t2));
2495
+ }
2496
+ }, set: function(t2) {
2497
+ var n2 = t2.state, r2 = t2.rect, i2 = t2.coords, o2 = n2.linkedEdges, a2 = V({}, i2), s2 = n2.equalDelta ? gn : mn;
2498
+ if (V(t2.edges, o2), s2(n2, n2.xIsPrimaryAxis, i2, r2), !n2.subModification)
2499
+ return null;
2500
+ var c2 = V({}, r2);
2501
+ H(o2, c2, { x: i2.x - a2.x, y: i2.y - a2.y });
2502
+ var l2 = n2.subModification.setAll(e(e({}, t2), {}, { rect: c2, edges: o2, pageCoords: i2, prevCoords: i2, prevRect: c2 })), u2 = l2.delta;
2503
+ l2.changed && (s2(n2, Math.abs(u2.x) > Math.abs(u2.y), l2.coords, l2.rect), V(i2, l2.coords));
2504
+ return l2.eventProps;
2505
+ }, defaults: { ratio: "preserve", equalDelta: false, modifiers: [], enabled: false } };
2506
+ function gn(t2, e2, n2) {
2507
+ var r2 = t2.startCoords, i2 = t2.edgeSign;
2508
+ e2 ? n2.y = r2.y + (n2.x - r2.x) * i2.y : n2.x = r2.x + (n2.y - r2.y) * i2.x;
2509
+ }
2510
+ function mn(t2, e2, n2, r2) {
2511
+ var i2 = t2.startRect, o2 = t2.startCoords, a2 = t2.ratio, s2 = t2.edgeSign;
2512
+ if (e2) {
2513
+ var c2 = r2.width / a2;
2514
+ n2.y = o2.y + (c2 - i2.height) * s2.y;
2515
+ } else {
2516
+ var l2 = r2.height * a2;
2517
+ n2.x = o2.x + (l2 - i2.width) * s2.x;
2518
+ }
2519
+ }
2520
+ var yn = be(vn, "aspectRatio"), bn = function() {
2521
+ };
2522
+ bn._defaults = {};
2523
+ var xn = bn;
2524
+ function wn(t2, e2, n2) {
2525
+ return w.func(t2) ? G(t2, e2.interactable, e2.element, [n2.x, n2.y, e2]) : G(t2, e2.interactable, e2.element);
2526
+ }
2527
+ var En = { start: function(t2) {
2528
+ var e2 = t2.rect, n2 = t2.startOffset, r2 = t2.state, i2 = t2.interaction, o2 = t2.pageCoords, a2 = r2.options, s2 = a2.elementRect, c2 = V({ left: 0, top: 0, right: 0, bottom: 0 }, a2.offset || {});
2529
+ if (e2 && s2) {
2530
+ var l2 = wn(a2.restriction, i2, o2);
2531
+ if (l2) {
2532
+ var u2 = l2.right - l2.left - e2.width, p2 = l2.bottom - l2.top - e2.height;
2533
+ u2 < 0 && (c2.left += u2, c2.right += u2), p2 < 0 && (c2.top += p2, c2.bottom += p2);
2534
+ }
2535
+ c2.left += n2.left - e2.width * s2.left, c2.top += n2.top - e2.height * s2.top, c2.right += n2.right - e2.width * (1 - s2.right), c2.bottom += n2.bottom - e2.height * (1 - s2.bottom);
2536
+ }
2537
+ r2.offset = c2;
2538
+ }, set: function(t2) {
2539
+ var e2 = t2.coords, n2 = t2.interaction, r2 = t2.state, i2 = r2.options, o2 = r2.offset, a2 = wn(i2.restriction, n2, e2);
2540
+ if (a2) {
2541
+ var s2 = function(t3) {
2542
+ return !t3 || "left" in t3 && "top" in t3 || ((t3 = V({}, t3)).left = t3.x || 0, t3.top = t3.y || 0, t3.right = t3.right || t3.left + t3.width, t3.bottom = t3.bottom || t3.top + t3.height), t3;
2543
+ }(a2);
2544
+ e2.x = Math.max(Math.min(s2.right - o2.right, e2.x), s2.left + o2.left), e2.y = Math.max(Math.min(s2.bottom - o2.bottom, e2.y), s2.top + o2.top);
2545
+ }
2546
+ }, defaults: { restriction: null, elementRect: null, offset: null, endOnly: false, enabled: false } }, Tn = be(En, "restrict"), Sn = { top: 1 / 0, left: 1 / 0, bottom: -1 / 0, right: -1 / 0 }, _n = { top: -1 / 0, left: -1 / 0, bottom: 1 / 0, right: 1 / 0 };
2547
+ function Pn(t2, e2) {
2548
+ for (var n2 = 0, r2 = ["top", "left", "bottom", "right"]; n2 < r2.length; n2++) {
2549
+ var i2 = r2[n2];
2550
+ i2 in t2 || (t2[i2] = e2[i2]);
2551
+ }
2552
+ return t2;
2553
+ }
2554
+ var On = { noInner: Sn, noOuter: _n, start: function(t2) {
2555
+ var e2, n2 = t2.interaction, r2 = t2.startOffset, i2 = t2.state, o2 = i2.options;
2556
+ o2 && (e2 = N(wn(o2.offset, n2, n2.coords.start.page))), e2 = e2 || { x: 0, y: 0 }, i2.offset = { top: e2.y + r2.top, left: e2.x + r2.left, bottom: e2.y - r2.bottom, right: e2.x - r2.right };
2557
+ }, set: function(t2) {
2558
+ var e2 = t2.coords, n2 = t2.edges, r2 = t2.interaction, i2 = t2.state, o2 = i2.offset, a2 = i2.options;
2559
+ if (n2) {
2560
+ var s2 = V({}, e2), c2 = wn(a2.inner, r2, s2) || {}, l2 = wn(a2.outer, r2, s2) || {};
2561
+ Pn(c2, Sn), Pn(l2, _n), n2.top ? e2.y = Math.min(Math.max(l2.top + o2.top, s2.y), c2.top + o2.top) : n2.bottom && (e2.y = Math.max(Math.min(l2.bottom + o2.bottom, s2.y), c2.bottom + o2.bottom)), n2.left ? e2.x = Math.min(Math.max(l2.left + o2.left, s2.x), c2.left + o2.left) : n2.right && (e2.x = Math.max(Math.min(l2.right + o2.right, s2.x), c2.right + o2.right));
2562
+ }
2563
+ }, defaults: { inner: null, outer: null, offset: null, endOnly: false, enabled: false } }, kn = be(On, "restrictEdges"), Dn = V({ get elementRect() {
2564
+ return { top: 0, left: 0, bottom: 1, right: 1 };
2565
+ }, set elementRect(t2) {
2566
+ } }, En.defaults), In = be({ start: En.start, set: En.set, defaults: Dn }, "restrictRect"), Mn = { width: -1 / 0, height: -1 / 0 }, zn = { width: 1 / 0, height: 1 / 0 };
2567
+ var An = be({ start: function(t2) {
2568
+ return On.start(t2);
2569
+ }, set: function(t2) {
2570
+ var e2 = t2.interaction, n2 = t2.state, r2 = t2.rect, i2 = t2.edges, o2 = n2.options;
2571
+ if (i2) {
2572
+ var a2 = U(wn(o2.min, e2, t2.coords)) || Mn, s2 = U(wn(o2.max, e2, t2.coords)) || zn;
2573
+ n2.options = { endOnly: o2.endOnly, inner: V({}, On.noInner), outer: V({}, On.noOuter) }, i2.top ? (n2.options.inner.top = r2.bottom - a2.height, n2.options.outer.top = r2.bottom - s2.height) : i2.bottom && (n2.options.inner.bottom = r2.top + a2.height, n2.options.outer.bottom = r2.top + s2.height), i2.left ? (n2.options.inner.left = r2.right - a2.width, n2.options.outer.left = r2.right - s2.width) : i2.right && (n2.options.inner.right = r2.left + a2.width, n2.options.outer.right = r2.left + s2.width), On.set(t2), n2.options = o2;
2574
+ }
2575
+ }, defaults: { min: null, max: null, endOnly: false, enabled: false } }, "restrictSize");
2576
+ var Rn = { start: function(t2) {
2577
+ var e2, n2 = t2.interaction, r2 = t2.interactable, i2 = t2.element, o2 = t2.rect, a2 = t2.state, s2 = t2.startOffset, c2 = a2.options, l2 = c2.offsetWithOrigin ? function(t3) {
2578
+ var e3 = t3.interaction.element, n3 = N(G(t3.state.options.origin, null, null, [e3])), r3 = n3 || K(t3.interactable, e3, t3.interaction.prepared.name);
2579
+ return r3;
2580
+ }(t2) : { x: 0, y: 0 };
2581
+ if ("startCoords" === c2.offset)
2582
+ e2 = { x: n2.coords.start.page.x, y: n2.coords.start.page.y };
2583
+ else {
2584
+ var u2 = G(c2.offset, r2, i2, [n2]);
2585
+ (e2 = N(u2) || { x: 0, y: 0 }).x += l2.x, e2.y += l2.y;
2586
+ }
2587
+ var p2 = c2.relativePoints;
2588
+ a2.offsets = o2 && p2 && p2.length ? p2.map(function(t3, n3) {
2589
+ return { index: n3, relativePoint: t3, x: s2.left - o2.width * t3.x + e2.x, y: s2.top - o2.height * t3.y + e2.y };
2590
+ }) : [{ index: 0, relativePoint: null, x: e2.x, y: e2.y }];
2591
+ }, set: function(t2) {
2592
+ var e2 = t2.interaction, n2 = t2.coords, r2 = t2.state, i2 = r2.options, o2 = r2.offsets, a2 = K(e2.interactable, e2.element, e2.prepared.name), s2 = V({}, n2), c2 = [];
2593
+ i2.offsetWithOrigin || (s2.x -= a2.x, s2.y -= a2.y);
2594
+ for (var l2 = 0, u2 = o2; l2 < u2.length; l2++)
2595
+ for (var p2 = u2[l2], f2 = s2.x - p2.x, d2 = s2.y - p2.y, h2 = 0, v2 = i2.targets.length; h2 < v2; h2++) {
2596
+ var g2 = i2.targets[h2], m2 = void 0;
2597
+ (m2 = w.func(g2) ? g2(f2, d2, e2._proxy, p2, h2) : g2) && c2.push({ x: (w.number(m2.x) ? m2.x : f2) + p2.x, y: (w.number(m2.y) ? m2.y : d2) + p2.y, range: w.number(m2.range) ? m2.range : i2.range, source: g2, index: h2, offset: p2 });
2598
+ }
2599
+ for (var y2 = { target: null, inRange: false, distance: 0, range: 0, delta: { x: 0, y: 0 } }, b2 = 0; b2 < c2.length; b2++) {
2600
+ var x2 = c2[b2], E2 = x2.range, T2 = x2.x - s2.x, S2 = x2.y - s2.y, _2 = Q(T2, S2), P2 = _2 <= E2;
2601
+ E2 === 1 / 0 && y2.inRange && y2.range !== 1 / 0 && (P2 = false), y2.target && !(P2 ? y2.inRange && E2 !== 1 / 0 ? _2 / E2 < y2.distance / y2.range : E2 === 1 / 0 && y2.range !== 1 / 0 || _2 < y2.distance : !y2.inRange && _2 < y2.distance) || (y2.target = x2, y2.distance = _2, y2.range = E2, y2.inRange = P2, y2.delta.x = T2, y2.delta.y = S2);
2602
+ }
2603
+ return y2.inRange && (n2.x = y2.target.x, n2.y = y2.target.y), r2.closest = y2, y2;
2604
+ }, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: true, origin: null, relativePoints: null, endOnly: false, enabled: false } }, Cn = be(Rn, "snap");
2605
+ var jn = { start: function(t2) {
2606
+ var e2 = t2.state, n2 = t2.edges, r2 = e2.options;
2607
+ if (!n2)
2608
+ return null;
2609
+ t2.state = { options: { targets: null, relativePoints: [{ x: n2.left ? 0 : 1, y: n2.top ? 0 : 1 }], offset: r2.offset || "self", origin: { x: 0, y: 0 }, range: r2.range } }, e2.targetFields = e2.targetFields || [["width", "height"], ["x", "y"]], Rn.start(t2), e2.offsets = t2.state.offsets, t2.state = e2;
2610
+ }, set: function(t2) {
2611
+ var e2 = t2.interaction, n2 = t2.state, r2 = t2.coords, i2 = n2.options, o2 = n2.offsets, a2 = { x: r2.x - o2[0].x, y: r2.y - o2[0].y };
2612
+ n2.options = V({}, i2), n2.options.targets = [];
2613
+ for (var s2 = 0, c2 = i2.targets || []; s2 < c2.length; s2++) {
2614
+ var l2 = c2[s2], u2 = void 0;
2615
+ if (u2 = w.func(l2) ? l2(a2.x, a2.y, e2) : l2) {
2616
+ for (var p2 = 0, f2 = n2.targetFields; p2 < f2.length; p2++) {
2617
+ var d2 = f2[p2], h2 = d2[0], v2 = d2[1];
2618
+ if (h2 in u2 || v2 in u2) {
2619
+ u2.x = u2[h2], u2.y = u2[v2];
2620
+ break;
2621
+ }
2622
+ }
2623
+ n2.options.targets.push(u2);
2624
+ }
2625
+ }
2626
+ var g2 = Rn.set(t2);
2627
+ return n2.options = i2, g2;
2628
+ }, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: false, enabled: false } }, Fn = be(jn, "snapSize");
2629
+ var Xn = { aspectRatio: yn, restrictEdges: kn, restrict: Tn, restrictRect: In, restrictSize: An, snapEdges: be({ start: function(t2) {
2630
+ var e2 = t2.edges;
2631
+ return e2 ? (t2.state.targetFields = t2.state.targetFields || [[e2.left ? "left" : "right", e2.top ? "top" : "bottom"]], jn.start(t2)) : null;
2632
+ }, set: jn.set, defaults: V(ge(jn.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Cn, snapSize: Fn, spring: xn, avoid: xn, transform: xn, rubberband: xn }, Yn = { id: "modifiers", install: function(t2) {
2633
+ var e2 = t2.interactStatic;
2634
+ for (var n2 in t2.usePlugin(Ee), t2.usePlugin(hn), e2.modifiers = Xn, Xn) {
2635
+ var r2 = Xn[n2], i2 = r2._defaults, o2 = r2._methods;
2636
+ i2._methods = o2, t2.defaults.perAction[n2] = i2;
2637
+ }
2638
+ } }, Ln = Yn, qn = function(t2) {
2639
+ s(n2, t2);
2640
+ var e2 = p(n2);
2641
+ function n2(t3, i2, o2, a2, s2, c2) {
2642
+ var l2;
2643
+ if (r(this, n2), tt(u(l2 = e2.call(this, s2)), o2), o2 !== i2 && tt(u(l2), i2), l2.timeStamp = c2, l2.originalEvent = o2, l2.type = t3, l2.pointerId = at(i2), l2.pointerType = dt(i2), l2.target = a2, l2.currentTarget = null, "tap" === t3) {
2644
+ var p2 = s2.getPointerIndex(i2);
2645
+ l2.dt = l2.timeStamp - s2.pointers[p2].downTime;
2646
+ var f2 = l2.timeStamp - s2.tapTime;
2647
+ l2.double = !!s2.prevTap && "doubletap" !== s2.prevTap.type && s2.prevTap.target === l2.target && f2 < 500;
2648
+ } else
2649
+ "doubletap" === t3 && (l2.dt = i2.timeStamp - s2.tapTime, l2.double = true);
2650
+ return l2;
2651
+ }
2652
+ return o(n2, [{ key: "_subtractOrigin", value: function(t3) {
2653
+ var e3 = t3.x, n3 = t3.y;
2654
+ return this.pageX -= e3, this.pageY -= n3, this.clientX -= e3, this.clientY -= n3, this;
2655
+ } }, { key: "_addOrigin", value: function(t3) {
2656
+ var e3 = t3.x, n3 = t3.y;
2657
+ return this.pageX += e3, this.pageY += n3, this.clientX += e3, this.clientY += n3, this;
2658
+ } }, { key: "preventDefault", value: function() {
2659
+ this.originalEvent.preventDefault();
2660
+ } }]), n2;
2661
+ }(vt), Bn = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(t2) {
2662
+ t2.pointerEvents = Bn, t2.defaults.actions.pointerEvents = Bn.defaults, V(t2.actions.phaselessTypes, Bn.types);
2663
+ }, listeners: { "interactions:new": function(t2) {
2664
+ var e2 = t2.interaction;
2665
+ e2.prevTap = null, e2.tapTime = 0;
2666
+ }, "interactions:update-pointer": function(t2) {
2667
+ var e2 = t2.down, n2 = t2.pointerInfo;
2668
+ if (!e2 && n2.hold)
2669
+ return;
2670
+ n2.hold = { duration: 1 / 0, timeout: null };
2671
+ }, "interactions:move": function(t2, e2) {
2672
+ var n2 = t2.interaction, r2 = t2.pointer, i2 = t2.event, o2 = t2.eventTarget;
2673
+ t2.duplicate || n2.pointerIsDown && !n2.pointerWasMoved || (n2.pointerIsDown && Gn(t2), Vn({ interaction: n2, pointer: r2, event: i2, eventTarget: o2, type: "move" }, e2));
2674
+ }, "interactions:down": function(t2, e2) {
2675
+ !function(t3, e3) {
2676
+ for (var n2 = t3.interaction, r2 = t3.pointer, i2 = t3.event, o2 = t3.eventTarget, a2 = t3.pointerIndex, s2 = n2.pointers[a2].hold, c2 = q(o2), l2 = { interaction: n2, pointer: r2, event: i2, eventTarget: o2, type: "hold", targets: [], path: c2, node: null }, u2 = 0; u2 < c2.length; u2++) {
2677
+ var p2 = c2[u2];
2678
+ l2.node = p2, e3.fire("pointerEvents:collect-targets", l2);
2679
+ }
2680
+ if (!l2.targets.length)
2681
+ return;
2682
+ for (var f2 = 1 / 0, d2 = 0, h2 = l2.targets; d2 < h2.length; d2++) {
2683
+ var v2 = h2[d2].eventable.options.holdDuration;
2684
+ v2 < f2 && (f2 = v2);
2685
+ }
2686
+ s2.duration = f2, s2.timeout = setTimeout(function() {
2687
+ Vn({ interaction: n2, eventTarget: o2, pointer: r2, event: i2, type: "hold" }, e3);
2688
+ }, f2);
2689
+ }(t2, e2), Vn(t2, e2);
2690
+ }, "interactions:up": function(t2, e2) {
2691
+ Gn(t2), Vn(t2, e2), function(t3, e3) {
2692
+ var n2 = t3.interaction, r2 = t3.pointer, i2 = t3.event, o2 = t3.eventTarget;
2693
+ n2.pointerWasMoved || Vn({ interaction: n2, eventTarget: o2, pointer: r2, event: i2, type: "tap" }, e3);
2694
+ }(t2, e2);
2695
+ }, "interactions:cancel": function(t2, e2) {
2696
+ Gn(t2), Vn(t2, e2);
2697
+ } }, PointerEvent: qn, fire: Vn, collectEventTargets: Wn, defaults: { holdDuration: 600, ignoreFrom: null, allowFrom: null, origin: { x: 0, y: 0 } }, types: { down: true, move: true, up: true, cancel: true, tap: true, doubletap: true, hold: true } };
2698
+ function Vn(t2, e2) {
2699
+ var n2 = t2.interaction, r2 = t2.pointer, i2 = t2.event, o2 = t2.eventTarget, a2 = t2.type, s2 = t2.targets, c2 = void 0 === s2 ? Wn(t2, e2) : s2, l2 = new qn(a2, r2, i2, o2, n2, e2.now());
2700
+ e2.fire("pointerEvents:new", { pointerEvent: l2 });
2701
+ for (var u2 = { interaction: n2, pointer: r2, event: i2, eventTarget: o2, targets: c2, type: a2, pointerEvent: l2 }, p2 = 0; p2 < c2.length; p2++) {
2702
+ var f2 = c2[p2];
2703
+ for (var d2 in f2.props || {})
2704
+ l2[d2] = f2.props[d2];
2705
+ var h2 = K(f2.eventable, f2.node);
2706
+ if (l2._subtractOrigin(h2), l2.eventable = f2.eventable, l2.currentTarget = f2.node, f2.eventable.fire(l2), l2._addOrigin(h2), l2.immediatePropagationStopped || l2.propagationStopped && p2 + 1 < c2.length && c2[p2 + 1].node !== l2.currentTarget)
2707
+ break;
2708
+ }
2709
+ if (e2.fire("pointerEvents:fired", u2), "tap" === a2) {
2710
+ var v2 = l2.double ? Vn({ interaction: n2, pointer: r2, event: i2, eventTarget: o2, type: "doubletap" }, e2) : l2;
2711
+ n2.prevTap = v2, n2.tapTime = v2.timeStamp;
2712
+ }
2713
+ return l2;
2714
+ }
2715
+ function Wn(t2, e2) {
2716
+ var n2 = t2.interaction, r2 = t2.pointer, i2 = t2.event, o2 = t2.eventTarget, a2 = t2.type, s2 = n2.getPointerIndex(r2), c2 = n2.pointers[s2];
2717
+ if ("tap" === a2 && (n2.pointerWasMoved || !c2 || c2.downTarget !== o2))
2718
+ return [];
2719
+ for (var l2 = q(o2), u2 = { interaction: n2, pointer: r2, event: i2, eventTarget: o2, type: a2, path: l2, targets: [], node: null }, p2 = 0; p2 < l2.length; p2++) {
2720
+ var f2 = l2[p2];
2721
+ u2.node = f2, e2.fire("pointerEvents:collect-targets", u2);
2722
+ }
2723
+ return "hold" === a2 && (u2.targets = u2.targets.filter(function(t3) {
2724
+ var e3, r3;
2725
+ return t3.eventable.options.holdDuration === (null == (e3 = n2.pointers[s2]) || null == (r3 = e3.hold) ? void 0 : r3.duration);
2726
+ })), u2.targets;
2727
+ }
2728
+ function Gn(t2) {
2729
+ var e2 = t2.interaction, n2 = t2.pointerIndex, r2 = e2.pointers[n2].hold;
2730
+ r2 && r2.timeout && (clearTimeout(r2.timeout), r2.timeout = null);
2731
+ }
2732
+ var Nn = Object.freeze({ __proto__: null, default: Bn });
2733
+ function Un(t2) {
2734
+ var e2 = t2.interaction;
2735
+ e2.holdIntervalHandle && (clearInterval(e2.holdIntervalHandle), e2.holdIntervalHandle = null);
2736
+ }
2737
+ var Hn = { id: "pointer-events/holdRepeat", install: function(t2) {
2738
+ t2.usePlugin(Bn);
2739
+ var e2 = t2.pointerEvents;
2740
+ e2.defaults.holdRepeatInterval = 0, e2.types.holdrepeat = t2.actions.phaselessTypes.holdrepeat = true;
2741
+ }, listeners: ["move", "up", "cancel", "endall"].reduce(function(t2, e2) {
2742
+ return t2["pointerEvents:".concat(e2)] = Un, t2;
2743
+ }, { "pointerEvents:new": function(t2) {
2744
+ var e2 = t2.pointerEvent;
2745
+ "hold" === e2.type && (e2.count = (e2.count || 0) + 1);
2746
+ }, "pointerEvents:fired": function(t2, e2) {
2747
+ var n2 = t2.interaction, r2 = t2.pointerEvent, i2 = t2.eventTarget, o2 = t2.targets;
2748
+ if ("hold" === r2.type && o2.length) {
2749
+ var a2 = o2[0].eventable.options.holdRepeatInterval;
2750
+ a2 <= 0 || (n2.holdIntervalHandle = setTimeout(function() {
2751
+ e2.pointerEvents.fire({ interaction: n2, eventTarget: i2, type: "hold", pointer: r2, event: r2 }, e2);
2752
+ }, a2));
2753
+ }
2754
+ } }) }, Kn = Hn;
2755
+ var $n = { id: "pointer-events/interactableTargets", install: function(t2) {
2756
+ var e2 = t2.Interactable;
2757
+ e2.prototype.pointerEvents = function(t3) {
2758
+ return V(this.events.options, t3), this;
2759
+ };
2760
+ var n2 = e2.prototype._backCompatOption;
2761
+ e2.prototype._backCompatOption = function(t3, e3) {
2762
+ var r2 = n2.call(this, t3, e3);
2763
+ return r2 === this && (this.events.options[t3] = e3), r2;
2764
+ };
2765
+ }, listeners: { "pointerEvents:collect-targets": function(t2, e2) {
2766
+ var n2 = t2.targets, r2 = t2.node, i2 = t2.type, o2 = t2.eventTarget;
2767
+ e2.interactables.forEachMatch(r2, function(t3) {
2768
+ var e3 = t3.events, a2 = e3.options;
2769
+ e3.types[i2] && e3.types[i2].length && t3.testIgnoreAllow(a2, r2, o2) && n2.push({ node: r2, eventable: e3, props: { interactable: t3 } });
2770
+ });
2771
+ }, "interactable:new": function(t2) {
2772
+ var e2 = t2.interactable;
2773
+ e2.events.getRect = function(t3) {
2774
+ return e2.getRect(t3);
2775
+ };
2776
+ }, "interactable:set": function(t2, e2) {
2777
+ var n2 = t2.interactable, r2 = t2.options;
2778
+ V(n2.events.options, e2.pointerEvents.defaults), V(n2.events.options, r2.pointerEvents || {});
2779
+ } } }, Jn = $n, Qn = { id: "pointer-events", install: function(t2) {
2780
+ t2.usePlugin(Nn), t2.usePlugin(Kn), t2.usePlugin(Jn);
2781
+ } }, Zn = Qn;
2782
+ var tr = { id: "reflow", install: function(t2) {
2783
+ var e2 = t2.Interactable;
2784
+ t2.actions.phases.reflow = true, e2.prototype.reflow = function(e3) {
2785
+ return function(t3, e4, n2) {
2786
+ for (var r2 = t3.getAllElements(), i2 = n2.window.Promise, o2 = i2 ? [] : null, a2 = function() {
2787
+ var a3 = r2[s2], c2 = t3.getRect(a3);
2788
+ if (!c2)
2789
+ return 1;
2790
+ var l2, u2 = bt(n2.interactions.list, function(n3) {
2791
+ return n3.interacting() && n3.interactable === t3 && n3.element === a3 && n3.prepared.name === e4.name;
2792
+ });
2793
+ if (u2)
2794
+ u2.move(), o2 && (l2 = u2._reflowPromise || new i2(function(t4) {
2795
+ u2._reflowResolve = t4;
2796
+ }));
2797
+ else {
2798
+ var p2 = U(c2), f2 = /* @__PURE__ */ function(t4) {
2799
+ return { coords: t4, get page() {
2800
+ return this.coords.page;
2801
+ }, get client() {
2802
+ return this.coords.client;
2803
+ }, get timeStamp() {
2804
+ return this.coords.timeStamp;
2805
+ }, get pageX() {
2806
+ return this.coords.page.x;
2807
+ }, get pageY() {
2808
+ return this.coords.page.y;
2809
+ }, get clientX() {
2810
+ return this.coords.client.x;
2811
+ }, get clientY() {
2812
+ return this.coords.client.y;
2813
+ }, get pointerId() {
2814
+ return this.coords.pointerId;
2815
+ }, get target() {
2816
+ return this.coords.target;
2817
+ }, get type() {
2818
+ return this.coords.type;
2819
+ }, get pointerType() {
2820
+ return this.coords.pointerType;
2821
+ }, get buttons() {
2822
+ return this.coords.buttons;
2823
+ }, preventDefault: function() {
2824
+ } };
2825
+ }({ page: { x: p2.x, y: p2.y }, client: { x: p2.x, y: p2.y }, timeStamp: n2.now() });
2826
+ l2 = function(t4, e5, n3, r3, i3) {
2827
+ var o3 = t4.interactions.new({ pointerType: "reflow" }), a4 = { interaction: o3, event: i3, pointer: i3, eventTarget: n3, phase: "reflow" };
2828
+ o3.interactable = e5, o3.element = n3, o3.prevEvent = i3, o3.updatePointer(i3, i3, n3, true), nt(o3.coords.delta), Ut(o3.prepared, r3), o3._doPhase(a4);
2829
+ var s3 = t4.window, c3 = s3.Promise, l3 = c3 ? new c3(function(t5) {
2830
+ o3._reflowResolve = t5;
2831
+ }) : void 0;
2832
+ o3._reflowPromise = l3, o3.start(r3, e5, n3), o3._interacting ? (o3.move(a4), o3.end(i3)) : (o3.stop(), o3._reflowResolve());
2833
+ return o3.removePointer(i3, i3), l3;
2834
+ }(n2, t3, a3, e4, f2);
2835
+ }
2836
+ o2 && o2.push(l2);
2837
+ }, s2 = 0; s2 < r2.length && !a2(); s2++)
2838
+ ;
2839
+ return o2 && i2.all(o2).then(function() {
2840
+ return t3;
2841
+ });
2842
+ }(this, e3, t2);
2843
+ };
2844
+ }, listeners: { "interactions:stop": function(t2, e2) {
2845
+ var n2 = t2.interaction;
2846
+ "reflow" === n2.pointerType && (n2._reflowResolve && n2._reflowResolve(), function(t3, e3) {
2847
+ t3.splice(t3.indexOf(e3), 1);
2848
+ }(e2.interactions.list, n2));
2849
+ } } }, er = tr;
2850
+ if (un.use(he), un.use(Ce), un.use(Zn), un.use(qe), un.use(Ln), un.use(pe), un.use(Xt), un.use(Gt), un.use(er), un.default = un, "object" === ("undefined" == typeof module ? "undefined" : n(module)) && module)
2851
+ try {
2852
+ module.exports = un;
2853
+ } catch (t2) {
2854
+ }
2855
+ return un.default = un, un;
2856
+ });
2857
+ }
2858
+ });
2859
+
2860
+ // build/fullscreen-view.js
2861
+ var fullscreen_view_exports = {};
2862
+ __export(fullscreen_view_exports, {
2863
+ default: () => fullscreen_view_default
2864
+ });
2865
+ function createPlayerElement(stream, container) {
2866
+ const element = document.createElement("video");
2867
+ element.controls = true;
2868
+ container.appendChild(element);
2869
+ element.muted = true;
2870
+ element.autoplay = true;
2871
+ element.srcObject = stream;
2872
+ return element;
2873
+ }
2874
+ async function maybeCreatePlayer(created, source, url) {
2875
+ if (!created.find((c) => c.source.id == source.id && c.source.key == source.key)) {
2876
+ const container = document.getElementById(mkContainerId(source)) || void 0;
2877
+ const client = new MyWhepClient({ url, container, streamId: source.id, streamKey: source.key });
2878
+ await client.start();
2879
+ const next = [...created];
2880
+ next.push({
2881
+ source,
2882
+ client
2883
+ });
2884
+ return next;
2885
+ } else {
2886
+ return created;
2887
+ }
2888
+ }
2889
+ function FullScreenView(multiCamera) {
2890
+ if (!multiCamera.config.enablePreviews) {
2891
+ return (0, import_jsx_runtime3.jsx)("div", { id: "camera-control-container", className: "bg-gray-50 dark:bg-gray-900", children: (0, import_jsx_runtime3.jsx)("div", { className: "flex flex-col h-full gap-4 2xl:mx-40 md:mx-6", children: "Previews are not enabled, so full screen view is unavailable" }) });
2892
+ }
2893
+ const [state, setState] = (0, import_react2.useState)({ createdClient: [], livePreviewSource: void 0, overlays: [] });
2894
+ const overlayRefs = (0, import_react2.useRef)([]);
2895
+ const refLivePreviewVideo = (0, import_react2.useRef)(null);
2896
+ (0, import_react2.useEffect)(() => {
2897
+ const promise = async () => {
2898
+ let nextCreated = state.createdClient;
2899
+ for (const entry of multiCamera.state.players) {
2900
+ nextCreated = await maybeCreatePlayer(nextCreated, entry.source, entry.player);
2901
+ }
2902
+ if (multiCamera.state.previewPlayerUrl)
2903
+ nextCreated = await maybeCreatePlayer(nextCreated, { id: "preview" }, multiCamera.state.previewPlayerUrl);
2904
+ let initialLivePreviewSource;
2905
+ if (state.livePreviewSource === void 0) {
2906
+ const fallbackSource = nextCreated.find((s) => s.source.id === "fallback");
2907
+ if (fallbackSource) {
2908
+ initialLivePreviewSource = fallbackSource;
2909
+ }
2910
+ }
2911
+ setState({ ...state, createdClient: nextCreated, livePreviewSource: initialLivePreviewSource });
2912
+ for (const c of nextCreated) {
2913
+ if (!multiCamera.state.players.find((s) => s.source.id == c.source.id && s.source.key == s.source.key)) {
2914
+ c.client.videoElements.forEach((e) => {
2915
+ e.remove();
2916
+ });
2917
+ }
2918
+ }
2919
+ if (refLivePreviewVideo.current) {
2920
+ (0, import_interactjs.default)(refLivePreviewVideo.current).dropzone({
2921
+ accept: "video",
2922
+ ondrop: (e) => {
2923
+ const video = e.relatedTarget;
2924
+ const streamId = video.getAttribute("data-streamid");
2925
+ const streamKey = video.getAttribute("data-streamkey");
2926
+ if (!streamId) {
2927
+ } else {
2928
+ const targetRect = refLivePreviewVideo.current?.getBoundingClientRect();
2929
+ if (targetRect) {
2930
+ const relativeX = e.dragEvent.page.x - targetRect?.left;
2931
+ const relativeY = e.dragEvent.page.y - targetRect?.top;
2932
+ setState((state2) => {
2933
+ const sourceVideo = state2.createdClient.find((c) => c.source.id == streamId && c.source.key == streamKey);
2934
+ if (!sourceVideo) {
2935
+ console.warn("Couldn't find source to build overlay", { streamId, streamKey });
2936
+ return state2;
2937
+ }
2938
+ const videoRect = video.getBoundingClientRect();
2939
+ state2.overlays.push({
2940
+ x: relativeX,
2941
+ y: relativeY,
2942
+ width: DEFAULT_OVERLAY_WIDTH,
2943
+ height: videoRect.height / (videoRect.width / DEFAULT_OVERLAY_WIDTH),
2944
+ source: sourceVideo,
2945
+ selected: true
2946
+ });
2947
+ selectOverlay(state2.overlays.length - 1, state2.overlays);
2948
+ return { ...state2 };
2949
+ });
2950
+ }
2951
+ }
2952
+ }
2953
+ });
2954
+ }
2955
+ };
2956
+ void promise().catch((e) => {
2957
+ console.error(e);
2958
+ });
2959
+ }, []);
2960
+ function clearSelection(overlays) {
2961
+ overlays.forEach((o) => {
2962
+ o.selected = false;
2963
+ });
2964
+ }
2965
+ function selectOverlay(ti, overlays) {
2966
+ overlays.forEach((o, i) => {
2967
+ if (i == ti) {
2968
+ o.selected = true;
2969
+ } else {
2970
+ o.selected = false;
2971
+ }
2972
+ });
2973
+ }
2974
+ (0, import_react2.useEffect)(() => {
2975
+ const promise = async () => {
2976
+ if (!state.livePreviewSource)
2977
+ return;
2978
+ await state.livePreviewSource.client.started;
2979
+ if (refLivePreviewVideo.current && state.livePreviewSource.client.mediaStream) {
2980
+ const ele = refLivePreviewVideo.current;
2981
+ refLivePreviewVideo.current.autoplay = true;
2982
+ refLivePreviewVideo.current.controls = false;
2983
+ refLivePreviewVideo.current.srcObject = state.livePreviewSource.client.mediaStream;
2984
+ refLivePreviewVideo.current.oncanplaythrough = () => {
2985
+ void ele.play();
2986
+ };
2987
+ }
2988
+ };
2989
+ void promise();
2990
+ }, [state.livePreviewSource]);
2991
+ const takeButtonClasses = "text-gray-900 bg-white border border-gray-300 focus:outline-none focus:ring-0 focus:ring-gray-200 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 dark:bg-gray-800 dark:border-gray-600 dark:focus:ring-gray-700 w-full dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:border-gray-600";
2992
+ const sourcesSorted = multiCamera.state.availableSources.sort(sortSource).reduce(({ fallback, inputs }, s) => {
2993
+ if (s.id === "fallback") {
2994
+ return { fallback: s, inputs };
2995
+ }
2996
+ return { fallback, inputs: [...inputs, s] };
2997
+ }, { fallback: void 0, inputs: [] });
2998
+ if (sourcesSorted.fallback) {
2999
+ sourcesSorted.inputs.unshift(sourcesSorted.fallback);
3000
+ }
3001
+ return (0, import_jsx_runtime3.jsx)("div", { id: "camera-control-container", className: "bg-gray-50 dark:bg-gray-900", children: (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col h-full gap-4 2xl:mx-40 md:mx-6", children: [(0, import_jsx_runtime3.jsxs)("div", { id: "camera-control-preview-grid", className: "mb-6", children: [(0, import_jsx_runtime3.jsx)("h2", { children: "Camera Control" }), (0, import_jsx_runtime3.jsx)("div", { className: "grid 2xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2 xs:grid-cols-2 grid-rows-1 gap-4", children: sourcesSorted.inputs.map((s, i) => {
3002
+ const isLive = isSourceSwitchSourceEqual(s, multiCamera.state.activeSource);
3003
+ return (0, import_jsx_runtime3.jsxs)("div", { className: "relative", children: [(0, import_jsx_runtime3.jsx)("div", { className: `${isLive ? "border-green-400 border-solid border-2" : ""}`, id: mkContainerId(s) }), (0, import_jsx_runtime3.jsxs)("button", { className: takeButtonClasses, onClick: (_e) => {
3004
+ setState({ ...state, livePreviewSource: state.createdClient.find((c) => isSourceSwitchSourceEqual(c.source, s)) });
3005
+ }, children: ["Preview ", s.key ?? s.id] }), (0, import_jsx_runtime3.jsx)("div", { children: isLive ? (0, import_jsx_runtime3.jsx)("span", { className: "absolute top-2 left-2 z-10 px-1 bg-green-300 text-white dark:text-black cursor-default text-xs", children: "Live" }) : (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}) })] }, i);
3006
+ }) })] }), (0, import_jsx_runtime3.jsxs)("div", { id: "live-views", className: "grid grid-cols-2 gap-4 mb-6", children: [(0, import_jsx_runtime3.jsxs)("div", { id: "video-live-preview", className: "h-full relative 2xl:w-8/12 lg:w-10/12 justify-self-end", children: [(0, import_jsx_runtime3.jsx)("video", { onClick: () => {
3007
+ setState((s) => {
3008
+ clearSelection(s.overlays);
3009
+ return { ...s };
3010
+ });
3011
+ }, id: "video-live", muted: true, autoPlay: true, ref: refLivePreviewVideo }), state.overlays.map((o, i) => {
3012
+ return (0, import_jsx_runtime3.jsx)("video", { onClick: () => {
3013
+ setState((s) => {
3014
+ selectOverlay(i, s.overlays);
3015
+ return { ...s };
3016
+ });
3017
+ }, style: {
3018
+ position: "absolute",
3019
+ left: `${o.x}px`,
3020
+ top: `${o.y}px`,
3021
+ width: `${o.width}px`,
3022
+ height: `${o.height}px`,
3023
+ border: `${o.selected ? "2px solid #FFFF00" : ""}`
3024
+ }, muted: true, autoPlay: true, ref: (ref) => {
3025
+ if (ref) {
3026
+ ref.srcObject = o.source.client.mediaStream ?? null;
3027
+ (0, import_interactjs.default)(ref).draggable({
3028
+ onstart: () => {
3029
+ setState((state2) => {
3030
+ selectOverlay(i, state2.overlays);
3031
+ return { ...state2 };
3032
+ });
3033
+ },
3034
+ listeners: {
3035
+ move: (event) => {
3036
+ o.x += event.dx;
3037
+ o.y += event.dy;
3038
+ ref.style.left = `${o.x}px`;
3039
+ ref.style.top = `${o.y}px`;
3040
+ }
3041
+ },
3042
+ inertia: true,
3043
+ modifiers: [
3044
+ import_interactjs.default.modifiers.restrictRect({
3045
+ restriction: "parent",
3046
+ endOnly: true
3047
+ })
3048
+ ]
3049
+ }).resizable({
3050
+ modifiers: [
3051
+ import_interactjs.default.modifiers.aspectRatio({ ratio: "preserve" })
3052
+ ],
3053
+ // resize from all edges and corners
3054
+ edges: { left: true, right: true, bottom: true, top: true },
3055
+ preserveAspectRatio: true,
3056
+ listeners: {
3057
+ move(event) {
3058
+ o.width = event.rect.width;
3059
+ o.height = event.rect.height;
3060
+ o.x += event.deltaRect.left;
3061
+ o.y += event.deltaRect.top;
3062
+ ref.style.left = `${o.x}px`;
3063
+ ref.style.top = `${o.y}px`;
3064
+ ref.style.width = `${o.width}px`;
3065
+ ref.style.height = `${o.height}px`;
3066
+ }
3067
+ }
3068
+ });
3069
+ }
3070
+ overlayRefs.current.push(ref);
3071
+ } }, i);
3072
+ }), (0, import_jsx_runtime3.jsxs)("button", { className: takeButtonClasses, onClick: (_e) => {
3073
+ if (state.livePreviewSource && refLivePreviewVideo.current) {
3074
+ const parentRect = refLivePreviewVideo.current.getBoundingClientRect();
3075
+ multiCamera.sendCommand({
3076
+ type: "select-source",
3077
+ source: state.livePreviewSource.source,
3078
+ overlays: state.overlays.map((o) => {
3079
+ return {
3080
+ source: o.source.source,
3081
+ destRect: {
3082
+ x: o.x / parentRect.width * multiCamera.config.resolution.width,
3083
+ y: o.y / parentRect.height * multiCamera.config.resolution.height,
3084
+ width: o.width / parentRect.width * multiCamera.config.resolution.width,
3085
+ height: o.height / parentRect.height * multiCamera.config.resolution.height
3086
+ }
3087
+ };
3088
+ })
3089
+ });
3090
+ }
3091
+ }, children: ["Take ", state.overlays.length > 0 ? "Composition" : state.livePreviewSource?.source.key ?? state.livePreviewSource?.source.id] }), state.overlays.length > 0 ? (0, import_jsx_runtime3.jsx)("button", { className: takeButtonClasses, onClick: (_e) => {
3092
+ setState({ ...state, overlays: [] });
3093
+ }, children: "Clear Composition" }) : (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}), (0, import_jsx_runtime3.jsxs)("div", { className: "absolute top-0 left-0 z-10 ml-2 mt-2 p-2 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white opacity-70", children: ["Live Preview: ", (0, import_jsx_runtime3.jsx)("span", { id: "active-source-overlay", children: state.livePreviewSource?.source.key ?? state.livePreviewSource?.source.id })] })] }), (0, import_jsx_runtime3.jsxs)("div", { className: "relative 2xl:w-8/12 lg:w-10/12 justify-self-start", children: [(0, import_jsx_runtime3.jsx)("div", { id: "preview-container-preview", className: "w-full" }), (0, import_jsx_runtime3.jsxs)("div", { className: "absolute top-0 left-0 z-10 ml-2 mt-2 p-2 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white opacity-70", children: ["Live Output: ", (0, import_jsx_runtime3.jsx)("span", { id: "active-source-overlay", children: multiCamera.state.activeSource.key ?? multiCamera.state.activeSource.id })] })] })] })] }) });
3094
+ }
3095
+ function sortSource(a, b) {
3096
+ const aKey = a.key || "";
3097
+ const bKey = b.key || "";
3098
+ if (aKey > bKey)
3099
+ return 1;
3100
+ if (aKey < bKey)
3101
+ return -1;
3102
+ return 0;
3103
+ }
3104
+ function isSourceSwitchSourceEqual(a, b) {
3105
+ return a.id === b.id && a.key === b.key;
3106
+ }
3107
+ function mkContainerId(source) {
3108
+ return `preview-container-${source.id}${source.key ? "-" + source.key : ""}`;
3109
+ }
3110
+ var import_jsx_runtime3, import_react2, import_interactjs, import_webrtc_client2, DEFAULT_OVERLAY_WIDTH, MyWhepClient, fullscreen_view_default;
3111
+ var init_fullscreen_view = __esm({
3112
+ "build/fullscreen-view.js"() {
3113
+ "use strict";
3114
+ import_jsx_runtime3 = __toESM(require_jsx_runtime());
3115
+ import_react2 = __toESM(require_react());
3116
+ import_interactjs = __toESM(require_interact_min());
3117
+ import_webrtc_client2 = __toESM(require_webrtc_client());
3118
+ DEFAULT_OVERLAY_WIDTH = 100;
3119
+ MyWhepClient = class extends import_webrtc_client2.WhepClient {
3120
+ started;
3121
+ resolveStartedPromise;
3122
+ mediaStream;
3123
+ streamId;
3124
+ streamKey;
3125
+ constructor(config) {
3126
+ super(config);
3127
+ this.streamId = config.streamId;
3128
+ this.streamKey = config.streamKey;
3129
+ this.started = new Promise((resolve, _reject) => {
3130
+ this.resolveStartedPromise = resolve;
3131
+ if (this.mediaStream) {
3132
+ this.resolveStartedPromise = void 0;
3133
+ resolve(this.mediaStream);
3134
+ }
3135
+ });
3136
+ }
3137
+ async handleGotTrack(ev) {
3138
+ if (ev.track.kind == "video" && ev.streams.length > 0) {
3139
+ this.outputVideoTracks.push(ev.track);
3140
+ }
3141
+ if (ev.track.kind == "audio") {
3142
+ this.outputAudioTrack = ev.track;
3143
+ }
3144
+ if (this.outputAudioTrack && this.outputVideoTracks.length > this.videoElements.length) {
3145
+ for (let i = 0; i < this.outputVideoTracks.length; i++) {
3146
+ if (this.videoElements[i])
3147
+ continue;
3148
+ let stream = void 0;
3149
+ if (i == 0) {
3150
+ stream = new MediaStream([this.outputAudioTrack, this.outputVideoTracks[i]]);
3151
+ } else {
3152
+ stream = new MediaStream([this.outputVideoTracks[i]]);
3153
+ }
3154
+ if (this.container) {
3155
+ const e = createPlayerElement(stream, this.container);
3156
+ this.mediaStream = stream;
3157
+ this.videoElements.push(e);
3158
+ this.resolveStartedPromise?.(stream);
3159
+ e.style.userSelect = "none";
3160
+ e.style.touchAction = "none";
3161
+ e.setAttribute("data-streamid", this.streamId);
3162
+ if (this.streamKey)
3163
+ e.setAttribute("data-streamkey", this.streamKey);
3164
+ let element = void 0;
3165
+ let target = void 0;
3166
+ (0, import_interactjs.default)(e).draggable({
3167
+ listeners: {
3168
+ start: (e2) => {
3169
+ element = document.createElement("video");
3170
+ element.controls = false;
3171
+ element.style.position = "absolute";
3172
+ element.style.left = `${e2.page.x}px`;
3173
+ element.style.top = `${e2.page.y}px`;
3174
+ element.style.width = `${DEFAULT_OVERLAY_WIDTH}px`;
3175
+ document.body.appendChild(element);
3176
+ element.muted = true;
3177
+ element.autoplay = true;
3178
+ element.srcObject = stream;
3179
+ return true;
3180
+ },
3181
+ move: (e2) => {
3182
+ if (element) {
3183
+ element.style.left = `${e2.page.x}px`;
3184
+ element.style.top = `${e2.page.y}px`;
3185
+ }
3186
+ if (e2.dragEnter) {
3187
+ target = e2.dragEnter;
3188
+ }
3189
+ if (e2.dragLeave && target) {
3190
+ target = void 0;
3191
+ }
3192
+ }
3193
+ }
3194
+ }).on("dragend", () => {
3195
+ element?.remove();
3196
+ });
3197
+ }
3198
+ }
3199
+ }
3200
+ }
3201
+ };
3202
+ fullscreen_view_default = FullScreenView;
3203
+ }
3204
+ });
3205
+
3206
+ // build/info.js
3207
+ var import_react3 = __toESM(require_react());
3208
+ var import_config = __toESM(require_config());
3209
+ function info_default(R) {
3210
+ const { defineComponent, Av, common: { Resolutions, FrameRates } } = R;
3211
+ const InlineView2 = import_react3.default.lazy(async () => Promise.resolve().then(() => (init_inline_view(), inline_view_exports)));
3212
+ const SummaryView2 = import_react3.default.lazy(async () => Promise.resolve().then(() => (init_summary_view(), summary_view_exports)));
3213
+ const FullscreenView = import_react3.default.lazy(async () => Promise.resolve().then(() => (init_fullscreen_view(), fullscreen_view_exports)));
3214
+ return defineComponent({
3215
+ identifier: "processor.sourceSwitcher",
3216
+ category: "processor",
3217
+ name: "Source Switcher",
3218
+ description: "This component manages multiple A/V (audio and video) streams from different sources, switching between the sources dynamically.",
3219
+ subscription: {
3220
+ accepts: {
3221
+ type: "multi-stream",
3222
+ media: Av
3223
+ },
3224
+ produces: {
3225
+ type: "single-stream",
3226
+ media: Av
3227
+ }
3228
+ },
3229
+ extraValidation: (ctx) => {
3230
+ ctx.subscriptions.forEach((s) => {
3231
+ if (s.validatedStreams.select.includes("audio") && s.validatedStreams.select.includes("video")) {
3232
+ return;
3233
+ }
3234
+ ctx.addError("Each subscription for Source Switcher must contain both video *and* audio, subscription to " + s.source + " only contains " + s.validatedStreams.select.join(","));
3235
+ });
3236
+ },
3237
+ display: (desc) => {
3238
+ return {
3239
+ resolution: desc.config.resolution.width.toString() + "x" + desc.config.resolution.height.toString(),
3240
+ frameRate: desc.config.frameRate.frames.toString() + "/" + desc.config.frameRate.seconds.toString()
3241
+ };
3242
+ },
3243
+ css: [
3244
+ "style.css",
3245
+ "tailwind.css"
3246
+ ],
3247
+ runtime: {
3248
+ initialState: () => ({
3249
+ activeSource: { id: "" },
3250
+ activeOverlays: [],
3251
+ availableSources: [],
3252
+ knownSources: [],
3253
+ players: []
3254
+ }),
3255
+ handleEvent: (ev, state) => {
3256
+ const evType = ev.type;
3257
+ switch (evType) {
3258
+ case "active-source-changed":
3259
+ return { ...state, activeSource: ev.activeSource, activeOverlays: ev.overlays };
3260
+ case "source-online":
3261
+ state.availableSources.push(ev.source);
3262
+ return { ...state };
3263
+ case "player-online":
3264
+ state.players.push({ source: ev.source, player: ev.url });
3265
+ return { ...state };
3266
+ case "preview-player-online":
3267
+ state.previewPlayerUrl = ev.url;
3268
+ return { ...state };
3269
+ case "source-offline": {
3270
+ const sourceIndex = state.availableSources.findIndex((s) => s.key == ev.source.key && s.id == ev.source.id);
3271
+ const playerIndex = state.players.findIndex((s) => s.source.key == ev.source.key && s.source.id == ev.source.id);
3272
+ if (sourceIndex >= 0)
3273
+ state.availableSources.splice(sourceIndex, 1);
3274
+ if (playerIndex >= 0)
3275
+ state.players.splice(playerIndex, 1);
3276
+ return { ...state };
3277
+ }
3278
+ case "sources-discovered": {
3279
+ state.knownSources = ev.sources;
3280
+ return { ...state };
3281
+ }
3282
+ default:
3283
+ assertUnreachable(evType);
3284
+ }
3285
+ },
3286
+ inline: InlineView2,
3287
+ summary: SummaryView2,
3288
+ fullscreen: FullscreenView
3289
+ },
3290
+ configForm: {
3291
+ global: {
3292
+ iceServers: (0, import_config.GlobalIceServers)(R),
3293
+ hardware: (0, import_config.HardwareSelection)()
3294
+ },
3295
+ form: {
3296
+ enablePreviews: {
3297
+ help: "Are previews auomatically created for all inputs and output",
3298
+ hint: { type: "boolean", defaultValue: false }
3299
+ },
3300
+ resolution: {
3301
+ help: "All video will be normalised to this resolution",
3302
+ hint: { type: "select", options: Resolutions, defaultValue: { width: 1920, height: 1080 } }
3303
+ },
3304
+ frameRate: {
3305
+ help: "All video will be normalised to this frame rate",
3306
+ hint: { type: "select", options: FrameRates, defaultValue: { frames: 25, seconds: 1 } }
3307
+ },
3308
+ sampleRate: {
3309
+ help: "All audio will be normalised to this sample rate",
3310
+ hint: {
3311
+ defaultValue: 48e3,
3312
+ type: "select",
3313
+ options: [
3314
+ { value: 48e3, display: "48000" },
3315
+ { value: 44100, display: "44100" }
3316
+ ]
3317
+ }
3318
+ },
3319
+ channelLayout: {
3320
+ help: "All audio will be normalised to this channel layout",
3321
+ hint: {
3322
+ defaultValue: "stereo",
3323
+ type: "select",
3324
+ options: [
3325
+ { value: "mono", display: "Mono" },
3326
+ { value: "stereo", display: "Stereo" }
3327
+ ]
3328
+ }
3329
+ }
3330
+ }
3331
+ }
3332
+ });
3333
+ }
3334
+ function assertUnreachable(_) {
3335
+ throw new Error("Didn't expect to get here");
3336
+ }
3337
+ export {
3338
+ info_default as default
3339
+ };