@mnykj/wangeditoroptimize-video-module 1.0.0
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/README.md +3 -0
- package/dist/css/style.css +1 -0
- package/dist/index.esm.js +4528 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/video-module/src/constants/svg.d.ts +11 -0
- package/dist/video-module/src/index.d.ts +8 -0
- package/dist/video-module/src/locale/en.d.ts +20 -0
- package/dist/video-module/src/locale/index.d.ts +5 -0
- package/dist/video-module/src/locale/zh-CN.d.ts +20 -0
- package/dist/video-module/src/module/custom-types.d.ts +18 -0
- package/dist/video-module/src/module/elem-to-html.d.ts +11 -0
- package/dist/video-module/src/module/helper/align.d.ts +5 -0
- package/dist/video-module/src/module/helper/insert-video.d.ts +12 -0
- package/dist/video-module/src/module/helper/upload-videos.d.ts +6 -0
- package/dist/video-module/src/module/index.d.ts +7 -0
- package/dist/video-module/src/module/menu/EditVideoSizeMenu.d.ts +25 -0
- package/dist/video-module/src/module/menu/InsertVideoMenu.d.ts +25 -0
- package/dist/video-module/src/module/menu/UploadVideoMenu.d.ts +16 -0
- package/dist/video-module/src/module/menu/config.d.ts +33 -0
- package/dist/video-module/src/module/menu/index.d.ts +25 -0
- package/dist/video-module/src/module/parse-elem-html.d.ts +14 -0
- package/dist/video-module/src/module/plugin.d.ts +7 -0
- package/dist/video-module/src/module/pre-parse-html.d.ts +15 -0
- package/dist/video-module/src/module/render-elem.d.ts +13 -0
- package/dist/video-module/src/utils/dom.d.ts +28 -0
- package/dist/video-module/src/utils/util.d.ts +11 -0
- package/package.json +52 -0
|
@@ -0,0 +1,4528 @@
|
|
|
1
|
+
import { i18nAddResources, DomEditor, canRemoveEmptyLineAboveBlock, resolveElemPath, insertEmptyLineAboveAtPath, removeEmptyLineAboveTopLevelBlock, replaceBlockWithEmptyLine, t, genModalInputElems, genModalButtonElems, createUploader } from '@mnykj/wangeditoroptimize-core';
|
|
2
|
+
import { Transforms, Node, Range } from 'slate';
|
|
3
|
+
import { h, jsx } from 'snabbdom';
|
|
4
|
+
import $, { append, on, focus, attr, val, html as html$1, parent, hasClass, empty as empty$1 } from 'dom7';
|
|
5
|
+
import { nanoid } from 'nanoid';
|
|
6
|
+
|
|
7
|
+
var enResources = {
|
|
8
|
+
videoModule: {
|
|
9
|
+
delete: 'Delete',
|
|
10
|
+
uploadVideo: 'Upload video',
|
|
11
|
+
insertVideo: 'Insert video',
|
|
12
|
+
videoSrc: 'Video source',
|
|
13
|
+
videoSrcPlaceHolder: 'Video file url, or third-party <iframe>',
|
|
14
|
+
videoPoster: 'Video poster',
|
|
15
|
+
videoPosterPlaceHolder: 'Poster image url',
|
|
16
|
+
ok: 'Ok',
|
|
17
|
+
editSize: 'Edit size',
|
|
18
|
+
width: 'Width',
|
|
19
|
+
height: 'Height'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var zhResources = {
|
|
24
|
+
videoModule: {
|
|
25
|
+
delete: '删除视频',
|
|
26
|
+
uploadVideo: '上传视频',
|
|
27
|
+
insertVideo: '插入视频',
|
|
28
|
+
videoSrc: '视频地址',
|
|
29
|
+
videoSrcPlaceHolder: '视频文件 url 或第三方 <iframe>',
|
|
30
|
+
videoPoster: '视频封面',
|
|
31
|
+
videoPosterPlaceHolder: '封面图片 url',
|
|
32
|
+
ok: '确定',
|
|
33
|
+
editSize: '修改尺寸',
|
|
34
|
+
width: '宽度',
|
|
35
|
+
height: '高度'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
i18nAddResources('en', enResources);
|
|
40
|
+
i18nAddResources('zh-CN', zhResources);
|
|
41
|
+
|
|
42
|
+
/******************************************************************************
|
|
43
|
+
Copyright (c) Microsoft Corporation.
|
|
44
|
+
|
|
45
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
46
|
+
purpose with or without fee is hereby granted.
|
|
47
|
+
|
|
48
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
49
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
50
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
51
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
52
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
53
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
54
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
55
|
+
***************************************************************************** */
|
|
56
|
+
|
|
57
|
+
var __assign = function() {
|
|
58
|
+
__assign = Object.assign || function __assign(t) {
|
|
59
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
60
|
+
s = arguments[i];
|
|
61
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
62
|
+
}
|
|
63
|
+
return t;
|
|
64
|
+
};
|
|
65
|
+
return __assign.apply(this, arguments);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
69
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
70
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
71
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
72
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
73
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
74
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function __generator(thisArg, body) {
|
|
79
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
80
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
81
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
82
|
+
function step(op) {
|
|
83
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
84
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
85
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
86
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
87
|
+
switch (op[0]) {
|
|
88
|
+
case 0: case 1: t = op; break;
|
|
89
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
90
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
91
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
92
|
+
default:
|
|
93
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
94
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
95
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
96
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
97
|
+
if (t[2]) _.ops.pop();
|
|
98
|
+
_.trys.pop(); continue;
|
|
99
|
+
}
|
|
100
|
+
op = body.call(thisArg, _);
|
|
101
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
102
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function __values(o) {
|
|
107
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
108
|
+
if (m) return m.call(o);
|
|
109
|
+
if (o && typeof o.length === "number") return {
|
|
110
|
+
next: function () {
|
|
111
|
+
if (o && i >= o.length) o = void 0;
|
|
112
|
+
return { value: o && o[i++], done: !o };
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function __read(o, n) {
|
|
119
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
120
|
+
if (!m) return o;
|
|
121
|
+
var i = m.call(o), r, ar = [], e;
|
|
122
|
+
try {
|
|
123
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
124
|
+
}
|
|
125
|
+
catch (error) { e = { error: error }; }
|
|
126
|
+
finally {
|
|
127
|
+
try {
|
|
128
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
129
|
+
}
|
|
130
|
+
finally { if (e) throw e.error; }
|
|
131
|
+
}
|
|
132
|
+
return ar;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function __asyncValues(o) {
|
|
136
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
137
|
+
var m = o[Symbol.asyncIterator], i;
|
|
138
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
139
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
140
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
144
|
+
var e = new Error(message);
|
|
145
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
function withVideo(editor) {
|
|
149
|
+
var isVoid = editor.isVoid,
|
|
150
|
+
normalizeNode = editor.normalizeNode;
|
|
151
|
+
var newEditor = editor;
|
|
152
|
+
newEditor.isVoid = function (elem) {
|
|
153
|
+
var type = elem.type;
|
|
154
|
+
if (type === 'video') {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
return isVoid(elem);
|
|
158
|
+
};
|
|
159
|
+
newEditor.normalizeNode = function (_a) {
|
|
160
|
+
var _b = __read(_a, 2),
|
|
161
|
+
node = _b[0],
|
|
162
|
+
path = _b[1];
|
|
163
|
+
var type = DomEditor.getNodeType(node);
|
|
164
|
+
if (type === 'video') {
|
|
165
|
+
var isLast = DomEditor.isLastNode(newEditor, node);
|
|
166
|
+
if (isLast) {
|
|
167
|
+
Transforms.insertNodes(newEditor, DomEditor.genEmptyParagraph(), {
|
|
168
|
+
at: [path[0] + 1]
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return normalizeNode([node, path]);
|
|
173
|
+
};
|
|
174
|
+
return newEditor;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
178
|
+
|
|
179
|
+
function createCommonjsModule(fn) {
|
|
180
|
+
var module = { exports: {} };
|
|
181
|
+
return fn(module, module.exports), module.exports;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var check = function (it) {
|
|
185
|
+
return it && it.Math == Math && it;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
189
|
+
var global$1 =
|
|
190
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
191
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
192
|
+
check(typeof window == 'object' && window) ||
|
|
193
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
194
|
+
check(typeof self == 'object' && self) ||
|
|
195
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
196
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
197
|
+
(function () { return this; })() || Function('return this')();
|
|
198
|
+
|
|
199
|
+
var fails = function (exec) {
|
|
200
|
+
try {
|
|
201
|
+
return !!exec();
|
|
202
|
+
} catch (error) {
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
208
|
+
var descriptors = !fails(function () {
|
|
209
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
210
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
var call$2 = Function.prototype.call;
|
|
214
|
+
|
|
215
|
+
var functionCall = call$2.bind ? call$2.bind(call$2) : function () {
|
|
216
|
+
return call$2.apply(call$2, arguments);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
220
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
221
|
+
var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
|
222
|
+
|
|
223
|
+
// Nashorn ~ JDK8 bug
|
|
224
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
225
|
+
|
|
226
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
227
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
228
|
+
var f$6 = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
229
|
+
var descriptor = getOwnPropertyDescriptor$2(this, V);
|
|
230
|
+
return !!descriptor && descriptor.enumerable;
|
|
231
|
+
} : $propertyIsEnumerable;
|
|
232
|
+
|
|
233
|
+
var objectPropertyIsEnumerable = {
|
|
234
|
+
f: f$6
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
var createPropertyDescriptor = function (bitmap, value) {
|
|
238
|
+
return {
|
|
239
|
+
enumerable: !(bitmap & 1),
|
|
240
|
+
configurable: !(bitmap & 2),
|
|
241
|
+
writable: !(bitmap & 4),
|
|
242
|
+
value: value
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
var FunctionPrototype$3 = Function.prototype;
|
|
247
|
+
var bind$3 = FunctionPrototype$3.bind;
|
|
248
|
+
var call$1 = FunctionPrototype$3.call;
|
|
249
|
+
var callBind = bind$3 && bind$3.bind(call$1);
|
|
250
|
+
|
|
251
|
+
var functionUncurryThis = bind$3 ? function (fn) {
|
|
252
|
+
return fn && callBind(call$1, fn);
|
|
253
|
+
} : function (fn) {
|
|
254
|
+
return fn && function () {
|
|
255
|
+
return call$1.apply(fn, arguments);
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
var toString$2 = functionUncurryThis({}.toString);
|
|
260
|
+
var stringSlice$4 = functionUncurryThis(''.slice);
|
|
261
|
+
|
|
262
|
+
var classofRaw = function (it) {
|
|
263
|
+
return stringSlice$4(toString$2(it), 8, -1);
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
var Object$5 = global$1.Object;
|
|
267
|
+
var split = functionUncurryThis(''.split);
|
|
268
|
+
|
|
269
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
270
|
+
var indexedObject = fails(function () {
|
|
271
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
272
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
273
|
+
return !Object$5('z').propertyIsEnumerable(0);
|
|
274
|
+
}) ? function (it) {
|
|
275
|
+
return classofRaw(it) == 'String' ? split(it, '') : Object$5(it);
|
|
276
|
+
} : Object$5;
|
|
277
|
+
|
|
278
|
+
var TypeError$e = global$1.TypeError;
|
|
279
|
+
|
|
280
|
+
// `RequireObjectCoercible` abstract operation
|
|
281
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
282
|
+
var requireObjectCoercible = function (it) {
|
|
283
|
+
if (it == undefined) throw TypeError$e("Can't call method on " + it);
|
|
284
|
+
return it;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
var toIndexedObject = function (it) {
|
|
292
|
+
return indexedObject(requireObjectCoercible(it));
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// `IsCallable` abstract operation
|
|
296
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
297
|
+
var isCallable = function (argument) {
|
|
298
|
+
return typeof argument == 'function';
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
var isObject = function (it) {
|
|
302
|
+
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
var aFunction = function (argument) {
|
|
306
|
+
return isCallable(argument) ? argument : undefined;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
var getBuiltIn = function (namespace, method) {
|
|
310
|
+
return arguments.length < 2 ? aFunction(global$1[namespace]) : global$1[namespace] && global$1[namespace][method];
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
314
|
+
|
|
315
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
316
|
+
|
|
317
|
+
var process$3 = global$1.process;
|
|
318
|
+
var Deno = global$1.Deno;
|
|
319
|
+
var versions = process$3 && process$3.versions || Deno && Deno.version;
|
|
320
|
+
var v8 = versions && versions.v8;
|
|
321
|
+
var match, version;
|
|
322
|
+
|
|
323
|
+
if (v8) {
|
|
324
|
+
match = v8.split('.');
|
|
325
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
326
|
+
// but their correct versions are not interesting for us
|
|
327
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
331
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
332
|
+
if (!version && engineUserAgent) {
|
|
333
|
+
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
334
|
+
if (!match || match[1] >= 74) {
|
|
335
|
+
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
336
|
+
if (match) version = +match[1];
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
var engineV8Version = version;
|
|
341
|
+
|
|
342
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
343
|
+
|
|
344
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
345
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
346
|
+
var symbol = Symbol();
|
|
347
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
348
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
349
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
350
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
351
|
+
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
355
|
+
|
|
356
|
+
var useSymbolAsUid = nativeSymbol
|
|
357
|
+
&& !Symbol.sham
|
|
358
|
+
&& typeof Symbol.iterator == 'symbol';
|
|
359
|
+
|
|
360
|
+
var Object$4 = global$1.Object;
|
|
361
|
+
|
|
362
|
+
var isSymbol = useSymbolAsUid ? function (it) {
|
|
363
|
+
return typeof it == 'symbol';
|
|
364
|
+
} : function (it) {
|
|
365
|
+
var $Symbol = getBuiltIn('Symbol');
|
|
366
|
+
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$4(it));
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
var String$5 = global$1.String;
|
|
370
|
+
|
|
371
|
+
var tryToString = function (argument) {
|
|
372
|
+
try {
|
|
373
|
+
return String$5(argument);
|
|
374
|
+
} catch (error) {
|
|
375
|
+
return 'Object';
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
var TypeError$d = global$1.TypeError;
|
|
380
|
+
|
|
381
|
+
// `Assert: IsCallable(argument) is true`
|
|
382
|
+
var aCallable = function (argument) {
|
|
383
|
+
if (isCallable(argument)) return argument;
|
|
384
|
+
throw TypeError$d(tryToString(argument) + ' is not a function');
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
// `GetMethod` abstract operation
|
|
388
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
389
|
+
var getMethod = function (V, P) {
|
|
390
|
+
var func = V[P];
|
|
391
|
+
return func == null ? undefined : aCallable(func);
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
var TypeError$c = global$1.TypeError;
|
|
395
|
+
|
|
396
|
+
// `OrdinaryToPrimitive` abstract operation
|
|
397
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
398
|
+
var ordinaryToPrimitive = function (input, pref) {
|
|
399
|
+
var fn, val;
|
|
400
|
+
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
401
|
+
if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
|
|
402
|
+
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
403
|
+
throw TypeError$c("Can't convert object to primitive value");
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
407
|
+
var defineProperty$2 = Object.defineProperty;
|
|
408
|
+
|
|
409
|
+
var setGlobal = function (key, value) {
|
|
410
|
+
try {
|
|
411
|
+
defineProperty$2(global$1, key, { value: value, configurable: true, writable: true });
|
|
412
|
+
} catch (error) {
|
|
413
|
+
global$1[key] = value;
|
|
414
|
+
} return value;
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
var SHARED = '__core-js_shared__';
|
|
418
|
+
var store$1 = global$1[SHARED] || setGlobal(SHARED, {});
|
|
419
|
+
|
|
420
|
+
var sharedStore = store$1;
|
|
421
|
+
|
|
422
|
+
var shared = createCommonjsModule(function (module) {
|
|
423
|
+
(module.exports = function (key, value) {
|
|
424
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
425
|
+
})('versions', []).push({
|
|
426
|
+
version: '3.19.3',
|
|
427
|
+
mode: 'global',
|
|
428
|
+
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
var Object$3 = global$1.Object;
|
|
433
|
+
|
|
434
|
+
// `ToObject` abstract operation
|
|
435
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
436
|
+
var toObject = function (argument) {
|
|
437
|
+
return Object$3(requireObjectCoercible(argument));
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
441
|
+
|
|
442
|
+
// `HasOwnProperty` abstract operation
|
|
443
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
444
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
445
|
+
return hasOwnProperty(toObject(it), key);
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
var id$1 = 0;
|
|
449
|
+
var postfix = Math.random();
|
|
450
|
+
var toString$1 = functionUncurryThis(1.0.toString);
|
|
451
|
+
|
|
452
|
+
var uid = function (key) {
|
|
453
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$1(++id$1 + postfix, 36);
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
457
|
+
var Symbol$1 = global$1.Symbol;
|
|
458
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
459
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
460
|
+
|
|
461
|
+
var wellKnownSymbol = function (name) {
|
|
462
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
463
|
+
var description = 'Symbol.' + name;
|
|
464
|
+
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
|
|
465
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
466
|
+
} else if (useSymbolAsUid && symbolFor) {
|
|
467
|
+
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
468
|
+
} else {
|
|
469
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
470
|
+
}
|
|
471
|
+
} return WellKnownSymbolsStore[name];
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
var TypeError$b = global$1.TypeError;
|
|
475
|
+
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
476
|
+
|
|
477
|
+
// `ToPrimitive` abstract operation
|
|
478
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
479
|
+
var toPrimitive = function (input, pref) {
|
|
480
|
+
if (!isObject(input) || isSymbol(input)) return input;
|
|
481
|
+
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
482
|
+
var result;
|
|
483
|
+
if (exoticToPrim) {
|
|
484
|
+
if (pref === undefined) pref = 'default';
|
|
485
|
+
result = functionCall(exoticToPrim, input, pref);
|
|
486
|
+
if (!isObject(result) || isSymbol(result)) return result;
|
|
487
|
+
throw TypeError$b("Can't convert object to primitive value");
|
|
488
|
+
}
|
|
489
|
+
if (pref === undefined) pref = 'number';
|
|
490
|
+
return ordinaryToPrimitive(input, pref);
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
// `ToPropertyKey` abstract operation
|
|
494
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
495
|
+
var toPropertyKey = function (argument) {
|
|
496
|
+
var key = toPrimitive(argument, 'string');
|
|
497
|
+
return isSymbol(key) ? key : key + '';
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
var document$3 = global$1.document;
|
|
501
|
+
// typeof document.createElement is 'object' in old IE
|
|
502
|
+
var EXISTS$1 = isObject(document$3) && isObject(document$3.createElement);
|
|
503
|
+
|
|
504
|
+
var documentCreateElement = function (it) {
|
|
505
|
+
return EXISTS$1 ? document$3.createElement(it) : {};
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
// Thank's IE8 for his funny defineProperty
|
|
509
|
+
var ie8DomDefine = !descriptors && !fails(function () {
|
|
510
|
+
// eslint-disable-next-line es/no-object-defineproperty -- requied for testing
|
|
511
|
+
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
512
|
+
get: function () { return 7; }
|
|
513
|
+
}).a != 7;
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
517
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
518
|
+
|
|
519
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
520
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
521
|
+
var f$5 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
522
|
+
O = toIndexedObject(O);
|
|
523
|
+
P = toPropertyKey(P);
|
|
524
|
+
if (ie8DomDefine) try {
|
|
525
|
+
return $getOwnPropertyDescriptor(O, P);
|
|
526
|
+
} catch (error) { /* empty */ }
|
|
527
|
+
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
var objectGetOwnPropertyDescriptor = {
|
|
531
|
+
f: f$5
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
var String$4 = global$1.String;
|
|
535
|
+
var TypeError$a = global$1.TypeError;
|
|
536
|
+
|
|
537
|
+
// `Assert: Type(argument) is Object`
|
|
538
|
+
var anObject = function (argument) {
|
|
539
|
+
if (isObject(argument)) return argument;
|
|
540
|
+
throw TypeError$a(String$4(argument) + ' is not an object');
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
var TypeError$9 = global$1.TypeError;
|
|
544
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
545
|
+
var $defineProperty = Object.defineProperty;
|
|
546
|
+
|
|
547
|
+
// `Object.defineProperty` method
|
|
548
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
549
|
+
var f$4 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
|
|
550
|
+
anObject(O);
|
|
551
|
+
P = toPropertyKey(P);
|
|
552
|
+
anObject(Attributes);
|
|
553
|
+
if (ie8DomDefine) try {
|
|
554
|
+
return $defineProperty(O, P, Attributes);
|
|
555
|
+
} catch (error) { /* empty */ }
|
|
556
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError$9('Accessors not supported');
|
|
557
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
558
|
+
return O;
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
var objectDefineProperty = {
|
|
562
|
+
f: f$4
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
566
|
+
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
|
567
|
+
} : function (object, key, value) {
|
|
568
|
+
object[key] = value;
|
|
569
|
+
return object;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
var functionToString$1 = functionUncurryThis(Function.toString);
|
|
573
|
+
|
|
574
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
575
|
+
if (!isCallable(sharedStore.inspectSource)) {
|
|
576
|
+
sharedStore.inspectSource = function (it) {
|
|
577
|
+
return functionToString$1(it);
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
var inspectSource = sharedStore.inspectSource;
|
|
582
|
+
|
|
583
|
+
var WeakMap$2 = global$1.WeakMap;
|
|
584
|
+
|
|
585
|
+
var nativeWeakMap = isCallable(WeakMap$2) && /native code/.test(inspectSource(WeakMap$2));
|
|
586
|
+
|
|
587
|
+
var keys = shared('keys');
|
|
588
|
+
|
|
589
|
+
var sharedKey = function (key) {
|
|
590
|
+
return keys[key] || (keys[key] = uid(key));
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
var hiddenKeys$1 = {};
|
|
594
|
+
|
|
595
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
596
|
+
var TypeError$8 = global$1.TypeError;
|
|
597
|
+
var WeakMap$1 = global$1.WeakMap;
|
|
598
|
+
var set$1, get, has;
|
|
599
|
+
|
|
600
|
+
var enforce = function (it) {
|
|
601
|
+
return has(it) ? get(it) : set$1(it, {});
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
var getterFor = function (TYPE) {
|
|
605
|
+
return function (it) {
|
|
606
|
+
var state;
|
|
607
|
+
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
608
|
+
throw TypeError$8('Incompatible receiver, ' + TYPE + ' required');
|
|
609
|
+
} return state;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
if (nativeWeakMap || sharedStore.state) {
|
|
614
|
+
var store = sharedStore.state || (sharedStore.state = new WeakMap$1());
|
|
615
|
+
var wmget = functionUncurryThis(store.get);
|
|
616
|
+
var wmhas = functionUncurryThis(store.has);
|
|
617
|
+
var wmset = functionUncurryThis(store.set);
|
|
618
|
+
set$1 = function (it, metadata) {
|
|
619
|
+
if (wmhas(store, it)) throw new TypeError$8(OBJECT_ALREADY_INITIALIZED);
|
|
620
|
+
metadata.facade = it;
|
|
621
|
+
wmset(store, it, metadata);
|
|
622
|
+
return metadata;
|
|
623
|
+
};
|
|
624
|
+
get = function (it) {
|
|
625
|
+
return wmget(store, it) || {};
|
|
626
|
+
};
|
|
627
|
+
has = function (it) {
|
|
628
|
+
return wmhas(store, it);
|
|
629
|
+
};
|
|
630
|
+
} else {
|
|
631
|
+
var STATE = sharedKey('state');
|
|
632
|
+
hiddenKeys$1[STATE] = true;
|
|
633
|
+
set$1 = function (it, metadata) {
|
|
634
|
+
if (hasOwnProperty_1(it, STATE)) throw new TypeError$8(OBJECT_ALREADY_INITIALIZED);
|
|
635
|
+
metadata.facade = it;
|
|
636
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
|
637
|
+
return metadata;
|
|
638
|
+
};
|
|
639
|
+
get = function (it) {
|
|
640
|
+
return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
|
|
641
|
+
};
|
|
642
|
+
has = function (it) {
|
|
643
|
+
return hasOwnProperty_1(it, STATE);
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
var internalState = {
|
|
648
|
+
set: set$1,
|
|
649
|
+
get: get,
|
|
650
|
+
has: has,
|
|
651
|
+
enforce: enforce,
|
|
652
|
+
getterFor: getterFor
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
var FunctionPrototype$2 = Function.prototype;
|
|
656
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
657
|
+
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
658
|
+
|
|
659
|
+
var EXISTS = hasOwnProperty_1(FunctionPrototype$2, 'name');
|
|
660
|
+
// additional protection from minified / mangled / dropped function names
|
|
661
|
+
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
662
|
+
var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$2, 'name').configurable));
|
|
663
|
+
|
|
664
|
+
var functionName = {
|
|
665
|
+
EXISTS: EXISTS,
|
|
666
|
+
PROPER: PROPER,
|
|
667
|
+
CONFIGURABLE: CONFIGURABLE
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
var redefine = createCommonjsModule(function (module) {
|
|
671
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
672
|
+
|
|
673
|
+
var getInternalState = internalState.get;
|
|
674
|
+
var enforceInternalState = internalState.enforce;
|
|
675
|
+
var TEMPLATE = String(String).split('String');
|
|
676
|
+
|
|
677
|
+
(module.exports = function (O, key, value, options) {
|
|
678
|
+
var unsafe = options ? !!options.unsafe : false;
|
|
679
|
+
var simple = options ? !!options.enumerable : false;
|
|
680
|
+
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
681
|
+
var name = options && options.name !== undefined ? options.name : key;
|
|
682
|
+
var state;
|
|
683
|
+
if (isCallable(value)) {
|
|
684
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
685
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
686
|
+
}
|
|
687
|
+
if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
688
|
+
createNonEnumerableProperty(value, 'name', name);
|
|
689
|
+
}
|
|
690
|
+
state = enforceInternalState(value);
|
|
691
|
+
if (!state.source) {
|
|
692
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
if (O === global$1) {
|
|
696
|
+
if (simple) O[key] = value;
|
|
697
|
+
else setGlobal(key, value);
|
|
698
|
+
return;
|
|
699
|
+
} else if (!unsafe) {
|
|
700
|
+
delete O[key];
|
|
701
|
+
} else if (!noTargetGet && O[key]) {
|
|
702
|
+
simple = true;
|
|
703
|
+
}
|
|
704
|
+
if (simple) O[key] = value;
|
|
705
|
+
else createNonEnumerableProperty(O, key, value);
|
|
706
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
707
|
+
})(Function.prototype, 'toString', function toString() {
|
|
708
|
+
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
709
|
+
});
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
var ceil = Math.ceil;
|
|
713
|
+
var floor$1 = Math.floor;
|
|
714
|
+
|
|
715
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
716
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
717
|
+
var toIntegerOrInfinity = function (argument) {
|
|
718
|
+
var number = +argument;
|
|
719
|
+
// eslint-disable-next-line no-self-compare -- safe
|
|
720
|
+
return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
var max$3 = Math.max;
|
|
724
|
+
var min$2 = Math.min;
|
|
725
|
+
|
|
726
|
+
// Helper for a popular repeating case of the spec:
|
|
727
|
+
// Let integer be ? ToInteger(index).
|
|
728
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
729
|
+
var toAbsoluteIndex = function (index, length) {
|
|
730
|
+
var integer = toIntegerOrInfinity(index);
|
|
731
|
+
return integer < 0 ? max$3(integer + length, 0) : min$2(integer, length);
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
var min$1 = Math.min;
|
|
735
|
+
|
|
736
|
+
// `ToLength` abstract operation
|
|
737
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
738
|
+
var toLength = function (argument) {
|
|
739
|
+
return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
// `LengthOfArrayLike` abstract operation
|
|
743
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
744
|
+
var lengthOfArrayLike = function (obj) {
|
|
745
|
+
return toLength(obj.length);
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
749
|
+
var createMethod$3 = function (IS_INCLUDES) {
|
|
750
|
+
return function ($this, el, fromIndex) {
|
|
751
|
+
var O = toIndexedObject($this);
|
|
752
|
+
var length = lengthOfArrayLike(O);
|
|
753
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
|
754
|
+
var value;
|
|
755
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
756
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
757
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
758
|
+
value = O[index++];
|
|
759
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
760
|
+
if (value != value) return true;
|
|
761
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
762
|
+
} else for (;length > index; index++) {
|
|
763
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
764
|
+
} return !IS_INCLUDES && -1;
|
|
765
|
+
};
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
var arrayIncludes = {
|
|
769
|
+
// `Array.prototype.includes` method
|
|
770
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
771
|
+
includes: createMethod$3(true),
|
|
772
|
+
// `Array.prototype.indexOf` method
|
|
773
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
774
|
+
indexOf: createMethod$3(false)
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
var indexOf$1 = arrayIncludes.indexOf;
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
var push$2 = functionUncurryThis([].push);
|
|
781
|
+
|
|
782
|
+
var objectKeysInternal = function (object, names) {
|
|
783
|
+
var O = toIndexedObject(object);
|
|
784
|
+
var i = 0;
|
|
785
|
+
var result = [];
|
|
786
|
+
var key;
|
|
787
|
+
for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$2(result, key);
|
|
788
|
+
// Don't enum bug & hidden keys
|
|
789
|
+
while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
|
|
790
|
+
~indexOf$1(result, key) || push$2(result, key);
|
|
791
|
+
}
|
|
792
|
+
return result;
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
// IE8- don't enum bug keys
|
|
796
|
+
var enumBugKeys = [
|
|
797
|
+
'constructor',
|
|
798
|
+
'hasOwnProperty',
|
|
799
|
+
'isPrototypeOf',
|
|
800
|
+
'propertyIsEnumerable',
|
|
801
|
+
'toLocaleString',
|
|
802
|
+
'toString',
|
|
803
|
+
'valueOf'
|
|
804
|
+
];
|
|
805
|
+
|
|
806
|
+
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
|
807
|
+
|
|
808
|
+
// `Object.getOwnPropertyNames` method
|
|
809
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
810
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
811
|
+
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
812
|
+
return objectKeysInternal(O, hiddenKeys);
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
var objectGetOwnPropertyNames = {
|
|
816
|
+
f: f$3
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
820
|
+
var f$2 = Object.getOwnPropertySymbols;
|
|
821
|
+
|
|
822
|
+
var objectGetOwnPropertySymbols = {
|
|
823
|
+
f: f$2
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
var concat$1 = functionUncurryThis([].concat);
|
|
827
|
+
|
|
828
|
+
// all object keys, includes non-enumerable and symbols
|
|
829
|
+
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
830
|
+
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
831
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
832
|
+
return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
|
|
833
|
+
};
|
|
834
|
+
|
|
835
|
+
var copyConstructorProperties = function (target, source) {
|
|
836
|
+
var keys = ownKeys(source);
|
|
837
|
+
var defineProperty = objectDefineProperty.f;
|
|
838
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
839
|
+
for (var i = 0; i < keys.length; i++) {
|
|
840
|
+
var key = keys[i];
|
|
841
|
+
if (!hasOwnProperty_1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
|
|
845
|
+
var replacement = /#|\.prototype\./;
|
|
846
|
+
|
|
847
|
+
var isForced = function (feature, detection) {
|
|
848
|
+
var value = data[normalize(feature)];
|
|
849
|
+
return value == POLYFILL ? true
|
|
850
|
+
: value == NATIVE ? false
|
|
851
|
+
: isCallable(detection) ? fails(detection)
|
|
852
|
+
: !!detection;
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
var normalize = isForced.normalize = function (string) {
|
|
856
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
var data = isForced.data = {};
|
|
860
|
+
var NATIVE = isForced.NATIVE = 'N';
|
|
861
|
+
var POLYFILL = isForced.POLYFILL = 'P';
|
|
862
|
+
|
|
863
|
+
var isForced_1 = isForced;
|
|
864
|
+
|
|
865
|
+
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
/*
|
|
873
|
+
options.target - name of the target object
|
|
874
|
+
options.global - target is the global object
|
|
875
|
+
options.stat - export as static methods of target
|
|
876
|
+
options.proto - export as prototype methods of target
|
|
877
|
+
options.real - real prototype method for the `pure` version
|
|
878
|
+
options.forced - export even if the native feature is available
|
|
879
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
880
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
881
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
882
|
+
options.sham - add a flag to not completely full polyfills
|
|
883
|
+
options.enumerable - export as enumerable property
|
|
884
|
+
options.noTargetGet - prevent calling a getter on target
|
|
885
|
+
options.name - the .name of the function if it does not match the key
|
|
886
|
+
*/
|
|
887
|
+
var _export = function (options, source) {
|
|
888
|
+
var TARGET = options.target;
|
|
889
|
+
var GLOBAL = options.global;
|
|
890
|
+
var STATIC = options.stat;
|
|
891
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
892
|
+
if (GLOBAL) {
|
|
893
|
+
target = global$1;
|
|
894
|
+
} else if (STATIC) {
|
|
895
|
+
target = global$1[TARGET] || setGlobal(TARGET, {});
|
|
896
|
+
} else {
|
|
897
|
+
target = (global$1[TARGET] || {}).prototype;
|
|
898
|
+
}
|
|
899
|
+
if (target) for (key in source) {
|
|
900
|
+
sourceProperty = source[key];
|
|
901
|
+
if (options.noTargetGet) {
|
|
902
|
+
descriptor = getOwnPropertyDescriptor$1(target, key);
|
|
903
|
+
targetProperty = descriptor && descriptor.value;
|
|
904
|
+
} else targetProperty = target[key];
|
|
905
|
+
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
906
|
+
// contained in target
|
|
907
|
+
if (!FORCED && targetProperty !== undefined) {
|
|
908
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
909
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
|
910
|
+
}
|
|
911
|
+
// add a flag to not completely full polyfills
|
|
912
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
913
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
914
|
+
}
|
|
915
|
+
// extend global
|
|
916
|
+
redefine(target, key, sourceProperty, options);
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
var arrayMethodIsStrict = function (METHOD_NAME, argument) {
|
|
921
|
+
var method = [][METHOD_NAME];
|
|
922
|
+
return !!method && fails(function () {
|
|
923
|
+
// eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
|
|
924
|
+
method.call(null, argument || function () { throw 1; }, 1);
|
|
925
|
+
});
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
var un$Join = functionUncurryThis([].join);
|
|
929
|
+
|
|
930
|
+
var ES3_STRINGS = indexedObject != Object;
|
|
931
|
+
var STRICT_METHOD = arrayMethodIsStrict('join', ',');
|
|
932
|
+
|
|
933
|
+
// `Array.prototype.join` method
|
|
934
|
+
// https://tc39.es/ecma262/#sec-array.prototype.join
|
|
935
|
+
_export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
|
|
936
|
+
join: function join(separator) {
|
|
937
|
+
return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
|
|
938
|
+
}
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
var bind$2 = functionUncurryThis(functionUncurryThis.bind);
|
|
942
|
+
|
|
943
|
+
// optional / simple context binding
|
|
944
|
+
var functionBindContext = function (fn, that) {
|
|
945
|
+
aCallable(fn);
|
|
946
|
+
return that === undefined ? fn : bind$2 ? bind$2(fn, that) : function (/* ...args */) {
|
|
947
|
+
return fn.apply(that, arguments);
|
|
948
|
+
};
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
// `IsArray` abstract operation
|
|
952
|
+
// https://tc39.es/ecma262/#sec-isarray
|
|
953
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
954
|
+
var isArray = Array.isArray || function isArray(argument) {
|
|
955
|
+
return classofRaw(argument) == 'Array';
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
|
|
959
|
+
var test = {};
|
|
960
|
+
|
|
961
|
+
test[TO_STRING_TAG$3] = 'z';
|
|
962
|
+
|
|
963
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
964
|
+
|
|
965
|
+
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
966
|
+
var Object$2 = global$1.Object;
|
|
967
|
+
|
|
968
|
+
// ES3 wrong here
|
|
969
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
970
|
+
|
|
971
|
+
// fallback for IE11 Script Access Denied error
|
|
972
|
+
var tryGet = function (it, key) {
|
|
973
|
+
try {
|
|
974
|
+
return it[key];
|
|
975
|
+
} catch (error) { /* empty */ }
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
979
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
980
|
+
var O, tag, result;
|
|
981
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
982
|
+
// @@toStringTag case
|
|
983
|
+
: typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG$2)) == 'string' ? tag
|
|
984
|
+
// builtinTag case
|
|
985
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
986
|
+
// ES3 arguments fallback
|
|
987
|
+
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
988
|
+
};
|
|
989
|
+
|
|
990
|
+
var noop = function () { /* empty */ };
|
|
991
|
+
var empty = [];
|
|
992
|
+
var construct = getBuiltIn('Reflect', 'construct');
|
|
993
|
+
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
994
|
+
var exec = functionUncurryThis(constructorRegExp.exec);
|
|
995
|
+
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
996
|
+
|
|
997
|
+
var isConstructorModern = function (argument) {
|
|
998
|
+
if (!isCallable(argument)) return false;
|
|
999
|
+
try {
|
|
1000
|
+
construct(noop, empty, argument);
|
|
1001
|
+
return true;
|
|
1002
|
+
} catch (error) {
|
|
1003
|
+
return false;
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
|
|
1007
|
+
var isConstructorLegacy = function (argument) {
|
|
1008
|
+
if (!isCallable(argument)) return false;
|
|
1009
|
+
switch (classof(argument)) {
|
|
1010
|
+
case 'AsyncFunction':
|
|
1011
|
+
case 'GeneratorFunction':
|
|
1012
|
+
case 'AsyncGeneratorFunction': return false;
|
|
1013
|
+
// we can't check .prototype since constructors produced by .bind haven't it
|
|
1014
|
+
} return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
1015
|
+
};
|
|
1016
|
+
|
|
1017
|
+
// `IsConstructor` abstract operation
|
|
1018
|
+
// https://tc39.es/ecma262/#sec-isconstructor
|
|
1019
|
+
var isConstructor = !construct || fails(function () {
|
|
1020
|
+
var called;
|
|
1021
|
+
return isConstructorModern(isConstructorModern.call)
|
|
1022
|
+
|| !isConstructorModern(Object)
|
|
1023
|
+
|| !isConstructorModern(function () { called = true; })
|
|
1024
|
+
|| called;
|
|
1025
|
+
}) ? isConstructorLegacy : isConstructorModern;
|
|
1026
|
+
|
|
1027
|
+
var SPECIES$6 = wellKnownSymbol('species');
|
|
1028
|
+
var Array$3 = global$1.Array;
|
|
1029
|
+
|
|
1030
|
+
// a part of `ArraySpeciesCreate` abstract operation
|
|
1031
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
1032
|
+
var arraySpeciesConstructor = function (originalArray) {
|
|
1033
|
+
var C;
|
|
1034
|
+
if (isArray(originalArray)) {
|
|
1035
|
+
C = originalArray.constructor;
|
|
1036
|
+
// cross-realm fallback
|
|
1037
|
+
if (isConstructor(C) && (C === Array$3 || isArray(C.prototype))) C = undefined;
|
|
1038
|
+
else if (isObject(C)) {
|
|
1039
|
+
C = C[SPECIES$6];
|
|
1040
|
+
if (C === null) C = undefined;
|
|
1041
|
+
}
|
|
1042
|
+
} return C === undefined ? Array$3 : C;
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
// `ArraySpeciesCreate` abstract operation
|
|
1046
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
1047
|
+
var arraySpeciesCreate = function (originalArray, length) {
|
|
1048
|
+
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
|
1049
|
+
};
|
|
1050
|
+
|
|
1051
|
+
var push$1 = functionUncurryThis([].push);
|
|
1052
|
+
|
|
1053
|
+
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
|
|
1054
|
+
var createMethod$2 = function (TYPE) {
|
|
1055
|
+
var IS_MAP = TYPE == 1;
|
|
1056
|
+
var IS_FILTER = TYPE == 2;
|
|
1057
|
+
var IS_SOME = TYPE == 3;
|
|
1058
|
+
var IS_EVERY = TYPE == 4;
|
|
1059
|
+
var IS_FIND_INDEX = TYPE == 6;
|
|
1060
|
+
var IS_FILTER_REJECT = TYPE == 7;
|
|
1061
|
+
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
|
1062
|
+
return function ($this, callbackfn, that, specificCreate) {
|
|
1063
|
+
var O = toObject($this);
|
|
1064
|
+
var self = indexedObject(O);
|
|
1065
|
+
var boundFunction = functionBindContext(callbackfn, that);
|
|
1066
|
+
var length = lengthOfArrayLike(self);
|
|
1067
|
+
var index = 0;
|
|
1068
|
+
var create = specificCreate || arraySpeciesCreate;
|
|
1069
|
+
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
|
1070
|
+
var value, result;
|
|
1071
|
+
for (;length > index; index++) if (NO_HOLES || index in self) {
|
|
1072
|
+
value = self[index];
|
|
1073
|
+
result = boundFunction(value, index, O);
|
|
1074
|
+
if (TYPE) {
|
|
1075
|
+
if (IS_MAP) target[index] = result; // map
|
|
1076
|
+
else if (result) switch (TYPE) {
|
|
1077
|
+
case 3: return true; // some
|
|
1078
|
+
case 5: return value; // find
|
|
1079
|
+
case 6: return index; // findIndex
|
|
1080
|
+
case 2: push$1(target, value); // filter
|
|
1081
|
+
} else switch (TYPE) {
|
|
1082
|
+
case 4: return false; // every
|
|
1083
|
+
case 7: push$1(target, value); // filterReject
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
|
1088
|
+
};
|
|
1089
|
+
};
|
|
1090
|
+
|
|
1091
|
+
var arrayIteration = {
|
|
1092
|
+
// `Array.prototype.forEach` method
|
|
1093
|
+
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
1094
|
+
forEach: createMethod$2(0),
|
|
1095
|
+
// `Array.prototype.map` method
|
|
1096
|
+
// https://tc39.es/ecma262/#sec-array.prototype.map
|
|
1097
|
+
map: createMethod$2(1),
|
|
1098
|
+
// `Array.prototype.filter` method
|
|
1099
|
+
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
1100
|
+
filter: createMethod$2(2),
|
|
1101
|
+
// `Array.prototype.some` method
|
|
1102
|
+
// https://tc39.es/ecma262/#sec-array.prototype.some
|
|
1103
|
+
some: createMethod$2(3),
|
|
1104
|
+
// `Array.prototype.every` method
|
|
1105
|
+
// https://tc39.es/ecma262/#sec-array.prototype.every
|
|
1106
|
+
every: createMethod$2(4),
|
|
1107
|
+
// `Array.prototype.find` method
|
|
1108
|
+
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
1109
|
+
find: createMethod$2(5),
|
|
1110
|
+
// `Array.prototype.findIndex` method
|
|
1111
|
+
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
|
|
1112
|
+
findIndex: createMethod$2(6),
|
|
1113
|
+
// `Array.prototype.filterReject` method
|
|
1114
|
+
// https://github.com/tc39/proposal-array-filtering
|
|
1115
|
+
filterReject: createMethod$2(7)
|
|
1116
|
+
};
|
|
1117
|
+
|
|
1118
|
+
var SPECIES$5 = wellKnownSymbol('species');
|
|
1119
|
+
|
|
1120
|
+
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
|
1121
|
+
// We can't use this feature detection in V8 since it causes
|
|
1122
|
+
// deoptimization and serious performance degradation
|
|
1123
|
+
// https://github.com/zloirock/core-js/issues/677
|
|
1124
|
+
return engineV8Version >= 51 || !fails(function () {
|
|
1125
|
+
var array = [];
|
|
1126
|
+
var constructor = array.constructor = {};
|
|
1127
|
+
constructor[SPECIES$5] = function () {
|
|
1128
|
+
return { foo: 1 };
|
|
1129
|
+
};
|
|
1130
|
+
return array[METHOD_NAME](Boolean).foo !== 1;
|
|
1131
|
+
});
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
var $filter = arrayIteration.filter;
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('filter');
|
|
1138
|
+
|
|
1139
|
+
// `Array.prototype.filter` method
|
|
1140
|
+
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
1141
|
+
// with adding support of @@species
|
|
1142
|
+
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
|
|
1143
|
+
filter: function filter(callbackfn /* , thisArg */) {
|
|
1144
|
+
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
|
|
1148
|
+
// `Object.prototype.toString` method implementation
|
|
1149
|
+
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1150
|
+
var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
|
1151
|
+
return '[object ' + classof(this) + ']';
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
// `Object.prototype.toString` method
|
|
1155
|
+
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1156
|
+
if (!toStringTagSupport) {
|
|
1157
|
+
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
var String$3 = global$1.String;
|
|
1161
|
+
|
|
1162
|
+
var toString = function (argument) {
|
|
1163
|
+
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
1164
|
+
return String$3(argument);
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
// `RegExp.prototype.flags` getter implementation
|
|
1168
|
+
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
1169
|
+
var regexpFlags = function () {
|
|
1170
|
+
var that = anObject(this);
|
|
1171
|
+
var result = '';
|
|
1172
|
+
if (that.global) result += 'g';
|
|
1173
|
+
if (that.ignoreCase) result += 'i';
|
|
1174
|
+
if (that.multiline) result += 'm';
|
|
1175
|
+
if (that.dotAll) result += 's';
|
|
1176
|
+
if (that.unicode) result += 'u';
|
|
1177
|
+
if (that.sticky) result += 'y';
|
|
1178
|
+
return result;
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
1182
|
+
var $RegExp$2 = global$1.RegExp;
|
|
1183
|
+
|
|
1184
|
+
var UNSUPPORTED_Y$1 = fails(function () {
|
|
1185
|
+
var re = $RegExp$2('a', 'y');
|
|
1186
|
+
re.lastIndex = 2;
|
|
1187
|
+
return re.exec('abcd') != null;
|
|
1188
|
+
});
|
|
1189
|
+
|
|
1190
|
+
// UC Browser bug
|
|
1191
|
+
// https://github.com/zloirock/core-js/issues/1008
|
|
1192
|
+
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails(function () {
|
|
1193
|
+
return !$RegExp$2('a', 'y').sticky;
|
|
1194
|
+
});
|
|
1195
|
+
|
|
1196
|
+
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails(function () {
|
|
1197
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
1198
|
+
var re = $RegExp$2('^r', 'gy');
|
|
1199
|
+
re.lastIndex = 2;
|
|
1200
|
+
return re.exec('str') != null;
|
|
1201
|
+
});
|
|
1202
|
+
|
|
1203
|
+
var regexpStickyHelpers = {
|
|
1204
|
+
BROKEN_CARET: BROKEN_CARET,
|
|
1205
|
+
MISSED_STICKY: MISSED_STICKY,
|
|
1206
|
+
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
// `Object.keys` method
|
|
1210
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
1211
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
1212
|
+
var objectKeys = Object.keys || function keys(O) {
|
|
1213
|
+
return objectKeysInternal(O, enumBugKeys);
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
// `Object.defineProperties` method
|
|
1217
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1218
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1219
|
+
var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1220
|
+
anObject(O);
|
|
1221
|
+
var props = toIndexedObject(Properties);
|
|
1222
|
+
var keys = objectKeys(Properties);
|
|
1223
|
+
var length = keys.length;
|
|
1224
|
+
var index = 0;
|
|
1225
|
+
var key;
|
|
1226
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
1227
|
+
return O;
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
var html = getBuiltIn('document', 'documentElement');
|
|
1231
|
+
|
|
1232
|
+
/* global ActiveXObject -- old IE, WSH */
|
|
1233
|
+
|
|
1234
|
+
var GT = '>';
|
|
1235
|
+
var LT = '<';
|
|
1236
|
+
var PROTOTYPE = 'prototype';
|
|
1237
|
+
var SCRIPT = 'script';
|
|
1238
|
+
var IE_PROTO$1 = sharedKey('IE_PROTO');
|
|
1239
|
+
|
|
1240
|
+
var EmptyConstructor = function () { /* empty */ };
|
|
1241
|
+
|
|
1242
|
+
var scriptTag = function (content) {
|
|
1243
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
1247
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
1248
|
+
activeXDocument.write(scriptTag(''));
|
|
1249
|
+
activeXDocument.close();
|
|
1250
|
+
var temp = activeXDocument.parentWindow.Object;
|
|
1251
|
+
activeXDocument = null; // avoid memory leak
|
|
1252
|
+
return temp;
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
1256
|
+
var NullProtoObjectViaIFrame = function () {
|
|
1257
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
1258
|
+
var iframe = documentCreateElement('iframe');
|
|
1259
|
+
var JS = 'java' + SCRIPT + ':';
|
|
1260
|
+
var iframeDocument;
|
|
1261
|
+
iframe.style.display = 'none';
|
|
1262
|
+
html.appendChild(iframe);
|
|
1263
|
+
// https://github.com/zloirock/core-js/issues/475
|
|
1264
|
+
iframe.src = String(JS);
|
|
1265
|
+
iframeDocument = iframe.contentWindow.document;
|
|
1266
|
+
iframeDocument.open();
|
|
1267
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
|
1268
|
+
iframeDocument.close();
|
|
1269
|
+
return iframeDocument.F;
|
|
1270
|
+
};
|
|
1271
|
+
|
|
1272
|
+
// Check for document.domain and active x support
|
|
1273
|
+
// No need to use active x approach when document.domain is not set
|
|
1274
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
|
1275
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
1276
|
+
// avoid IE GC bug
|
|
1277
|
+
var activeXDocument;
|
|
1278
|
+
var NullProtoObject = function () {
|
|
1279
|
+
try {
|
|
1280
|
+
activeXDocument = new ActiveXObject('htmlfile');
|
|
1281
|
+
} catch (error) { /* ignore */ }
|
|
1282
|
+
NullProtoObject = typeof document != 'undefined'
|
|
1283
|
+
? document.domain && activeXDocument
|
|
1284
|
+
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
1285
|
+
: NullProtoObjectViaIFrame()
|
|
1286
|
+
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
1287
|
+
var length = enumBugKeys.length;
|
|
1288
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
1289
|
+
return NullProtoObject();
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
hiddenKeys$1[IE_PROTO$1] = true;
|
|
1293
|
+
|
|
1294
|
+
// `Object.create` method
|
|
1295
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
1296
|
+
var objectCreate = Object.create || function create(O, Properties) {
|
|
1297
|
+
var result;
|
|
1298
|
+
if (O !== null) {
|
|
1299
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
|
1300
|
+
result = new EmptyConstructor();
|
|
1301
|
+
EmptyConstructor[PROTOTYPE] = null;
|
|
1302
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1303
|
+
result[IE_PROTO$1] = O;
|
|
1304
|
+
} else result = NullProtoObject();
|
|
1305
|
+
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
1309
|
+
var $RegExp$1 = global$1.RegExp;
|
|
1310
|
+
|
|
1311
|
+
var regexpUnsupportedDotAll = fails(function () {
|
|
1312
|
+
var re = $RegExp$1('.', 's');
|
|
1313
|
+
return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
|
1314
|
+
});
|
|
1315
|
+
|
|
1316
|
+
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
1317
|
+
var $RegExp = global$1.RegExp;
|
|
1318
|
+
|
|
1319
|
+
var regexpUnsupportedNcg = fails(function () {
|
|
1320
|
+
var re = $RegExp('(?<a>b)', 'g');
|
|
1321
|
+
return re.exec('b').groups.a !== 'b' ||
|
|
1322
|
+
'b'.replace(re, '$<a>c') !== 'bc';
|
|
1323
|
+
});
|
|
1324
|
+
|
|
1325
|
+
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
1326
|
+
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
|
|
1330
|
+
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
var getInternalState$3 = internalState.get;
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
1339
|
+
var nativeExec = RegExp.prototype.exec;
|
|
1340
|
+
var patchedExec = nativeExec;
|
|
1341
|
+
var charAt$4 = functionUncurryThis(''.charAt);
|
|
1342
|
+
var indexOf = functionUncurryThis(''.indexOf);
|
|
1343
|
+
var replace$2 = functionUncurryThis(''.replace);
|
|
1344
|
+
var stringSlice$3 = functionUncurryThis(''.slice);
|
|
1345
|
+
|
|
1346
|
+
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
1347
|
+
var re1 = /a/;
|
|
1348
|
+
var re2 = /b*/g;
|
|
1349
|
+
functionCall(nativeExec, re1, 'a');
|
|
1350
|
+
functionCall(nativeExec, re2, 'a');
|
|
1351
|
+
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
1352
|
+
})();
|
|
1353
|
+
|
|
1354
|
+
var UNSUPPORTED_Y = regexpStickyHelpers.BROKEN_CARET;
|
|
1355
|
+
|
|
1356
|
+
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
1357
|
+
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
1358
|
+
|
|
1359
|
+
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || regexpUnsupportedDotAll || regexpUnsupportedNcg;
|
|
1360
|
+
|
|
1361
|
+
if (PATCH) {
|
|
1362
|
+
patchedExec = function exec(string) {
|
|
1363
|
+
var re = this;
|
|
1364
|
+
var state = getInternalState$3(re);
|
|
1365
|
+
var str = toString(string);
|
|
1366
|
+
var raw = state.raw;
|
|
1367
|
+
var result, reCopy, lastIndex, match, i, object, group;
|
|
1368
|
+
|
|
1369
|
+
if (raw) {
|
|
1370
|
+
raw.lastIndex = re.lastIndex;
|
|
1371
|
+
result = functionCall(patchedExec, raw, str);
|
|
1372
|
+
re.lastIndex = raw.lastIndex;
|
|
1373
|
+
return result;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
var groups = state.groups;
|
|
1377
|
+
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
1378
|
+
var flags = functionCall(regexpFlags, re);
|
|
1379
|
+
var source = re.source;
|
|
1380
|
+
var charsAdded = 0;
|
|
1381
|
+
var strCopy = str;
|
|
1382
|
+
|
|
1383
|
+
if (sticky) {
|
|
1384
|
+
flags = replace$2(flags, 'y', '');
|
|
1385
|
+
if (indexOf(flags, 'g') === -1) {
|
|
1386
|
+
flags += 'g';
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
strCopy = stringSlice$3(str, re.lastIndex);
|
|
1390
|
+
// Support anchored sticky behavior.
|
|
1391
|
+
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$4(str, re.lastIndex - 1) !== '\n')) {
|
|
1392
|
+
source = '(?: ' + source + ')';
|
|
1393
|
+
strCopy = ' ' + strCopy;
|
|
1394
|
+
charsAdded++;
|
|
1395
|
+
}
|
|
1396
|
+
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
1397
|
+
// simulate the 'y' flag.
|
|
1398
|
+
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
if (NPCG_INCLUDED) {
|
|
1402
|
+
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
1403
|
+
}
|
|
1404
|
+
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
1405
|
+
|
|
1406
|
+
match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
|
|
1407
|
+
|
|
1408
|
+
if (sticky) {
|
|
1409
|
+
if (match) {
|
|
1410
|
+
match.input = stringSlice$3(match.input, charsAdded);
|
|
1411
|
+
match[0] = stringSlice$3(match[0], charsAdded);
|
|
1412
|
+
match.index = re.lastIndex;
|
|
1413
|
+
re.lastIndex += match[0].length;
|
|
1414
|
+
} else re.lastIndex = 0;
|
|
1415
|
+
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
1416
|
+
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
1417
|
+
}
|
|
1418
|
+
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
1419
|
+
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
1420
|
+
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
|
1421
|
+
functionCall(nativeReplace, match[0], reCopy, function () {
|
|
1422
|
+
for (i = 1; i < arguments.length - 2; i++) {
|
|
1423
|
+
if (arguments[i] === undefined) match[i] = undefined;
|
|
1424
|
+
}
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
if (match && groups) {
|
|
1429
|
+
match.groups = object = objectCreate(null);
|
|
1430
|
+
for (i = 0; i < groups.length; i++) {
|
|
1431
|
+
group = groups[i];
|
|
1432
|
+
object[group[0]] = match[group[1]];
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
return match;
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
var regexpExec = patchedExec;
|
|
1441
|
+
|
|
1442
|
+
// `RegExp.prototype.exec` method
|
|
1443
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
1444
|
+
_export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
|
|
1445
|
+
exec: regexpExec
|
|
1446
|
+
});
|
|
1447
|
+
|
|
1448
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
1449
|
+
var apply = FunctionPrototype$1.apply;
|
|
1450
|
+
var bind$1 = FunctionPrototype$1.bind;
|
|
1451
|
+
var call = FunctionPrototype$1.call;
|
|
1452
|
+
|
|
1453
|
+
// eslint-disable-next-line es/no-reflect -- safe
|
|
1454
|
+
var functionApply = typeof Reflect == 'object' && Reflect.apply || (bind$1 ? call.bind(apply) : function () {
|
|
1455
|
+
return call.apply(apply, arguments);
|
|
1456
|
+
});
|
|
1457
|
+
|
|
1458
|
+
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
|
|
1467
|
+
var SPECIES$4 = wellKnownSymbol('species');
|
|
1468
|
+
var RegExpPrototype$1 = RegExp.prototype;
|
|
1469
|
+
|
|
1470
|
+
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
1471
|
+
var SYMBOL = wellKnownSymbol(KEY);
|
|
1472
|
+
|
|
1473
|
+
var DELEGATES_TO_SYMBOL = !fails(function () {
|
|
1474
|
+
// String methods call symbol-named RegEp methods
|
|
1475
|
+
var O = {};
|
|
1476
|
+
O[SYMBOL] = function () { return 7; };
|
|
1477
|
+
return ''[KEY](O) != 7;
|
|
1478
|
+
});
|
|
1479
|
+
|
|
1480
|
+
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
|
1481
|
+
// Symbol-named RegExp methods call .exec
|
|
1482
|
+
var execCalled = false;
|
|
1483
|
+
var re = /a/;
|
|
1484
|
+
|
|
1485
|
+
if (KEY === 'split') {
|
|
1486
|
+
// We can't use real regex here since it causes deoptimization
|
|
1487
|
+
// and serious performance degradation in V8
|
|
1488
|
+
// https://github.com/zloirock/core-js/issues/306
|
|
1489
|
+
re = {};
|
|
1490
|
+
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
|
1491
|
+
// a new one. We need to return the patched regex when creating the new one.
|
|
1492
|
+
re.constructor = {};
|
|
1493
|
+
re.constructor[SPECIES$4] = function () { return re; };
|
|
1494
|
+
re.flags = '';
|
|
1495
|
+
re[SYMBOL] = /./[SYMBOL];
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
re.exec = function () { execCalled = true; return null; };
|
|
1499
|
+
|
|
1500
|
+
re[SYMBOL]('');
|
|
1501
|
+
return !execCalled;
|
|
1502
|
+
});
|
|
1503
|
+
|
|
1504
|
+
if (
|
|
1505
|
+
!DELEGATES_TO_SYMBOL ||
|
|
1506
|
+
!DELEGATES_TO_EXEC ||
|
|
1507
|
+
FORCED
|
|
1508
|
+
) {
|
|
1509
|
+
var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]);
|
|
1510
|
+
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
1511
|
+
var uncurriedNativeMethod = functionUncurryThis(nativeMethod);
|
|
1512
|
+
var $exec = regexp.exec;
|
|
1513
|
+
if ($exec === regexpExec || $exec === RegExpPrototype$1.exec) {
|
|
1514
|
+
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
1515
|
+
// The native String method already delegates to @@method (this
|
|
1516
|
+
// polyfilled function), leasing to infinite recursion.
|
|
1517
|
+
// We avoid it by directly calling the native @@method method.
|
|
1518
|
+
return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
|
|
1519
|
+
}
|
|
1520
|
+
return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
|
|
1521
|
+
}
|
|
1522
|
+
return { done: false };
|
|
1523
|
+
});
|
|
1524
|
+
|
|
1525
|
+
redefine(String.prototype, KEY, methods[0]);
|
|
1526
|
+
redefine(RegExpPrototype$1, SYMBOL, methods[1]);
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
if (SHAM) createNonEnumerableProperty(RegExpPrototype$1[SYMBOL], 'sham', true);
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
var charAt$3 = functionUncurryThis(''.charAt);
|
|
1533
|
+
var charCodeAt = functionUncurryThis(''.charCodeAt);
|
|
1534
|
+
var stringSlice$2 = functionUncurryThis(''.slice);
|
|
1535
|
+
|
|
1536
|
+
var createMethod$1 = function (CONVERT_TO_STRING) {
|
|
1537
|
+
return function ($this, pos) {
|
|
1538
|
+
var S = toString(requireObjectCoercible($this));
|
|
1539
|
+
var position = toIntegerOrInfinity(pos);
|
|
1540
|
+
var size = S.length;
|
|
1541
|
+
var first, second;
|
|
1542
|
+
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
1543
|
+
first = charCodeAt(S, position);
|
|
1544
|
+
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
|
1545
|
+
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
|
1546
|
+
? CONVERT_TO_STRING
|
|
1547
|
+
? charAt$3(S, position)
|
|
1548
|
+
: first
|
|
1549
|
+
: CONVERT_TO_STRING
|
|
1550
|
+
? stringSlice$2(S, position, position + 2)
|
|
1551
|
+
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
1552
|
+
};
|
|
1553
|
+
};
|
|
1554
|
+
|
|
1555
|
+
var stringMultibyte = {
|
|
1556
|
+
// `String.prototype.codePointAt` method
|
|
1557
|
+
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
1558
|
+
codeAt: createMethod$1(false),
|
|
1559
|
+
// `String.prototype.at` method
|
|
1560
|
+
// https://github.com/mathiasbynens/String.prototype.at
|
|
1561
|
+
charAt: createMethod$1(true)
|
|
1562
|
+
};
|
|
1563
|
+
|
|
1564
|
+
var charAt$2 = stringMultibyte.charAt;
|
|
1565
|
+
|
|
1566
|
+
// `AdvanceStringIndex` abstract operation
|
|
1567
|
+
// https://tc39.es/ecma262/#sec-advancestringindex
|
|
1568
|
+
var advanceStringIndex = function (S, index, unicode) {
|
|
1569
|
+
return index + (unicode ? charAt$2(S, index).length : 1);
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1572
|
+
var floor = Math.floor;
|
|
1573
|
+
var charAt$1 = functionUncurryThis(''.charAt);
|
|
1574
|
+
var replace$1 = functionUncurryThis(''.replace);
|
|
1575
|
+
var stringSlice$1 = functionUncurryThis(''.slice);
|
|
1576
|
+
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
1577
|
+
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
1578
|
+
|
|
1579
|
+
// `GetSubstitution` abstract operation
|
|
1580
|
+
// https://tc39.es/ecma262/#sec-getsubstitution
|
|
1581
|
+
var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
|
|
1582
|
+
var tailPos = position + matched.length;
|
|
1583
|
+
var m = captures.length;
|
|
1584
|
+
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
1585
|
+
if (namedCaptures !== undefined) {
|
|
1586
|
+
namedCaptures = toObject(namedCaptures);
|
|
1587
|
+
symbols = SUBSTITUTION_SYMBOLS;
|
|
1588
|
+
}
|
|
1589
|
+
return replace$1(replacement, symbols, function (match, ch) {
|
|
1590
|
+
var capture;
|
|
1591
|
+
switch (charAt$1(ch, 0)) {
|
|
1592
|
+
case '$': return '$';
|
|
1593
|
+
case '&': return matched;
|
|
1594
|
+
case '`': return stringSlice$1(str, 0, position);
|
|
1595
|
+
case "'": return stringSlice$1(str, tailPos);
|
|
1596
|
+
case '<':
|
|
1597
|
+
capture = namedCaptures[stringSlice$1(ch, 1, -1)];
|
|
1598
|
+
break;
|
|
1599
|
+
default: // \d\d?
|
|
1600
|
+
var n = +ch;
|
|
1601
|
+
if (n === 0) return match;
|
|
1602
|
+
if (n > m) {
|
|
1603
|
+
var f = floor(n / 10);
|
|
1604
|
+
if (f === 0) return match;
|
|
1605
|
+
if (f <= m) return captures[f - 1] === undefined ? charAt$1(ch, 1) : captures[f - 1] + charAt$1(ch, 1);
|
|
1606
|
+
return match;
|
|
1607
|
+
}
|
|
1608
|
+
capture = captures[n - 1];
|
|
1609
|
+
}
|
|
1610
|
+
return capture === undefined ? '' : capture;
|
|
1611
|
+
});
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1614
|
+
var TypeError$7 = global$1.TypeError;
|
|
1615
|
+
|
|
1616
|
+
// `RegExpExec` abstract operation
|
|
1617
|
+
// https://tc39.es/ecma262/#sec-regexpexec
|
|
1618
|
+
var regexpExecAbstract = function (R, S) {
|
|
1619
|
+
var exec = R.exec;
|
|
1620
|
+
if (isCallable(exec)) {
|
|
1621
|
+
var result = functionCall(exec, R, S);
|
|
1622
|
+
if (result !== null) anObject(result);
|
|
1623
|
+
return result;
|
|
1624
|
+
}
|
|
1625
|
+
if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
|
|
1626
|
+
throw TypeError$7('RegExp#exec called on incompatible receiver');
|
|
1627
|
+
};
|
|
1628
|
+
|
|
1629
|
+
var REPLACE = wellKnownSymbol('replace');
|
|
1630
|
+
var max$2 = Math.max;
|
|
1631
|
+
var min = Math.min;
|
|
1632
|
+
var concat = functionUncurryThis([].concat);
|
|
1633
|
+
var push = functionUncurryThis([].push);
|
|
1634
|
+
var stringIndexOf = functionUncurryThis(''.indexOf);
|
|
1635
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
1636
|
+
|
|
1637
|
+
var maybeToString = function (it) {
|
|
1638
|
+
return it === undefined ? it : String(it);
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1641
|
+
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
|
1642
|
+
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
|
1643
|
+
var REPLACE_KEEPS_$0 = (function () {
|
|
1644
|
+
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
|
|
1645
|
+
return 'a'.replace(/./, '$0') === '$0';
|
|
1646
|
+
})();
|
|
1647
|
+
|
|
1648
|
+
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
|
1649
|
+
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
1650
|
+
if (/./[REPLACE]) {
|
|
1651
|
+
return /./[REPLACE]('a', '$0') === '';
|
|
1652
|
+
}
|
|
1653
|
+
return false;
|
|
1654
|
+
})();
|
|
1655
|
+
|
|
1656
|
+
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
|
1657
|
+
var re = /./;
|
|
1658
|
+
re.exec = function () {
|
|
1659
|
+
var result = [];
|
|
1660
|
+
result.groups = { a: '7' };
|
|
1661
|
+
return result;
|
|
1662
|
+
};
|
|
1663
|
+
// eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
|
|
1664
|
+
return ''.replace(re, '$<a>') !== '7';
|
|
1665
|
+
});
|
|
1666
|
+
|
|
1667
|
+
// @@replace logic
|
|
1668
|
+
fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
|
|
1669
|
+
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
|
1670
|
+
|
|
1671
|
+
return [
|
|
1672
|
+
// `String.prototype.replace` method
|
|
1673
|
+
// https://tc39.es/ecma262/#sec-string.prototype.replace
|
|
1674
|
+
function replace(searchValue, replaceValue) {
|
|
1675
|
+
var O = requireObjectCoercible(this);
|
|
1676
|
+
var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
|
|
1677
|
+
return replacer
|
|
1678
|
+
? functionCall(replacer, searchValue, O, replaceValue)
|
|
1679
|
+
: functionCall(nativeReplace, toString(O), searchValue, replaceValue);
|
|
1680
|
+
},
|
|
1681
|
+
// `RegExp.prototype[@@replace]` method
|
|
1682
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
|
|
1683
|
+
function (string, replaceValue) {
|
|
1684
|
+
var rx = anObject(this);
|
|
1685
|
+
var S = toString(string);
|
|
1686
|
+
|
|
1687
|
+
if (
|
|
1688
|
+
typeof replaceValue == 'string' &&
|
|
1689
|
+
stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
|
|
1690
|
+
stringIndexOf(replaceValue, '$<') === -1
|
|
1691
|
+
) {
|
|
1692
|
+
var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
|
|
1693
|
+
if (res.done) return res.value;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
var functionalReplace = isCallable(replaceValue);
|
|
1697
|
+
if (!functionalReplace) replaceValue = toString(replaceValue);
|
|
1698
|
+
|
|
1699
|
+
var global = rx.global;
|
|
1700
|
+
if (global) {
|
|
1701
|
+
var fullUnicode = rx.unicode;
|
|
1702
|
+
rx.lastIndex = 0;
|
|
1703
|
+
}
|
|
1704
|
+
var results = [];
|
|
1705
|
+
while (true) {
|
|
1706
|
+
var result = regexpExecAbstract(rx, S);
|
|
1707
|
+
if (result === null) break;
|
|
1708
|
+
|
|
1709
|
+
push(results, result);
|
|
1710
|
+
if (!global) break;
|
|
1711
|
+
|
|
1712
|
+
var matchStr = toString(result[0]);
|
|
1713
|
+
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
var accumulatedResult = '';
|
|
1717
|
+
var nextSourcePosition = 0;
|
|
1718
|
+
for (var i = 0; i < results.length; i++) {
|
|
1719
|
+
result = results[i];
|
|
1720
|
+
|
|
1721
|
+
var matched = toString(result[0]);
|
|
1722
|
+
var position = max$2(min(toIntegerOrInfinity(result.index), S.length), 0);
|
|
1723
|
+
var captures = [];
|
|
1724
|
+
// NOTE: This is equivalent to
|
|
1725
|
+
// captures = result.slice(1).map(maybeToString)
|
|
1726
|
+
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
|
1727
|
+
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
|
1728
|
+
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
|
1729
|
+
for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
|
|
1730
|
+
var namedCaptures = result.groups;
|
|
1731
|
+
if (functionalReplace) {
|
|
1732
|
+
var replacerArgs = concat([matched], captures, position, S);
|
|
1733
|
+
if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
|
|
1734
|
+
var replacement = toString(functionApply(replaceValue, undefined, replacerArgs));
|
|
1735
|
+
} else {
|
|
1736
|
+
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
|
1737
|
+
}
|
|
1738
|
+
if (position >= nextSourcePosition) {
|
|
1739
|
+
accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
|
|
1740
|
+
nextSourcePosition = position + matched.length;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
return accumulatedResult + stringSlice(S, nextSourcePosition);
|
|
1744
|
+
}
|
|
1745
|
+
];
|
|
1746
|
+
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
1747
|
+
|
|
1748
|
+
// a string of all valid unicode whitespaces
|
|
1749
|
+
var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
1750
|
+
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
1751
|
+
|
|
1752
|
+
var replace = functionUncurryThis(''.replace);
|
|
1753
|
+
var whitespace = '[' + whitespaces + ']';
|
|
1754
|
+
var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
|
1755
|
+
var rtrim = RegExp(whitespace + whitespace + '*$');
|
|
1756
|
+
|
|
1757
|
+
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
1758
|
+
var createMethod = function (TYPE) {
|
|
1759
|
+
return function ($this) {
|
|
1760
|
+
var string = toString(requireObjectCoercible($this));
|
|
1761
|
+
if (TYPE & 1) string = replace(string, ltrim, '');
|
|
1762
|
+
if (TYPE & 2) string = replace(string, rtrim, '');
|
|
1763
|
+
return string;
|
|
1764
|
+
};
|
|
1765
|
+
};
|
|
1766
|
+
|
|
1767
|
+
var stringTrim = {
|
|
1768
|
+
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
1769
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
1770
|
+
start: createMethod(1),
|
|
1771
|
+
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
1772
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
1773
|
+
end: createMethod(2),
|
|
1774
|
+
// `String.prototype.trim` method
|
|
1775
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
1776
|
+
trim: createMethod(3)
|
|
1777
|
+
};
|
|
1778
|
+
|
|
1779
|
+
var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
|
|
1780
|
+
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
var non = '\u200B\u0085\u180E';
|
|
1784
|
+
|
|
1785
|
+
// check that a method works with the correct list
|
|
1786
|
+
// of whitespaces and has a correct name
|
|
1787
|
+
var stringTrimForced = function (METHOD_NAME) {
|
|
1788
|
+
return fails(function () {
|
|
1789
|
+
return !!whitespaces[METHOD_NAME]()
|
|
1790
|
+
|| non[METHOD_NAME]() !== non
|
|
1791
|
+
|| (PROPER_FUNCTION_NAME$2 && whitespaces[METHOD_NAME].name !== METHOD_NAME);
|
|
1792
|
+
});
|
|
1793
|
+
};
|
|
1794
|
+
|
|
1795
|
+
var $trim = stringTrim.trim;
|
|
1796
|
+
|
|
1797
|
+
|
|
1798
|
+
// `String.prototype.trim` method
|
|
1799
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
1800
|
+
_export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, {
|
|
1801
|
+
trim: function trim() {
|
|
1802
|
+
return $trim(this);
|
|
1803
|
+
}
|
|
1804
|
+
});
|
|
1805
|
+
|
|
1806
|
+
// `globalThis` object
|
|
1807
|
+
// https://tc39.es/ecma262/#sec-globalthis
|
|
1808
|
+
_export({ global: true }, {
|
|
1809
|
+
globalThis: global$1
|
|
1810
|
+
});
|
|
1811
|
+
|
|
1812
|
+
if (append) $.fn.append = append;
|
|
1813
|
+
if (on) $.fn.on = on;
|
|
1814
|
+
if (focus) $.fn.focus = focus;
|
|
1815
|
+
if (attr) $.fn.attr = attr;
|
|
1816
|
+
if (val) $.fn.val = val;
|
|
1817
|
+
if (html$1) $.fn.html = html$1;
|
|
1818
|
+
if (parent) $.fn.parent = parent;
|
|
1819
|
+
if (hasClass) $.fn.hasClass = hasClass;
|
|
1820
|
+
if (empty$1) $.fn.empty = empty$1;
|
|
1821
|
+
function getTagName($elem) {
|
|
1822
|
+
if ($elem.length) return $elem[0].tagName.toLowerCase();
|
|
1823
|
+
return '';
|
|
1824
|
+
}
|
|
1825
|
+
function genSizeStyledIframeHtml(iframeHtml, width, height) {
|
|
1826
|
+
if (width === void 0) {
|
|
1827
|
+
width = 'auto';
|
|
1828
|
+
}
|
|
1829
|
+
if (height === void 0) {
|
|
1830
|
+
height = 'auto';
|
|
1831
|
+
}
|
|
1832
|
+
var $iframe = $(iframeHtml);
|
|
1833
|
+
$iframe.attr('width', width);
|
|
1834
|
+
$iframe.attr('height', height);
|
|
1835
|
+
return $iframe[0].outerHTML;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
function normalizeVideoAlign(align) {
|
|
1839
|
+
var a = String(align || '').toLowerCase();
|
|
1840
|
+
if (a === 'center' || a === 'right') return a;
|
|
1841
|
+
return 'left';
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
var ICON_ENTER = '<svg viewBox="0 0 1255 1024"><path d="M1095.111111 731.477333h-625.777778V1024L0 658.318222 469.333333 292.408889v292.636444h625.777778V0h156.444445v731.477333z"></path></svg>';
|
|
1845
|
+
var ICON_CANCEL_ENTER = '<svg viewBox="0 0 1024 1024"><path d="M436 680H124v-56h312l-124-124 42-42 220 220-42-42 124-124z"></path><path d="M198 128l64-64 628 628-64 64z"></path></svg>';
|
|
1846
|
+
var ICON_SIZE = '<svg viewBox="0 0 1024 1024"><path d="M128 128h320v64H192v256H128V128zm768 0v320h-64V192H576v-64h320zM128 896V576h64v256h256v64H128zm768 0H576v-64h256V576h64v320z"></path></svg>';
|
|
1847
|
+
var ICON_ALIGN_LEFT = '<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>';
|
|
1848
|
+
var ICON_ALIGN_CENTER = '<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>';
|
|
1849
|
+
var ICON_ALIGN_RIGHT = '<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>';
|
|
1850
|
+
var ICON_REMOVE = '<svg viewBox="0 0 1024 1024"><path d="M360 184h304v-40H360v40zM184 264h656v72H184V264zm72 120v456c0 22 18 40 40 40h432c22 0 40-18 40-40V384H256zm120 88h64v280h-64V472zm208 0h64v280h-64V472z"></path></svg>';
|
|
1851
|
+
var ICON_FULL = '<svg viewBox="0 0 1228 1024"><path d="M862.514337 563.200461H404.581995v121.753478a13.311987 13.311987 0 0 1-6.655993 11.468789 10.23999 10.23999 0 0 1-12.083188-1.433599l-204.799795-179.199821a13.721586 13.721586 0 0 1 0-20.479979l204.799795-179.302221a10.23999 10.23999 0 0 1 12.185588-1.535998 13.209587 13.209587 0 0 1 6.553593 11.673588v115.097485h457.932342V319.693504a11.571188 11.571188 0 0 1 18.841582-10.239989l204.799795 179.19982a13.721586 13.721586 0 0 1 0 20.47998l-204.799795 179.199821a10.23999 10.23999 0 0 1-12.185588 1.535998 13.311987 13.311987 0 0 1-6.655994-11.571188V563.200461zM136.499064 14.951409v993.893406a15.257585 15.257585 0 0 1 15.155185 15.052785H15.155185A15.155185 15.155185 0 0 1 0 1008.844815V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086294a15.155185 15.155185 0 0 1 15.257585 15.155185zM1228.798771 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785h-106.188693a15.155185 15.155185 0 0 1-15.155185-15.052785V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086293A15.155185 15.155185 0 0 1 1228.798771 15.053809z"></path></svg>';
|
|
1852
|
+
function isVideoFullWidthOn(videoElem) {
|
|
1853
|
+
var _a;
|
|
1854
|
+
return String(((_a = videoElem) === null || _a === void 0 ? void 0 : _a.width) || '') === '100%';
|
|
1855
|
+
}
|
|
1856
|
+
function makeBtn(action, title, iconSvg, opts) {
|
|
1857
|
+
if (opts === void 0) {
|
|
1858
|
+
opts = {};
|
|
1859
|
+
}
|
|
1860
|
+
var _a = opts.disabled,
|
|
1861
|
+
disabled = _a === void 0 ? false : _a,
|
|
1862
|
+
_b = opts.active,
|
|
1863
|
+
active = _b === void 0 ? false : _b;
|
|
1864
|
+
var cls = ['mdg-video-btn', disabled ? 'is-disabled' : '', active ? 'is-active' : ''].filter(Boolean).join(' ');
|
|
1865
|
+
return h('button', {
|
|
1866
|
+
attrs: __assign({
|
|
1867
|
+
type: 'button',
|
|
1868
|
+
class: cls,
|
|
1869
|
+
title: title,
|
|
1870
|
+
'data-video-action': action
|
|
1871
|
+
}, disabled ? {
|
|
1872
|
+
disabled: 'disabled'
|
|
1873
|
+
} : {}),
|
|
1874
|
+
props: {
|
|
1875
|
+
contentEditable: false,
|
|
1876
|
+
disabled: disabled
|
|
1877
|
+
},
|
|
1878
|
+
hook: {
|
|
1879
|
+
insert: function insert(vnode) {
|
|
1880
|
+
var el = vnode.elm;
|
|
1881
|
+
if (el) el.innerHTML = iconSvg;
|
|
1882
|
+
},
|
|
1883
|
+
postpatch: function postpatch(_o, vnode) {
|
|
1884
|
+
var el = vnode.elm;
|
|
1885
|
+
if (el && el.innerHTML !== iconSvg) el.innerHTML = iconSvg;
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
function ensureSelectionOnVideo(editor, videoElem) {
|
|
1891
|
+
try {
|
|
1892
|
+
var path = resolveElemPath(editor, videoElem);
|
|
1893
|
+
if (!(path === null || path === void 0 ? void 0 : path.length)) return false;
|
|
1894
|
+
editor.select({
|
|
1895
|
+
anchor: {
|
|
1896
|
+
path: path,
|
|
1897
|
+
offset: 0
|
|
1898
|
+
},
|
|
1899
|
+
focus: {
|
|
1900
|
+
path: path,
|
|
1901
|
+
offset: 0
|
|
1902
|
+
}
|
|
1903
|
+
});
|
|
1904
|
+
return true;
|
|
1905
|
+
} catch (_) {
|
|
1906
|
+
return false;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
function handleVideoToolbarAction(editor, videoElem, action) {
|
|
1910
|
+
var _a, _b;
|
|
1911
|
+
if (!editor || editor.isDestroyed || editor.isDisabled()) return;
|
|
1912
|
+
var path = resolveElemPath(editor, videoElem);
|
|
1913
|
+
if (!(path === null || path === void 0 ? void 0 : path.length)) return;
|
|
1914
|
+
if (action === 'enter') {
|
|
1915
|
+
insertEmptyLineAboveAtPath(editor, path);
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1918
|
+
if (action === 'cancel-enter') {
|
|
1919
|
+
removeEmptyLineAboveTopLevelBlock(editor, path);
|
|
1920
|
+
return;
|
|
1921
|
+
}
|
|
1922
|
+
if (action === 'align-left' || action === 'align-center' || action === 'align-right') {
|
|
1923
|
+
if (!ensureSelectionOnVideo(editor, videoElem)) return;
|
|
1924
|
+
var align = action.replace('align-', '');
|
|
1925
|
+
Transforms.setNodes(editor, {
|
|
1926
|
+
align: normalizeVideoAlign(align)
|
|
1927
|
+
}, {
|
|
1928
|
+
at: path
|
|
1929
|
+
});
|
|
1930
|
+
return;
|
|
1931
|
+
}
|
|
1932
|
+
if (action === 'full-width') {
|
|
1933
|
+
if (!ensureSelectionOnVideo(editor, videoElem)) return;
|
|
1934
|
+
var live = DomEditor.getSelectedNodeByType(editor, 'video') || videoElem;
|
|
1935
|
+
var nextWidth = isVideoFullWidthOn(live) ? 'auto' : '100%';
|
|
1936
|
+
Transforms.setNodes(editor, {
|
|
1937
|
+
width: nextWidth,
|
|
1938
|
+
height: 'auto'
|
|
1939
|
+
}, {
|
|
1940
|
+
at: path
|
|
1941
|
+
});
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1944
|
+
if (action === 'edit-size') {
|
|
1945
|
+
if (!ensureSelectionOnVideo(editor, videoElem)) return;
|
|
1946
|
+
var live = getLiveVideo(editor, path) || videoElem;
|
|
1947
|
+
var w = window.prompt('宽度(如 400 / auto / 100%)', String((_a = live.width) !== null && _a !== void 0 ? _a : 'auto'));
|
|
1948
|
+
if (w == null) return;
|
|
1949
|
+
var h_1 = window.prompt('高度(如 300 / auto)', String((_b = live.height) !== null && _b !== void 0 ? _b : 'auto'));
|
|
1950
|
+
if (h_1 == null) return;
|
|
1951
|
+
Transforms.setNodes(editor, {
|
|
1952
|
+
width: w.trim() || 'auto',
|
|
1953
|
+
height: h_1.trim() || 'auto'
|
|
1954
|
+
}, {
|
|
1955
|
+
at: path
|
|
1956
|
+
});
|
|
1957
|
+
return;
|
|
1958
|
+
}
|
|
1959
|
+
if (action === 'remove') {
|
|
1960
|
+
var node = getLiveVideo(editor, path) || videoElem;
|
|
1961
|
+
replaceBlockWithEmptyLine(editor, path, node);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
function getLiveVideo(editor, path) {
|
|
1965
|
+
try {
|
|
1966
|
+
return Node.get(editor, path);
|
|
1967
|
+
} catch (_) {
|
|
1968
|
+
return null;
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
function renderVideoMedia(elem) {
|
|
1972
|
+
var _a = elem.src,
|
|
1973
|
+
src = _a === void 0 ? '' : _a,
|
|
1974
|
+
_b = elem.poster,
|
|
1975
|
+
poster = _b === void 0 ? '' : _b,
|
|
1976
|
+
_c = elem.width,
|
|
1977
|
+
width = _c === void 0 ? 'auto' : _c,
|
|
1978
|
+
_d = elem.height,
|
|
1979
|
+
height = _d === void 0 ? 'auto' : _d;
|
|
1980
|
+
if (src.trim().indexOf('<iframe ') === 0) {
|
|
1981
|
+
var iframeHtml_1 = genSizeStyledIframeHtml(src, width, height);
|
|
1982
|
+
return h('div', {
|
|
1983
|
+
attrs: {
|
|
1984
|
+
class: 'mdg-video-iframe-host' + (width === '100%' ? ' is-full-width' : '')
|
|
1985
|
+
},
|
|
1986
|
+
hook: {
|
|
1987
|
+
insert: function insert(vnode) {
|
|
1988
|
+
if (vnode.elm) vnode.elm.innerHTML = iframeHtml_1;
|
|
1989
|
+
},
|
|
1990
|
+
postpatch: function postpatch(_o, vnode) {
|
|
1991
|
+
if (vnode.elm && vnode.elm.innerHTML !== iframeHtml_1) {
|
|
1992
|
+
vnode.elm.innerHTML = iframeHtml_1;
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
var videoVnode = jsx("video", {
|
|
1999
|
+
poster: poster,
|
|
2000
|
+
controls: true
|
|
2001
|
+
}, jsx("source", {
|
|
2002
|
+
src: src,
|
|
2003
|
+
type: "video/mp4"
|
|
2004
|
+
}), "Sorry, your browser doesn't support embedded videos.");
|
|
2005
|
+
if (width !== 'auto') videoVnode.data.width = width;
|
|
2006
|
+
if (height !== 'auto') videoVnode.data.height = height;
|
|
2007
|
+
return videoVnode;
|
|
2008
|
+
}
|
|
2009
|
+
function renderVideo(elemNode, children, editor) {
|
|
2010
|
+
var elem = elemNode;
|
|
2011
|
+
var selected = DomEditor.isNodeSelected(editor, elemNode);
|
|
2012
|
+
var media = renderVideoMedia(elem);
|
|
2013
|
+
var align = normalizeVideoAlign(elem.align);
|
|
2014
|
+
var alignItems = align === 'center' ? 'center' : align === 'right' ? 'flex-end' : 'flex-start';
|
|
2015
|
+
var containerStyle = {
|
|
2016
|
+
display: 'flex',
|
|
2017
|
+
flexDirection: 'column',
|
|
2018
|
+
alignItems: alignItems
|
|
2019
|
+
};
|
|
2020
|
+
if (editor.isDisabled()) {
|
|
2021
|
+
return h('div', {
|
|
2022
|
+
props: {
|
|
2023
|
+
contentEditable: false
|
|
2024
|
+
},
|
|
2025
|
+
on: {
|
|
2026
|
+
mousedown: function mousedown(e) {
|
|
2027
|
+
return e.preventDefault();
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
}, [h('div', {
|
|
2031
|
+
attrs: {
|
|
2032
|
+
class: 'w-e-textarea-video-container',
|
|
2033
|
+
'data-selected': selected ? 'true' : 'false',
|
|
2034
|
+
'data-align': align
|
|
2035
|
+
},
|
|
2036
|
+
style: containerStyle
|
|
2037
|
+
}, [media])]);
|
|
2038
|
+
}
|
|
2039
|
+
var canCancelEnter = false;
|
|
2040
|
+
try {
|
|
2041
|
+
var path = DomEditor.findPath(editor, elemNode);
|
|
2042
|
+
canCancelEnter = canRemoveEmptyLineAboveBlock(editor, path);
|
|
2043
|
+
} catch (_) {
|
|
2044
|
+
canCancelEnter = false;
|
|
2045
|
+
}
|
|
2046
|
+
var fullWidthOn = isVideoFullWidthOn(elem);
|
|
2047
|
+
var toolbar = h('div', {
|
|
2048
|
+
attrs: {
|
|
2049
|
+
class: 'mdg-video-toolbar',
|
|
2050
|
+
contenteditable: 'false',
|
|
2051
|
+
'data-mdg-video-toolbar': '1'
|
|
2052
|
+
},
|
|
2053
|
+
props: {
|
|
2054
|
+
contentEditable: false
|
|
2055
|
+
},
|
|
2056
|
+
style: {
|
|
2057
|
+
alignSelf: 'stretch'
|
|
2058
|
+
},
|
|
2059
|
+
on: {
|
|
2060
|
+
mousedown: function mousedown(e) {
|
|
2061
|
+
e.preventDefault();
|
|
2062
|
+
e.stopPropagation();
|
|
2063
|
+
},
|
|
2064
|
+
click: function click(e) {
|
|
2065
|
+
var _a, _b;
|
|
2066
|
+
e.preventDefault();
|
|
2067
|
+
e.stopPropagation();
|
|
2068
|
+
var t = e.target;
|
|
2069
|
+
var btn = (_a = t === null || t === void 0 ? void 0 : t.closest) === null || _a === void 0 ? void 0 : _a.call(t, 'button[data-video-action]');
|
|
2070
|
+
var action = (_b = btn === null || btn === void 0 ? void 0 : btn.getAttribute) === null || _b === void 0 ? void 0 : _b.call(btn, 'data-video-action');
|
|
2071
|
+
if (!btn || !action || btn.classList.contains('is-disabled')) return;
|
|
2072
|
+
handleVideoToolbarAction(editor, elemNode, action);
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
}, [makeBtn('enter', '回车(上方空行)', ICON_ENTER), makeBtn('cancel-enter', '取消回车', ICON_CANCEL_ENTER, {
|
|
2076
|
+
disabled: !canCancelEnter
|
|
2077
|
+
}), makeBtn('edit-size', '修改尺寸', ICON_SIZE), makeBtn('align-left', '左对齐', ICON_ALIGN_LEFT, {
|
|
2078
|
+
active: align === 'left'
|
|
2079
|
+
}), makeBtn('align-center', '居中', ICON_ALIGN_CENTER, {
|
|
2080
|
+
active: align === 'center'
|
|
2081
|
+
}), makeBtn('align-right', '右对齐', ICON_ALIGN_RIGHT, {
|
|
2082
|
+
active: align === 'right'
|
|
2083
|
+
}), makeBtn('full-width', '宽度自适应', ICON_FULL, {
|
|
2084
|
+
active: fullWidthOn
|
|
2085
|
+
}), makeBtn('remove', '删除', ICON_REMOVE)]);
|
|
2086
|
+
return h('div', {
|
|
2087
|
+
props: {
|
|
2088
|
+
contentEditable: false
|
|
2089
|
+
},
|
|
2090
|
+
on: {
|
|
2091
|
+
mousedown: function mousedown(e) {
|
|
2092
|
+
return e.preventDefault();
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
}, [h('div', {
|
|
2096
|
+
attrs: {
|
|
2097
|
+
class: 'w-e-textarea-video-container mdg-video-with-toolbar',
|
|
2098
|
+
'data-selected': selected ? 'true' : 'false',
|
|
2099
|
+
'data-align': align
|
|
2100
|
+
},
|
|
2101
|
+
style: containerStyle
|
|
2102
|
+
}, [toolbar, media])]);
|
|
2103
|
+
}
|
|
2104
|
+
var renderVideoConf = {
|
|
2105
|
+
type: 'video',
|
|
2106
|
+
renderElem: renderVideo
|
|
2107
|
+
};
|
|
2108
|
+
|
|
2109
|
+
function videoToHtml(elemNode, childrenHtml) {
|
|
2110
|
+
var _a = elemNode,
|
|
2111
|
+
_b = _a.src,
|
|
2112
|
+
src = _b === void 0 ? '' : _b,
|
|
2113
|
+
_c = _a.poster,
|
|
2114
|
+
poster = _c === void 0 ? '' : _c,
|
|
2115
|
+
_d = _a.width,
|
|
2116
|
+
width = _d === void 0 ? 'auto' : _d,
|
|
2117
|
+
_e = _a.height,
|
|
2118
|
+
height = _e === void 0 ? 'auto' : _e,
|
|
2119
|
+
rawAlign = _a.align;
|
|
2120
|
+
var align = normalizeVideoAlign(rawAlign);
|
|
2121
|
+
var alignAttr = align !== 'left' ? " data-align=\"" + align + "\"" : '';
|
|
2122
|
+
var alignStyle = align !== 'left' ? " style=\"text-align: " + align + ";\"" : '';
|
|
2123
|
+
var res = "<div data-w-e-type=\"video\" data-w-e-is-void" + alignAttr + alignStyle + ">\n";
|
|
2124
|
+
if (src.trim().indexOf('<iframe ') === 0) {
|
|
2125
|
+
var iframeHtml = genSizeStyledIframeHtml(src, width, height);
|
|
2126
|
+
res += iframeHtml;
|
|
2127
|
+
} else {
|
|
2128
|
+
res += "<video poster=\"" + poster + "\" controls=\"true\" width=\"" + width + "\" height=\"" + height + "\"><source src=\"" + src + "\" type=\"video/mp4\"/></video>";
|
|
2129
|
+
}
|
|
2130
|
+
res += '\n</div>';
|
|
2131
|
+
return res;
|
|
2132
|
+
}
|
|
2133
|
+
var videoToHtmlConf = {
|
|
2134
|
+
type: 'video',
|
|
2135
|
+
elemToHtml: videoToHtml
|
|
2136
|
+
};
|
|
2137
|
+
|
|
2138
|
+
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
2139
|
+
var ArrayPrototype$1 = Array.prototype;
|
|
2140
|
+
|
|
2141
|
+
// Array.prototype[@@unscopables]
|
|
2142
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
2143
|
+
if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
|
|
2144
|
+
objectDefineProperty.f(ArrayPrototype$1, UNSCOPABLES, {
|
|
2145
|
+
configurable: true,
|
|
2146
|
+
value: objectCreate(null)
|
|
2147
|
+
});
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
// add a key to Array.prototype[@@unscopables]
|
|
2151
|
+
var addToUnscopables = function (key) {
|
|
2152
|
+
ArrayPrototype$1[UNSCOPABLES][key] = true;
|
|
2153
|
+
};
|
|
2154
|
+
|
|
2155
|
+
var $includes = arrayIncludes.includes;
|
|
2156
|
+
|
|
2157
|
+
|
|
2158
|
+
// `Array.prototype.includes` method
|
|
2159
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
2160
|
+
_export({ target: 'Array', proto: true }, {
|
|
2161
|
+
includes: function includes(el /* , fromIndex = 0 */) {
|
|
2162
|
+
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
2163
|
+
}
|
|
2164
|
+
});
|
|
2165
|
+
|
|
2166
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
2167
|
+
addToUnscopables('includes');
|
|
2168
|
+
|
|
2169
|
+
function preParse(elem) {
|
|
2170
|
+
var $elem = $(elem);
|
|
2171
|
+
var $video = $elem;
|
|
2172
|
+
var elemTagName = getTagName($elem);
|
|
2173
|
+
if (elemTagName === 'p') {
|
|
2174
|
+
var children = $elem.children();
|
|
2175
|
+
if (children.length === 1) {
|
|
2176
|
+
var firstChild = children[0];
|
|
2177
|
+
var firstChildTagName = firstChild.tagName.toLowerCase();
|
|
2178
|
+
if (['iframe', 'video'].includes(firstChildTagName)) {
|
|
2179
|
+
$video = $(firstChild);
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
var videoTagName = getTagName($video);
|
|
2184
|
+
if (videoTagName !== 'iframe' && videoTagName !== 'video') return $video[0];
|
|
2185
|
+
var $parent = $video.parent();
|
|
2186
|
+
if ($parent.attr('data-w-e-type') === 'video') return $video[0];
|
|
2187
|
+
var $container = $("<div data-w-e-type=\"video\" data-w-e-is-void></div>");
|
|
2188
|
+
$container.append($video);
|
|
2189
|
+
return $container[0];
|
|
2190
|
+
}
|
|
2191
|
+
var preParseHtmlConf = {
|
|
2192
|
+
selector: 'iframe,video,p',
|
|
2193
|
+
preParseHtml: preParse
|
|
2194
|
+
};
|
|
2195
|
+
|
|
2196
|
+
var $find = arrayIteration.find;
|
|
2197
|
+
|
|
2198
|
+
|
|
2199
|
+
var FIND = 'find';
|
|
2200
|
+
var SKIPS_HOLES = true;
|
|
2201
|
+
|
|
2202
|
+
// Shouldn't skip holes
|
|
2203
|
+
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
|
2204
|
+
|
|
2205
|
+
// `Array.prototype.find` method
|
|
2206
|
+
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
2207
|
+
_export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
|
2208
|
+
find: function find(callbackfn /* , that = undefined */) {
|
|
2209
|
+
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
2210
|
+
}
|
|
2211
|
+
});
|
|
2212
|
+
|
|
2213
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
2214
|
+
addToUnscopables(FIND);
|
|
2215
|
+
|
|
2216
|
+
function genVideoElem(src, poster, width, height, align) {
|
|
2217
|
+
if (poster === void 0) {
|
|
2218
|
+
poster = '';
|
|
2219
|
+
}
|
|
2220
|
+
if (width === void 0) {
|
|
2221
|
+
width = 'auto';
|
|
2222
|
+
}
|
|
2223
|
+
if (height === void 0) {
|
|
2224
|
+
height = 'auto';
|
|
2225
|
+
}
|
|
2226
|
+
if (align === void 0) {
|
|
2227
|
+
align = 'left';
|
|
2228
|
+
}
|
|
2229
|
+
var elem = {
|
|
2230
|
+
type: 'video',
|
|
2231
|
+
src: src,
|
|
2232
|
+
poster: poster,
|
|
2233
|
+
width: width,
|
|
2234
|
+
height: height,
|
|
2235
|
+
children: [{
|
|
2236
|
+
text: ''
|
|
2237
|
+
}]
|
|
2238
|
+
};
|
|
2239
|
+
if (align !== 'left') elem.align = align;
|
|
2240
|
+
return elem;
|
|
2241
|
+
}
|
|
2242
|
+
function parseAlignFromElem(elem) {
|
|
2243
|
+
var _a, _b;
|
|
2244
|
+
var raw = ((_a = elem.getAttribute) === null || _a === void 0 ? void 0 : _a.call(elem, 'data-align')) || (typeof ((_b = elem.style) === null || _b === void 0 ? void 0 : _b.textAlign) === 'string' ? elem.style.textAlign : '') || '';
|
|
2245
|
+
return normalizeVideoAlign(raw);
|
|
2246
|
+
}
|
|
2247
|
+
function parseHtml(elem, children, editor) {
|
|
2248
|
+
var $elem = $(elem);
|
|
2249
|
+
var src = '';
|
|
2250
|
+
var poster = '';
|
|
2251
|
+
var width = 'auto';
|
|
2252
|
+
var height = 'auto';
|
|
2253
|
+
var align = parseAlignFromElem(elem);
|
|
2254
|
+
var $iframe = $elem.find('iframe');
|
|
2255
|
+
if ($iframe.length > 0) {
|
|
2256
|
+
width = $iframe.attr('width') || 'auto';
|
|
2257
|
+
height = $iframe.attr('height') || 'auto';
|
|
2258
|
+
src = $iframe[0].outerHTML;
|
|
2259
|
+
return genVideoElem(src, poster, width, height, align);
|
|
2260
|
+
}
|
|
2261
|
+
var $video = $elem.find('video');
|
|
2262
|
+
src = $video.attr('src') || '';
|
|
2263
|
+
if (!src) {
|
|
2264
|
+
if ($video.length > 0) {
|
|
2265
|
+
var $source = $video.find('source');
|
|
2266
|
+
src = $source.attr('src') || '';
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
width = $video.attr('width') || 'auto';
|
|
2270
|
+
height = $video.attr('height') || 'auto';
|
|
2271
|
+
poster = $video.attr('poster') || '';
|
|
2272
|
+
return genVideoElem(src, poster, width, height, align);
|
|
2273
|
+
}
|
|
2274
|
+
var parseHtmlConf = {
|
|
2275
|
+
selector: 'div[data-w-e-type="video"]',
|
|
2276
|
+
parseElemHtml: parseHtml
|
|
2277
|
+
};
|
|
2278
|
+
|
|
2279
|
+
function genRandomStr(prefix) {
|
|
2280
|
+
if (prefix === void 0) {
|
|
2281
|
+
prefix = 'r';
|
|
2282
|
+
}
|
|
2283
|
+
return prefix + "-" + nanoid();
|
|
2284
|
+
}
|
|
2285
|
+
function replaceSymbols(str) {
|
|
2286
|
+
return str.replace(/</g, '<').replace(/>/g, '>');
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
var VIDEO_SVG = '<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>';
|
|
2290
|
+
var UPLOAD_VIDEO_SVG = '<svg viewBox="0 0 1056 1024"><path d="M805.902261 521.819882a251.441452 251.441452 0 0 0-251.011972 246.600033 251.051015 251.051015 0 1 0 502.023944 8.823877 253.237463 253.237463 0 0 0-251.011972-255.42391z m59.463561 240.001647v129.898403h-116.701631v-129.898403h-44.041298l101.279368-103.504859 101.279368 103.504859z" p-id="6802"></path><path d="M788.254507 0.000781H99.094092A98.663439 98.663439 0 0 0 0.001171 99.093701v590.067495a98.663439 98.663439 0 0 0 99.092921 99.092921h411.7549a266.434235 266.434235 0 0 1-2.186448-41.815807 275.843767 275.843767 0 0 1 275.180024-270.729042 270.650955 270.650955 0 0 1 103.504859 19.834201V99.093701A101.51363 101.51363 0 0 0 788.254507 0.000781zM295.054441 640.747004V147.507894l394.146189 246.600033z"></path></svg>';
|
|
2291
|
+
|
|
2292
|
+
var nativePromiseConstructor = global$1.Promise;
|
|
2293
|
+
|
|
2294
|
+
var redefineAll = function (target, src, options) {
|
|
2295
|
+
for (var key in src) redefine(target, key, src[key], options);
|
|
2296
|
+
return target;
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
var String$2 = global$1.String;
|
|
2300
|
+
var TypeError$6 = global$1.TypeError;
|
|
2301
|
+
|
|
2302
|
+
var aPossiblePrototype = function (argument) {
|
|
2303
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
2304
|
+
throw TypeError$6("Can't set " + String$2(argument) + ' as a prototype');
|
|
2305
|
+
};
|
|
2306
|
+
|
|
2307
|
+
/* eslint-disable no-proto -- safe */
|
|
2308
|
+
|
|
2309
|
+
// `Object.setPrototypeOf` method
|
|
2310
|
+
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
2311
|
+
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
2312
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
2313
|
+
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
2314
|
+
var CORRECT_SETTER = false;
|
|
2315
|
+
var test = {};
|
|
2316
|
+
var setter;
|
|
2317
|
+
try {
|
|
2318
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
2319
|
+
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
2320
|
+
setter(test, []);
|
|
2321
|
+
CORRECT_SETTER = test instanceof Array;
|
|
2322
|
+
} catch (error) { /* empty */ }
|
|
2323
|
+
return function setPrototypeOf(O, proto) {
|
|
2324
|
+
anObject(O);
|
|
2325
|
+
aPossiblePrototype(proto);
|
|
2326
|
+
if (CORRECT_SETTER) setter(O, proto);
|
|
2327
|
+
else O.__proto__ = proto;
|
|
2328
|
+
return O;
|
|
2329
|
+
};
|
|
2330
|
+
}() : undefined);
|
|
2331
|
+
|
|
2332
|
+
var defineProperty$1 = objectDefineProperty.f;
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
|
|
2336
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
2337
|
+
|
|
2338
|
+
var setToStringTag = function (it, TAG, STATIC) {
|
|
2339
|
+
if (it && !hasOwnProperty_1(it = STATIC ? it : it.prototype, TO_STRING_TAG$1)) {
|
|
2340
|
+
defineProperty$1(it, TO_STRING_TAG$1, { configurable: true, value: TAG });
|
|
2341
|
+
}
|
|
2342
|
+
};
|
|
2343
|
+
|
|
2344
|
+
var SPECIES$3 = wellKnownSymbol('species');
|
|
2345
|
+
|
|
2346
|
+
var setSpecies = function (CONSTRUCTOR_NAME) {
|
|
2347
|
+
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
|
2348
|
+
var defineProperty = objectDefineProperty.f;
|
|
2349
|
+
|
|
2350
|
+
if (descriptors && Constructor && !Constructor[SPECIES$3]) {
|
|
2351
|
+
defineProperty(Constructor, SPECIES$3, {
|
|
2352
|
+
configurable: true,
|
|
2353
|
+
get: function () { return this; }
|
|
2354
|
+
});
|
|
2355
|
+
}
|
|
2356
|
+
};
|
|
2357
|
+
|
|
2358
|
+
var TypeError$5 = global$1.TypeError;
|
|
2359
|
+
|
|
2360
|
+
var anInstance = function (it, Prototype) {
|
|
2361
|
+
if (objectIsPrototypeOf(Prototype, it)) return it;
|
|
2362
|
+
throw TypeError$5('Incorrect invocation');
|
|
2363
|
+
};
|
|
2364
|
+
|
|
2365
|
+
var iterators = {};
|
|
2366
|
+
|
|
2367
|
+
var ITERATOR$5 = wellKnownSymbol('iterator');
|
|
2368
|
+
var ArrayPrototype = Array.prototype;
|
|
2369
|
+
|
|
2370
|
+
// check on default Array iterator
|
|
2371
|
+
var isArrayIteratorMethod = function (it) {
|
|
2372
|
+
return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$5] === it);
|
|
2373
|
+
};
|
|
2374
|
+
|
|
2375
|
+
var ITERATOR$4 = wellKnownSymbol('iterator');
|
|
2376
|
+
|
|
2377
|
+
var getIteratorMethod = function (it) {
|
|
2378
|
+
if (it != undefined) return getMethod(it, ITERATOR$4)
|
|
2379
|
+
|| getMethod(it, '@@iterator')
|
|
2380
|
+
|| iterators[classof(it)];
|
|
2381
|
+
};
|
|
2382
|
+
|
|
2383
|
+
var TypeError$4 = global$1.TypeError;
|
|
2384
|
+
|
|
2385
|
+
var getIterator = function (argument, usingIterator) {
|
|
2386
|
+
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
|
2387
|
+
if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
|
|
2388
|
+
throw TypeError$4(tryToString(argument) + ' is not iterable');
|
|
2389
|
+
};
|
|
2390
|
+
|
|
2391
|
+
var iteratorClose = function (iterator, kind, value) {
|
|
2392
|
+
var innerResult, innerError;
|
|
2393
|
+
anObject(iterator);
|
|
2394
|
+
try {
|
|
2395
|
+
innerResult = getMethod(iterator, 'return');
|
|
2396
|
+
if (!innerResult) {
|
|
2397
|
+
if (kind === 'throw') throw value;
|
|
2398
|
+
return value;
|
|
2399
|
+
}
|
|
2400
|
+
innerResult = functionCall(innerResult, iterator);
|
|
2401
|
+
} catch (error) {
|
|
2402
|
+
innerError = true;
|
|
2403
|
+
innerResult = error;
|
|
2404
|
+
}
|
|
2405
|
+
if (kind === 'throw') throw value;
|
|
2406
|
+
if (innerError) throw innerResult;
|
|
2407
|
+
anObject(innerResult);
|
|
2408
|
+
return value;
|
|
2409
|
+
};
|
|
2410
|
+
|
|
2411
|
+
var TypeError$3 = global$1.TypeError;
|
|
2412
|
+
|
|
2413
|
+
var Result = function (stopped, result) {
|
|
2414
|
+
this.stopped = stopped;
|
|
2415
|
+
this.result = result;
|
|
2416
|
+
};
|
|
2417
|
+
|
|
2418
|
+
var ResultPrototype = Result.prototype;
|
|
2419
|
+
|
|
2420
|
+
var iterate = function (iterable, unboundFunction, options) {
|
|
2421
|
+
var that = options && options.that;
|
|
2422
|
+
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
2423
|
+
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
2424
|
+
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
2425
|
+
var fn = functionBindContext(unboundFunction, that);
|
|
2426
|
+
var iterator, iterFn, index, length, result, next, step;
|
|
2427
|
+
|
|
2428
|
+
var stop = function (condition) {
|
|
2429
|
+
if (iterator) iteratorClose(iterator, 'normal', condition);
|
|
2430
|
+
return new Result(true, condition);
|
|
2431
|
+
};
|
|
2432
|
+
|
|
2433
|
+
var callFn = function (value) {
|
|
2434
|
+
if (AS_ENTRIES) {
|
|
2435
|
+
anObject(value);
|
|
2436
|
+
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
2437
|
+
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
2438
|
+
};
|
|
2439
|
+
|
|
2440
|
+
if (IS_ITERATOR) {
|
|
2441
|
+
iterator = iterable;
|
|
2442
|
+
} else {
|
|
2443
|
+
iterFn = getIteratorMethod(iterable);
|
|
2444
|
+
if (!iterFn) throw TypeError$3(tryToString(iterable) + ' is not iterable');
|
|
2445
|
+
// optimisation for array iterators
|
|
2446
|
+
if (isArrayIteratorMethod(iterFn)) {
|
|
2447
|
+
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
|
2448
|
+
result = callFn(iterable[index]);
|
|
2449
|
+
if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
2450
|
+
} return new Result(false);
|
|
2451
|
+
}
|
|
2452
|
+
iterator = getIterator(iterable, iterFn);
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
next = iterator.next;
|
|
2456
|
+
while (!(step = functionCall(next, iterator)).done) {
|
|
2457
|
+
try {
|
|
2458
|
+
result = callFn(step.value);
|
|
2459
|
+
} catch (error) {
|
|
2460
|
+
iteratorClose(iterator, 'throw', error);
|
|
2461
|
+
}
|
|
2462
|
+
if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
2463
|
+
} return new Result(false);
|
|
2464
|
+
};
|
|
2465
|
+
|
|
2466
|
+
var ITERATOR$3 = wellKnownSymbol('iterator');
|
|
2467
|
+
var SAFE_CLOSING = false;
|
|
2468
|
+
|
|
2469
|
+
try {
|
|
2470
|
+
var called = 0;
|
|
2471
|
+
var iteratorWithReturn = {
|
|
2472
|
+
next: function () {
|
|
2473
|
+
return { done: !!called++ };
|
|
2474
|
+
},
|
|
2475
|
+
'return': function () {
|
|
2476
|
+
SAFE_CLOSING = true;
|
|
2477
|
+
}
|
|
2478
|
+
};
|
|
2479
|
+
iteratorWithReturn[ITERATOR$3] = function () {
|
|
2480
|
+
return this;
|
|
2481
|
+
};
|
|
2482
|
+
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
|
|
2483
|
+
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
2484
|
+
} catch (error) { /* empty */ }
|
|
2485
|
+
|
|
2486
|
+
var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
|
|
2487
|
+
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
|
2488
|
+
var ITERATION_SUPPORT = false;
|
|
2489
|
+
try {
|
|
2490
|
+
var object = {};
|
|
2491
|
+
object[ITERATOR$3] = function () {
|
|
2492
|
+
return {
|
|
2493
|
+
next: function () {
|
|
2494
|
+
return { done: ITERATION_SUPPORT = true };
|
|
2495
|
+
}
|
|
2496
|
+
};
|
|
2497
|
+
};
|
|
2498
|
+
exec(object);
|
|
2499
|
+
} catch (error) { /* empty */ }
|
|
2500
|
+
return ITERATION_SUPPORT;
|
|
2501
|
+
};
|
|
2502
|
+
|
|
2503
|
+
var TypeError$2 = global$1.TypeError;
|
|
2504
|
+
|
|
2505
|
+
// `Assert: IsConstructor(argument) is true`
|
|
2506
|
+
var aConstructor = function (argument) {
|
|
2507
|
+
if (isConstructor(argument)) return argument;
|
|
2508
|
+
throw TypeError$2(tryToString(argument) + ' is not a constructor');
|
|
2509
|
+
};
|
|
2510
|
+
|
|
2511
|
+
var SPECIES$2 = wellKnownSymbol('species');
|
|
2512
|
+
|
|
2513
|
+
// `SpeciesConstructor` abstract operation
|
|
2514
|
+
// https://tc39.es/ecma262/#sec-speciesconstructor
|
|
2515
|
+
var speciesConstructor = function (O, defaultConstructor) {
|
|
2516
|
+
var C = anObject(O).constructor;
|
|
2517
|
+
var S;
|
|
2518
|
+
return C === undefined || (S = anObject(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
|
|
2519
|
+
};
|
|
2520
|
+
|
|
2521
|
+
var arraySlice = functionUncurryThis([].slice);
|
|
2522
|
+
|
|
2523
|
+
var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(engineUserAgent);
|
|
2524
|
+
|
|
2525
|
+
var engineIsNode = classofRaw(global$1.process) == 'process';
|
|
2526
|
+
|
|
2527
|
+
var set = global$1.setImmediate;
|
|
2528
|
+
var clear = global$1.clearImmediate;
|
|
2529
|
+
var process$2 = global$1.process;
|
|
2530
|
+
var Dispatch = global$1.Dispatch;
|
|
2531
|
+
var Function$1 = global$1.Function;
|
|
2532
|
+
var MessageChannel = global$1.MessageChannel;
|
|
2533
|
+
var String$1 = global$1.String;
|
|
2534
|
+
var counter = 0;
|
|
2535
|
+
var queue = {};
|
|
2536
|
+
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
2537
|
+
var location, defer, channel, port;
|
|
2538
|
+
|
|
2539
|
+
try {
|
|
2540
|
+
// Deno throws a ReferenceError on `location` access without `--location` flag
|
|
2541
|
+
location = global$1.location;
|
|
2542
|
+
} catch (error) { /* empty */ }
|
|
2543
|
+
|
|
2544
|
+
var run = function (id) {
|
|
2545
|
+
if (hasOwnProperty_1(queue, id)) {
|
|
2546
|
+
var fn = queue[id];
|
|
2547
|
+
delete queue[id];
|
|
2548
|
+
fn();
|
|
2549
|
+
}
|
|
2550
|
+
};
|
|
2551
|
+
|
|
2552
|
+
var runner = function (id) {
|
|
2553
|
+
return function () {
|
|
2554
|
+
run(id);
|
|
2555
|
+
};
|
|
2556
|
+
};
|
|
2557
|
+
|
|
2558
|
+
var listener = function (event) {
|
|
2559
|
+
run(event.data);
|
|
2560
|
+
};
|
|
2561
|
+
|
|
2562
|
+
var post = function (id) {
|
|
2563
|
+
// old engines have not location.origin
|
|
2564
|
+
global$1.postMessage(String$1(id), location.protocol + '//' + location.host);
|
|
2565
|
+
};
|
|
2566
|
+
|
|
2567
|
+
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
2568
|
+
if (!set || !clear) {
|
|
2569
|
+
set = function setImmediate(fn) {
|
|
2570
|
+
var args = arraySlice(arguments, 1);
|
|
2571
|
+
queue[++counter] = function () {
|
|
2572
|
+
functionApply(isCallable(fn) ? fn : Function$1(fn), undefined, args);
|
|
2573
|
+
};
|
|
2574
|
+
defer(counter);
|
|
2575
|
+
return counter;
|
|
2576
|
+
};
|
|
2577
|
+
clear = function clearImmediate(id) {
|
|
2578
|
+
delete queue[id];
|
|
2579
|
+
};
|
|
2580
|
+
// Node.js 0.8-
|
|
2581
|
+
if (engineIsNode) {
|
|
2582
|
+
defer = function (id) {
|
|
2583
|
+
process$2.nextTick(runner(id));
|
|
2584
|
+
};
|
|
2585
|
+
// Sphere (JS game engine) Dispatch API
|
|
2586
|
+
} else if (Dispatch && Dispatch.now) {
|
|
2587
|
+
defer = function (id) {
|
|
2588
|
+
Dispatch.now(runner(id));
|
|
2589
|
+
};
|
|
2590
|
+
// Browsers with MessageChannel, includes WebWorkers
|
|
2591
|
+
// except iOS - https://github.com/zloirock/core-js/issues/624
|
|
2592
|
+
} else if (MessageChannel && !engineIsIos) {
|
|
2593
|
+
channel = new MessageChannel();
|
|
2594
|
+
port = channel.port2;
|
|
2595
|
+
channel.port1.onmessage = listener;
|
|
2596
|
+
defer = functionBindContext(port.postMessage, port);
|
|
2597
|
+
// Browsers with postMessage, skip WebWorkers
|
|
2598
|
+
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
|
2599
|
+
} else if (
|
|
2600
|
+
global$1.addEventListener &&
|
|
2601
|
+
isCallable(global$1.postMessage) &&
|
|
2602
|
+
!global$1.importScripts &&
|
|
2603
|
+
location && location.protocol !== 'file:' &&
|
|
2604
|
+
!fails(post)
|
|
2605
|
+
) {
|
|
2606
|
+
defer = post;
|
|
2607
|
+
global$1.addEventListener('message', listener, false);
|
|
2608
|
+
// IE8-
|
|
2609
|
+
} else if (ONREADYSTATECHANGE in documentCreateElement('script')) {
|
|
2610
|
+
defer = function (id) {
|
|
2611
|
+
html.appendChild(documentCreateElement('script'))[ONREADYSTATECHANGE] = function () {
|
|
2612
|
+
html.removeChild(this);
|
|
2613
|
+
run(id);
|
|
2614
|
+
};
|
|
2615
|
+
};
|
|
2616
|
+
// Rest old browsers
|
|
2617
|
+
} else {
|
|
2618
|
+
defer = function (id) {
|
|
2619
|
+
setTimeout(runner(id), 0);
|
|
2620
|
+
};
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
var task$1 = {
|
|
2625
|
+
set: set,
|
|
2626
|
+
clear: clear
|
|
2627
|
+
};
|
|
2628
|
+
|
|
2629
|
+
var engineIsIosPebble = /ipad|iphone|ipod/i.test(engineUserAgent) && global$1.Pebble !== undefined;
|
|
2630
|
+
|
|
2631
|
+
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
|
|
2632
|
+
|
|
2633
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
2634
|
+
var macrotask = task$1.set;
|
|
2635
|
+
|
|
2636
|
+
|
|
2637
|
+
|
|
2638
|
+
|
|
2639
|
+
|
|
2640
|
+
var MutationObserver = global$1.MutationObserver || global$1.WebKitMutationObserver;
|
|
2641
|
+
var document$2 = global$1.document;
|
|
2642
|
+
var process$1 = global$1.process;
|
|
2643
|
+
var Promise$1 = global$1.Promise;
|
|
2644
|
+
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
|
2645
|
+
var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$1, 'queueMicrotask');
|
|
2646
|
+
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
|
2647
|
+
|
|
2648
|
+
var flush, head, last, notify$1, toggle, node, promise, then;
|
|
2649
|
+
|
|
2650
|
+
// modern engines have queueMicrotask method
|
|
2651
|
+
if (!queueMicrotask) {
|
|
2652
|
+
flush = function () {
|
|
2653
|
+
var parent, fn;
|
|
2654
|
+
if (engineIsNode && (parent = process$1.domain)) parent.exit();
|
|
2655
|
+
while (head) {
|
|
2656
|
+
fn = head.fn;
|
|
2657
|
+
head = head.next;
|
|
2658
|
+
try {
|
|
2659
|
+
fn();
|
|
2660
|
+
} catch (error) {
|
|
2661
|
+
if (head) notify$1();
|
|
2662
|
+
else last = undefined;
|
|
2663
|
+
throw error;
|
|
2664
|
+
}
|
|
2665
|
+
} last = undefined;
|
|
2666
|
+
if (parent) parent.enter();
|
|
2667
|
+
};
|
|
2668
|
+
|
|
2669
|
+
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
|
2670
|
+
// also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
|
|
2671
|
+
if (!engineIsIos && !engineIsNode && !engineIsWebosWebkit && MutationObserver && document$2) {
|
|
2672
|
+
toggle = true;
|
|
2673
|
+
node = document$2.createTextNode('');
|
|
2674
|
+
new MutationObserver(flush).observe(node, { characterData: true });
|
|
2675
|
+
notify$1 = function () {
|
|
2676
|
+
node.data = toggle = !toggle;
|
|
2677
|
+
};
|
|
2678
|
+
// environments with maybe non-completely correct, but existent Promise
|
|
2679
|
+
} else if (!engineIsIosPebble && Promise$1 && Promise$1.resolve) {
|
|
2680
|
+
// Promise.resolve without an argument throws an error in LG WebOS 2
|
|
2681
|
+
promise = Promise$1.resolve(undefined);
|
|
2682
|
+
// workaround of WebKit ~ iOS Safari 10.1 bug
|
|
2683
|
+
promise.constructor = Promise$1;
|
|
2684
|
+
then = functionBindContext(promise.then, promise);
|
|
2685
|
+
notify$1 = function () {
|
|
2686
|
+
then(flush);
|
|
2687
|
+
};
|
|
2688
|
+
// Node.js without promises
|
|
2689
|
+
} else if (engineIsNode) {
|
|
2690
|
+
notify$1 = function () {
|
|
2691
|
+
process$1.nextTick(flush);
|
|
2692
|
+
};
|
|
2693
|
+
// for other environments - macrotask based on:
|
|
2694
|
+
// - setImmediate
|
|
2695
|
+
// - MessageChannel
|
|
2696
|
+
// - window.postMessag
|
|
2697
|
+
// - onreadystatechange
|
|
2698
|
+
// - setTimeout
|
|
2699
|
+
} else {
|
|
2700
|
+
// strange IE + webpack dev server bug - use .bind(global)
|
|
2701
|
+
macrotask = functionBindContext(macrotask, global$1);
|
|
2702
|
+
notify$1 = function () {
|
|
2703
|
+
macrotask(flush);
|
|
2704
|
+
};
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
var microtask = queueMicrotask || function (fn) {
|
|
2709
|
+
var task = { fn: fn, next: undefined };
|
|
2710
|
+
if (last) last.next = task;
|
|
2711
|
+
if (!head) {
|
|
2712
|
+
head = task;
|
|
2713
|
+
notify$1();
|
|
2714
|
+
} last = task;
|
|
2715
|
+
};
|
|
2716
|
+
|
|
2717
|
+
var PromiseCapability = function (C) {
|
|
2718
|
+
var resolve, reject;
|
|
2719
|
+
this.promise = new C(function ($$resolve, $$reject) {
|
|
2720
|
+
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
|
2721
|
+
resolve = $$resolve;
|
|
2722
|
+
reject = $$reject;
|
|
2723
|
+
});
|
|
2724
|
+
this.resolve = aCallable(resolve);
|
|
2725
|
+
this.reject = aCallable(reject);
|
|
2726
|
+
};
|
|
2727
|
+
|
|
2728
|
+
// `NewPromiseCapability` abstract operation
|
|
2729
|
+
// https://tc39.es/ecma262/#sec-newpromisecapability
|
|
2730
|
+
var f$1 = function (C) {
|
|
2731
|
+
return new PromiseCapability(C);
|
|
2732
|
+
};
|
|
2733
|
+
|
|
2734
|
+
var newPromiseCapability$1 = {
|
|
2735
|
+
f: f$1
|
|
2736
|
+
};
|
|
2737
|
+
|
|
2738
|
+
var promiseResolve = function (C, x) {
|
|
2739
|
+
anObject(C);
|
|
2740
|
+
if (isObject(x) && x.constructor === C) return x;
|
|
2741
|
+
var promiseCapability = newPromiseCapability$1.f(C);
|
|
2742
|
+
var resolve = promiseCapability.resolve;
|
|
2743
|
+
resolve(x);
|
|
2744
|
+
return promiseCapability.promise;
|
|
2745
|
+
};
|
|
2746
|
+
|
|
2747
|
+
var hostReportErrors = function (a, b) {
|
|
2748
|
+
var console = global$1.console;
|
|
2749
|
+
if (console && console.error) {
|
|
2750
|
+
arguments.length == 1 ? console.error(a) : console.error(a, b);
|
|
2751
|
+
}
|
|
2752
|
+
};
|
|
2753
|
+
|
|
2754
|
+
var perform = function (exec) {
|
|
2755
|
+
try {
|
|
2756
|
+
return { error: false, value: exec() };
|
|
2757
|
+
} catch (error) {
|
|
2758
|
+
return { error: true, value: error };
|
|
2759
|
+
}
|
|
2760
|
+
};
|
|
2761
|
+
|
|
2762
|
+
var engineIsBrowser = typeof window == 'object';
|
|
2763
|
+
|
|
2764
|
+
var task = task$1.set;
|
|
2765
|
+
|
|
2766
|
+
|
|
2767
|
+
|
|
2768
|
+
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
|
|
2772
|
+
|
|
2773
|
+
|
|
2774
|
+
|
|
2775
|
+
|
|
2776
|
+
|
|
2777
|
+
var SPECIES$1 = wellKnownSymbol('species');
|
|
2778
|
+
var PROMISE = 'Promise';
|
|
2779
|
+
|
|
2780
|
+
var getInternalState$2 = internalState.getterFor(PROMISE);
|
|
2781
|
+
var setInternalState$3 = internalState.set;
|
|
2782
|
+
var getInternalPromiseState = internalState.getterFor(PROMISE);
|
|
2783
|
+
var NativePromisePrototype = nativePromiseConstructor && nativePromiseConstructor.prototype;
|
|
2784
|
+
var PromiseConstructor = nativePromiseConstructor;
|
|
2785
|
+
var PromisePrototype = NativePromisePrototype;
|
|
2786
|
+
var TypeError$1 = global$1.TypeError;
|
|
2787
|
+
var document$1 = global$1.document;
|
|
2788
|
+
var process = global$1.process;
|
|
2789
|
+
var newPromiseCapability = newPromiseCapability$1.f;
|
|
2790
|
+
var newGenericPromiseCapability = newPromiseCapability;
|
|
2791
|
+
|
|
2792
|
+
var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
|
|
2793
|
+
var NATIVE_REJECTION_EVENT = isCallable(global$1.PromiseRejectionEvent);
|
|
2794
|
+
var UNHANDLED_REJECTION = 'unhandledrejection';
|
|
2795
|
+
var REJECTION_HANDLED = 'rejectionhandled';
|
|
2796
|
+
var PENDING = 0;
|
|
2797
|
+
var FULFILLED = 1;
|
|
2798
|
+
var REJECTED = 2;
|
|
2799
|
+
var HANDLED = 1;
|
|
2800
|
+
var UNHANDLED = 2;
|
|
2801
|
+
var SUBCLASSING = false;
|
|
2802
|
+
|
|
2803
|
+
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
|
2804
|
+
|
|
2805
|
+
var FORCED = isForced_1(PROMISE, function () {
|
|
2806
|
+
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
|
|
2807
|
+
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
|
|
2808
|
+
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
2809
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
2810
|
+
// We can't detect it synchronously, so just check versions
|
|
2811
|
+
if (!GLOBAL_CORE_JS_PROMISE && engineV8Version === 66) return true;
|
|
2812
|
+
// We can't use @@species feature detection in V8 since it causes
|
|
2813
|
+
// deoptimization and performance degradation
|
|
2814
|
+
// https://github.com/zloirock/core-js/issues/679
|
|
2815
|
+
if (engineV8Version >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
|
|
2816
|
+
// Detect correctness of subclassing with @@species support
|
|
2817
|
+
var promise = new PromiseConstructor(function (resolve) { resolve(1); });
|
|
2818
|
+
var FakePromise = function (exec) {
|
|
2819
|
+
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
2820
|
+
};
|
|
2821
|
+
var constructor = promise.constructor = {};
|
|
2822
|
+
constructor[SPECIES$1] = FakePromise;
|
|
2823
|
+
SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
|
|
2824
|
+
if (!SUBCLASSING) return true;
|
|
2825
|
+
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
2826
|
+
return !GLOBAL_CORE_JS_PROMISE && engineIsBrowser && !NATIVE_REJECTION_EVENT;
|
|
2827
|
+
});
|
|
2828
|
+
|
|
2829
|
+
var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
|
|
2830
|
+
PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
|
|
2831
|
+
});
|
|
2832
|
+
|
|
2833
|
+
// helpers
|
|
2834
|
+
var isThenable = function (it) {
|
|
2835
|
+
var then;
|
|
2836
|
+
return isObject(it) && isCallable(then = it.then) ? then : false;
|
|
2837
|
+
};
|
|
2838
|
+
|
|
2839
|
+
var notify = function (state, isReject) {
|
|
2840
|
+
if (state.notified) return;
|
|
2841
|
+
state.notified = true;
|
|
2842
|
+
var chain = state.reactions;
|
|
2843
|
+
microtask(function () {
|
|
2844
|
+
var value = state.value;
|
|
2845
|
+
var ok = state.state == FULFILLED;
|
|
2846
|
+
var index = 0;
|
|
2847
|
+
// variable length - can't use forEach
|
|
2848
|
+
while (chain.length > index) {
|
|
2849
|
+
var reaction = chain[index++];
|
|
2850
|
+
var handler = ok ? reaction.ok : reaction.fail;
|
|
2851
|
+
var resolve = reaction.resolve;
|
|
2852
|
+
var reject = reaction.reject;
|
|
2853
|
+
var domain = reaction.domain;
|
|
2854
|
+
var result, then, exited;
|
|
2855
|
+
try {
|
|
2856
|
+
if (handler) {
|
|
2857
|
+
if (!ok) {
|
|
2858
|
+
if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
|
2859
|
+
state.rejection = HANDLED;
|
|
2860
|
+
}
|
|
2861
|
+
if (handler === true) result = value;
|
|
2862
|
+
else {
|
|
2863
|
+
if (domain) domain.enter();
|
|
2864
|
+
result = handler(value); // can throw
|
|
2865
|
+
if (domain) {
|
|
2866
|
+
domain.exit();
|
|
2867
|
+
exited = true;
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
if (result === reaction.promise) {
|
|
2871
|
+
reject(TypeError$1('Promise-chain cycle'));
|
|
2872
|
+
} else if (then = isThenable(result)) {
|
|
2873
|
+
functionCall(then, result, resolve, reject);
|
|
2874
|
+
} else resolve(result);
|
|
2875
|
+
} else reject(value);
|
|
2876
|
+
} catch (error) {
|
|
2877
|
+
if (domain && !exited) domain.exit();
|
|
2878
|
+
reject(error);
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
state.reactions = [];
|
|
2882
|
+
state.notified = false;
|
|
2883
|
+
if (isReject && !state.rejection) onUnhandled(state);
|
|
2884
|
+
});
|
|
2885
|
+
};
|
|
2886
|
+
|
|
2887
|
+
var dispatchEvent = function (name, promise, reason) {
|
|
2888
|
+
var event, handler;
|
|
2889
|
+
if (DISPATCH_EVENT) {
|
|
2890
|
+
event = document$1.createEvent('Event');
|
|
2891
|
+
event.promise = promise;
|
|
2892
|
+
event.reason = reason;
|
|
2893
|
+
event.initEvent(name, false, true);
|
|
2894
|
+
global$1.dispatchEvent(event);
|
|
2895
|
+
} else event = { promise: promise, reason: reason };
|
|
2896
|
+
if (!NATIVE_REJECTION_EVENT && (handler = global$1['on' + name])) handler(event);
|
|
2897
|
+
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
|
2898
|
+
};
|
|
2899
|
+
|
|
2900
|
+
var onUnhandled = function (state) {
|
|
2901
|
+
functionCall(task, global$1, function () {
|
|
2902
|
+
var promise = state.facade;
|
|
2903
|
+
var value = state.value;
|
|
2904
|
+
var IS_UNHANDLED = isUnhandled(state);
|
|
2905
|
+
var result;
|
|
2906
|
+
if (IS_UNHANDLED) {
|
|
2907
|
+
result = perform(function () {
|
|
2908
|
+
if (engineIsNode) {
|
|
2909
|
+
process.emit('unhandledRejection', value, promise);
|
|
2910
|
+
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
|
2911
|
+
});
|
|
2912
|
+
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
|
2913
|
+
state.rejection = engineIsNode || isUnhandled(state) ? UNHANDLED : HANDLED;
|
|
2914
|
+
if (result.error) throw result.value;
|
|
2915
|
+
}
|
|
2916
|
+
});
|
|
2917
|
+
};
|
|
2918
|
+
|
|
2919
|
+
var isUnhandled = function (state) {
|
|
2920
|
+
return state.rejection !== HANDLED && !state.parent;
|
|
2921
|
+
};
|
|
2922
|
+
|
|
2923
|
+
var onHandleUnhandled = function (state) {
|
|
2924
|
+
functionCall(task, global$1, function () {
|
|
2925
|
+
var promise = state.facade;
|
|
2926
|
+
if (engineIsNode) {
|
|
2927
|
+
process.emit('rejectionHandled', promise);
|
|
2928
|
+
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
|
2929
|
+
});
|
|
2930
|
+
};
|
|
2931
|
+
|
|
2932
|
+
var bind = function (fn, state, unwrap) {
|
|
2933
|
+
return function (value) {
|
|
2934
|
+
fn(state, value, unwrap);
|
|
2935
|
+
};
|
|
2936
|
+
};
|
|
2937
|
+
|
|
2938
|
+
var internalReject = function (state, value, unwrap) {
|
|
2939
|
+
if (state.done) return;
|
|
2940
|
+
state.done = true;
|
|
2941
|
+
if (unwrap) state = unwrap;
|
|
2942
|
+
state.value = value;
|
|
2943
|
+
state.state = REJECTED;
|
|
2944
|
+
notify(state, true);
|
|
2945
|
+
};
|
|
2946
|
+
|
|
2947
|
+
var internalResolve = function (state, value, unwrap) {
|
|
2948
|
+
if (state.done) return;
|
|
2949
|
+
state.done = true;
|
|
2950
|
+
if (unwrap) state = unwrap;
|
|
2951
|
+
try {
|
|
2952
|
+
if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
|
|
2953
|
+
var then = isThenable(value);
|
|
2954
|
+
if (then) {
|
|
2955
|
+
microtask(function () {
|
|
2956
|
+
var wrapper = { done: false };
|
|
2957
|
+
try {
|
|
2958
|
+
functionCall(then, value,
|
|
2959
|
+
bind(internalResolve, wrapper, state),
|
|
2960
|
+
bind(internalReject, wrapper, state)
|
|
2961
|
+
);
|
|
2962
|
+
} catch (error) {
|
|
2963
|
+
internalReject(wrapper, error, state);
|
|
2964
|
+
}
|
|
2965
|
+
});
|
|
2966
|
+
} else {
|
|
2967
|
+
state.value = value;
|
|
2968
|
+
state.state = FULFILLED;
|
|
2969
|
+
notify(state, false);
|
|
2970
|
+
}
|
|
2971
|
+
} catch (error) {
|
|
2972
|
+
internalReject({ done: false }, error, state);
|
|
2973
|
+
}
|
|
2974
|
+
};
|
|
2975
|
+
|
|
2976
|
+
// constructor polyfill
|
|
2977
|
+
if (FORCED) {
|
|
2978
|
+
// 25.4.3.1 Promise(executor)
|
|
2979
|
+
PromiseConstructor = function Promise(executor) {
|
|
2980
|
+
anInstance(this, PromisePrototype);
|
|
2981
|
+
aCallable(executor);
|
|
2982
|
+
functionCall(Internal, this);
|
|
2983
|
+
var state = getInternalState$2(this);
|
|
2984
|
+
try {
|
|
2985
|
+
executor(bind(internalResolve, state), bind(internalReject, state));
|
|
2986
|
+
} catch (error) {
|
|
2987
|
+
internalReject(state, error);
|
|
2988
|
+
}
|
|
2989
|
+
};
|
|
2990
|
+
PromisePrototype = PromiseConstructor.prototype;
|
|
2991
|
+
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
2992
|
+
Internal = function Promise(executor) {
|
|
2993
|
+
setInternalState$3(this, {
|
|
2994
|
+
type: PROMISE,
|
|
2995
|
+
done: false,
|
|
2996
|
+
notified: false,
|
|
2997
|
+
parent: false,
|
|
2998
|
+
reactions: [],
|
|
2999
|
+
rejection: false,
|
|
3000
|
+
state: PENDING,
|
|
3001
|
+
value: undefined
|
|
3002
|
+
});
|
|
3003
|
+
};
|
|
3004
|
+
Internal.prototype = redefineAll(PromisePrototype, {
|
|
3005
|
+
// `Promise.prototype.then` method
|
|
3006
|
+
// https://tc39.es/ecma262/#sec-promise.prototype.then
|
|
3007
|
+
then: function then(onFulfilled, onRejected) {
|
|
3008
|
+
var state = getInternalPromiseState(this);
|
|
3009
|
+
var reactions = state.reactions;
|
|
3010
|
+
var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
|
3011
|
+
reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
|
|
3012
|
+
reaction.fail = isCallable(onRejected) && onRejected;
|
|
3013
|
+
reaction.domain = engineIsNode ? process.domain : undefined;
|
|
3014
|
+
state.parent = true;
|
|
3015
|
+
reactions[reactions.length] = reaction;
|
|
3016
|
+
if (state.state != PENDING) notify(state, false);
|
|
3017
|
+
return reaction.promise;
|
|
3018
|
+
},
|
|
3019
|
+
// `Promise.prototype.catch` method
|
|
3020
|
+
// https://tc39.es/ecma262/#sec-promise.prototype.catch
|
|
3021
|
+
'catch': function (onRejected) {
|
|
3022
|
+
return this.then(undefined, onRejected);
|
|
3023
|
+
}
|
|
3024
|
+
});
|
|
3025
|
+
OwnPromiseCapability = function () {
|
|
3026
|
+
var promise = new Internal();
|
|
3027
|
+
var state = getInternalState$2(promise);
|
|
3028
|
+
this.promise = promise;
|
|
3029
|
+
this.resolve = bind(internalResolve, state);
|
|
3030
|
+
this.reject = bind(internalReject, state);
|
|
3031
|
+
};
|
|
3032
|
+
newPromiseCapability$1.f = newPromiseCapability = function (C) {
|
|
3033
|
+
return C === PromiseConstructor || C === PromiseWrapper
|
|
3034
|
+
? new OwnPromiseCapability(C)
|
|
3035
|
+
: newGenericPromiseCapability(C);
|
|
3036
|
+
};
|
|
3037
|
+
|
|
3038
|
+
if (isCallable(nativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
|
|
3039
|
+
nativeThen = NativePromisePrototype.then;
|
|
3040
|
+
|
|
3041
|
+
if (!SUBCLASSING) {
|
|
3042
|
+
// make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
|
|
3043
|
+
redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
|
3044
|
+
var that = this;
|
|
3045
|
+
return new PromiseConstructor(function (resolve, reject) {
|
|
3046
|
+
functionCall(nativeThen, that, resolve, reject);
|
|
3047
|
+
}).then(onFulfilled, onRejected);
|
|
3048
|
+
// https://github.com/zloirock/core-js/issues/640
|
|
3049
|
+
}, { unsafe: true });
|
|
3050
|
+
|
|
3051
|
+
// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
|
|
3052
|
+
redefine(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
// make `.constructor === Promise` work for native promise-based APIs
|
|
3056
|
+
try {
|
|
3057
|
+
delete NativePromisePrototype.constructor;
|
|
3058
|
+
} catch (error) { /* empty */ }
|
|
3059
|
+
|
|
3060
|
+
// make `instanceof Promise` work for native promise-based APIs
|
|
3061
|
+
if (objectSetPrototypeOf) {
|
|
3062
|
+
objectSetPrototypeOf(NativePromisePrototype, PromisePrototype);
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
_export({ global: true, wrap: true, forced: FORCED }, {
|
|
3068
|
+
Promise: PromiseConstructor
|
|
3069
|
+
});
|
|
3070
|
+
|
|
3071
|
+
setToStringTag(PromiseConstructor, PROMISE, false);
|
|
3072
|
+
setSpecies(PROMISE);
|
|
3073
|
+
|
|
3074
|
+
PromiseWrapper = getBuiltIn(PROMISE);
|
|
3075
|
+
|
|
3076
|
+
// statics
|
|
3077
|
+
_export({ target: PROMISE, stat: true, forced: FORCED }, {
|
|
3078
|
+
// `Promise.reject` method
|
|
3079
|
+
// https://tc39.es/ecma262/#sec-promise.reject
|
|
3080
|
+
reject: function reject(r) {
|
|
3081
|
+
var capability = newPromiseCapability(this);
|
|
3082
|
+
functionCall(capability.reject, undefined, r);
|
|
3083
|
+
return capability.promise;
|
|
3084
|
+
}
|
|
3085
|
+
});
|
|
3086
|
+
|
|
3087
|
+
_export({ target: PROMISE, stat: true, forced: FORCED }, {
|
|
3088
|
+
// `Promise.resolve` method
|
|
3089
|
+
// https://tc39.es/ecma262/#sec-promise.resolve
|
|
3090
|
+
resolve: function resolve(x) {
|
|
3091
|
+
return promiseResolve(this, x);
|
|
3092
|
+
}
|
|
3093
|
+
});
|
|
3094
|
+
|
|
3095
|
+
_export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
|
|
3096
|
+
// `Promise.all` method
|
|
3097
|
+
// https://tc39.es/ecma262/#sec-promise.all
|
|
3098
|
+
all: function all(iterable) {
|
|
3099
|
+
var C = this;
|
|
3100
|
+
var capability = newPromiseCapability(C);
|
|
3101
|
+
var resolve = capability.resolve;
|
|
3102
|
+
var reject = capability.reject;
|
|
3103
|
+
var result = perform(function () {
|
|
3104
|
+
var $promiseResolve = aCallable(C.resolve);
|
|
3105
|
+
var values = [];
|
|
3106
|
+
var counter = 0;
|
|
3107
|
+
var remaining = 1;
|
|
3108
|
+
iterate(iterable, function (promise) {
|
|
3109
|
+
var index = counter++;
|
|
3110
|
+
var alreadyCalled = false;
|
|
3111
|
+
remaining++;
|
|
3112
|
+
functionCall($promiseResolve, C, promise).then(function (value) {
|
|
3113
|
+
if (alreadyCalled) return;
|
|
3114
|
+
alreadyCalled = true;
|
|
3115
|
+
values[index] = value;
|
|
3116
|
+
--remaining || resolve(values);
|
|
3117
|
+
}, reject);
|
|
3118
|
+
});
|
|
3119
|
+
--remaining || resolve(values);
|
|
3120
|
+
});
|
|
3121
|
+
if (result.error) reject(result.value);
|
|
3122
|
+
return capability.promise;
|
|
3123
|
+
},
|
|
3124
|
+
// `Promise.race` method
|
|
3125
|
+
// https://tc39.es/ecma262/#sec-promise.race
|
|
3126
|
+
race: function race(iterable) {
|
|
3127
|
+
var C = this;
|
|
3128
|
+
var capability = newPromiseCapability(C);
|
|
3129
|
+
var reject = capability.reject;
|
|
3130
|
+
var result = perform(function () {
|
|
3131
|
+
var $promiseResolve = aCallable(C.resolve);
|
|
3132
|
+
iterate(iterable, function (promise) {
|
|
3133
|
+
functionCall($promiseResolve, C, promise).then(capability.resolve, reject);
|
|
3134
|
+
});
|
|
3135
|
+
});
|
|
3136
|
+
if (result.error) reject(result.value);
|
|
3137
|
+
return capability.promise;
|
|
3138
|
+
}
|
|
3139
|
+
});
|
|
3140
|
+
|
|
3141
|
+
function insertVideo (editor, src, poster) {
|
|
3142
|
+
if (poster === void 0) {
|
|
3143
|
+
poster = '';
|
|
3144
|
+
}
|
|
3145
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3146
|
+
var _a, onInsertedVideo, checkVideo, parseVideoSrc, checkRes, parsedSrc, video;
|
|
3147
|
+
return __generator(this, function (_b) {
|
|
3148
|
+
switch (_b.label) {
|
|
3149
|
+
case 0:
|
|
3150
|
+
if (!src) return [2
|
|
3151
|
+
];
|
|
3152
|
+
editor.restoreSelection();
|
|
3153
|
+
_a = editor.getMenuConfig('insertVideo'), onInsertedVideo = _a.onInsertedVideo, checkVideo = _a.checkVideo, parseVideoSrc = _a.parseVideoSrc;
|
|
3154
|
+
return [4
|
|
3155
|
+
, checkVideo(src, poster)];
|
|
3156
|
+
case 1:
|
|
3157
|
+
checkRes = _b.sent();
|
|
3158
|
+
if (typeof checkRes === 'string') {
|
|
3159
|
+
editor.alert(checkRes, 'error');
|
|
3160
|
+
return [2
|
|
3161
|
+
];
|
|
3162
|
+
}
|
|
3163
|
+
if (checkRes == null) {
|
|
3164
|
+
return [2
|
|
3165
|
+
];
|
|
3166
|
+
}
|
|
3167
|
+
return [4
|
|
3168
|
+
, parseVideoSrc(src)];
|
|
3169
|
+
case 2:
|
|
3170
|
+
parsedSrc = _b.sent();
|
|
3171
|
+
if (parsedSrc.trim().indexOf('<iframe ') !== 0) {
|
|
3172
|
+
parsedSrc = replaceSymbols(parsedSrc);
|
|
3173
|
+
}
|
|
3174
|
+
video = {
|
|
3175
|
+
type: 'video',
|
|
3176
|
+
src: parsedSrc,
|
|
3177
|
+
poster: poster,
|
|
3178
|
+
children: [{
|
|
3179
|
+
text: ''
|
|
3180
|
+
}]
|
|
3181
|
+
};
|
|
3182
|
+
Promise.resolve().then(function () {
|
|
3183
|
+
Transforms.insertNodes(editor, video);
|
|
3184
|
+
});
|
|
3185
|
+
onInsertedVideo(video);
|
|
3186
|
+
return [2
|
|
3187
|
+
];
|
|
3188
|
+
}
|
|
3189
|
+
});
|
|
3190
|
+
});
|
|
3191
|
+
}
|
|
3192
|
+
|
|
3193
|
+
function genDomID$1() {
|
|
3194
|
+
return genRandomStr('w-e-insert-video');
|
|
3195
|
+
}
|
|
3196
|
+
var InsertVideoMenu =
|
|
3197
|
+
function () {
|
|
3198
|
+
function InsertVideoMenu() {
|
|
3199
|
+
this.title = t('videoModule.insertVideo');
|
|
3200
|
+
this.iconSvg = VIDEO_SVG;
|
|
3201
|
+
this.tag = 'button';
|
|
3202
|
+
this.showModal = true;
|
|
3203
|
+
this.modalWidth = 320;
|
|
3204
|
+
this.$content = null;
|
|
3205
|
+
this.srcInputId = genDomID$1();
|
|
3206
|
+
this.posterInputId = genDomID$1();
|
|
3207
|
+
this.buttonId = genDomID$1();
|
|
3208
|
+
}
|
|
3209
|
+
InsertVideoMenu.prototype.getValue = function (editor) {
|
|
3210
|
+
return '';
|
|
3211
|
+
};
|
|
3212
|
+
InsertVideoMenu.prototype.isActive = function (editor) {
|
|
3213
|
+
return false;
|
|
3214
|
+
};
|
|
3215
|
+
InsertVideoMenu.prototype.exec = function (editor, value) {
|
|
3216
|
+
};
|
|
3217
|
+
InsertVideoMenu.prototype.isDisabled = function (editor) {
|
|
3218
|
+
var selection = editor.selection;
|
|
3219
|
+
if (selection == null) return true;
|
|
3220
|
+
if (!Range.isCollapsed(selection)) return true;
|
|
3221
|
+
var selectedElems = DomEditor.getSelectedElems(editor);
|
|
3222
|
+
var hasVoidOrPre = selectedElems.some(function (elem) {
|
|
3223
|
+
var type = DomEditor.getNodeType(elem);
|
|
3224
|
+
if (type === 'pre') return true;
|
|
3225
|
+
if (type === 'list-item') return true;
|
|
3226
|
+
if (editor.isVoid(elem)) return true;
|
|
3227
|
+
return false;
|
|
3228
|
+
});
|
|
3229
|
+
if (hasVoidOrPre) return true;
|
|
3230
|
+
return false;
|
|
3231
|
+
};
|
|
3232
|
+
InsertVideoMenu.prototype.getModalPositionNode = function (editor) {
|
|
3233
|
+
return null;
|
|
3234
|
+
};
|
|
3235
|
+
InsertVideoMenu.prototype.getModalContentElem = function (editor) {
|
|
3236
|
+
var _this = this;
|
|
3237
|
+
var _a = this,
|
|
3238
|
+
srcInputId = _a.srcInputId,
|
|
3239
|
+
posterInputId = _a.posterInputId,
|
|
3240
|
+
buttonId = _a.buttonId;
|
|
3241
|
+
var _b = __read(genModalInputElems(t('videoModule.videoSrc'), srcInputId, t('videoModule.videoSrcPlaceHolder')), 2),
|
|
3242
|
+
srcContainerElem = _b[0],
|
|
3243
|
+
inputSrcElem = _b[1];
|
|
3244
|
+
var _c = __read(genModalInputElems(t('videoModule.videoPoster'), posterInputId, t('videoModule.videoPosterPlaceHolder')), 2),
|
|
3245
|
+
posterContainerElem = _c[0],
|
|
3246
|
+
inputPosterElem = _c[1];
|
|
3247
|
+
var $inputSrc = $(inputSrcElem);
|
|
3248
|
+
var $inputPoster = $(inputPosterElem);
|
|
3249
|
+
var _d = __read(genModalButtonElems(buttonId, t('videoModule.ok')), 1),
|
|
3250
|
+
buttonContainerElem = _d[0];
|
|
3251
|
+
if (this.$content == null) {
|
|
3252
|
+
var $content_1 = $('<div></div>');
|
|
3253
|
+
$content_1.on('click', "#" + buttonId, function (e) {
|
|
3254
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
3255
|
+
var src, poster;
|
|
3256
|
+
return __generator(this, function (_a) {
|
|
3257
|
+
switch (_a.label) {
|
|
3258
|
+
case 0:
|
|
3259
|
+
e.preventDefault();
|
|
3260
|
+
src = $content_1.find("#" + srcInputId).val().trim();
|
|
3261
|
+
poster = $content_1.find("#" + posterInputId).val().trim();
|
|
3262
|
+
return [4
|
|
3263
|
+
, insertVideo(editor, src, poster)];
|
|
3264
|
+
case 1:
|
|
3265
|
+
_a.sent();
|
|
3266
|
+
editor.hidePanelOrModal();
|
|
3267
|
+
return [2
|
|
3268
|
+
];
|
|
3269
|
+
}
|
|
3270
|
+
});
|
|
3271
|
+
});
|
|
3272
|
+
});
|
|
3273
|
+
this.$content = $content_1;
|
|
3274
|
+
}
|
|
3275
|
+
var $content = this.$content;
|
|
3276
|
+
$content.empty();
|
|
3277
|
+
$content.append(srcContainerElem);
|
|
3278
|
+
$content.append(posterContainerElem);
|
|
3279
|
+
$content.append(buttonContainerElem);
|
|
3280
|
+
$inputSrc.val('');
|
|
3281
|
+
$inputPoster.val('');
|
|
3282
|
+
setTimeout(function () {
|
|
3283
|
+
$inputSrc.focus();
|
|
3284
|
+
});
|
|
3285
|
+
return $content[0];
|
|
3286
|
+
};
|
|
3287
|
+
return InsertVideoMenu;
|
|
3288
|
+
}();
|
|
3289
|
+
|
|
3290
|
+
var correctPrototypeGetter = !fails(function () {
|
|
3291
|
+
function F() { /* empty */ }
|
|
3292
|
+
F.prototype.constructor = null;
|
|
3293
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
3294
|
+
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
3295
|
+
});
|
|
3296
|
+
|
|
3297
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
|
3298
|
+
var Object$1 = global$1.Object;
|
|
3299
|
+
var ObjectPrototype = Object$1.prototype;
|
|
3300
|
+
|
|
3301
|
+
// `Object.getPrototypeOf` method
|
|
3302
|
+
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
3303
|
+
var objectGetPrototypeOf = correctPrototypeGetter ? Object$1.getPrototypeOf : function (O) {
|
|
3304
|
+
var object = toObject(O);
|
|
3305
|
+
if (hasOwnProperty_1(object, IE_PROTO)) return object[IE_PROTO];
|
|
3306
|
+
var constructor = object.constructor;
|
|
3307
|
+
if (isCallable(constructor) && object instanceof constructor) {
|
|
3308
|
+
return constructor.prototype;
|
|
3309
|
+
} return object instanceof Object$1 ? ObjectPrototype : null;
|
|
3310
|
+
};
|
|
3311
|
+
|
|
3312
|
+
var ITERATOR$2 = wellKnownSymbol('iterator');
|
|
3313
|
+
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
3314
|
+
|
|
3315
|
+
// `%IteratorPrototype%` object
|
|
3316
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
3317
|
+
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
3318
|
+
|
|
3319
|
+
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
3320
|
+
if ([].keys) {
|
|
3321
|
+
arrayIterator = [].keys();
|
|
3322
|
+
// Safari 8 has buggy iterators w/o `next`
|
|
3323
|
+
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
|
3324
|
+
else {
|
|
3325
|
+
PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
|
|
3326
|
+
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
|
|
3327
|
+
}
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails(function () {
|
|
3331
|
+
var test = {};
|
|
3332
|
+
// FF44- legacy iterators case
|
|
3333
|
+
return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
|
3334
|
+
});
|
|
3335
|
+
|
|
3336
|
+
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
3337
|
+
|
|
3338
|
+
// `%IteratorPrototype%[@@iterator]()` method
|
|
3339
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
3340
|
+
if (!isCallable(IteratorPrototype$2[ITERATOR$2])) {
|
|
3341
|
+
redefine(IteratorPrototype$2, ITERATOR$2, function () {
|
|
3342
|
+
return this;
|
|
3343
|
+
});
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
var iteratorsCore = {
|
|
3347
|
+
IteratorPrototype: IteratorPrototype$2,
|
|
3348
|
+
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
|
3349
|
+
};
|
|
3350
|
+
|
|
3351
|
+
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
3352
|
+
|
|
3353
|
+
|
|
3354
|
+
|
|
3355
|
+
|
|
3356
|
+
|
|
3357
|
+
var returnThis$1 = function () { return this; };
|
|
3358
|
+
|
|
3359
|
+
var createIteratorConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
3360
|
+
var TO_STRING_TAG = NAME + ' Iterator';
|
|
3361
|
+
IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
3362
|
+
setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
|
|
3363
|
+
iterators[TO_STRING_TAG] = returnThis$1;
|
|
3364
|
+
return IteratorConstructor;
|
|
3365
|
+
};
|
|
3366
|
+
|
|
3367
|
+
var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
|
|
3368
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
3369
|
+
var IteratorPrototype = iteratorsCore.IteratorPrototype;
|
|
3370
|
+
var BUGGY_SAFARI_ITERATORS = iteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
3371
|
+
var ITERATOR$1 = wellKnownSymbol('iterator');
|
|
3372
|
+
var KEYS = 'keys';
|
|
3373
|
+
var VALUES = 'values';
|
|
3374
|
+
var ENTRIES = 'entries';
|
|
3375
|
+
|
|
3376
|
+
var returnThis = function () { return this; };
|
|
3377
|
+
|
|
3378
|
+
var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
|
3379
|
+
createIteratorConstructor(IteratorConstructor, NAME, next);
|
|
3380
|
+
|
|
3381
|
+
var getIterationMethod = function (KIND) {
|
|
3382
|
+
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
|
3383
|
+
if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
|
3384
|
+
switch (KIND) {
|
|
3385
|
+
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
|
3386
|
+
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
|
3387
|
+
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
|
3388
|
+
} return function () { return new IteratorConstructor(this); };
|
|
3389
|
+
};
|
|
3390
|
+
|
|
3391
|
+
var TO_STRING_TAG = NAME + ' Iterator';
|
|
3392
|
+
var INCORRECT_VALUES_NAME = false;
|
|
3393
|
+
var IterablePrototype = Iterable.prototype;
|
|
3394
|
+
var nativeIterator = IterablePrototype[ITERATOR$1]
|
|
3395
|
+
|| IterablePrototype['@@iterator']
|
|
3396
|
+
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
3397
|
+
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
3398
|
+
var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
|
3399
|
+
var CurrentIteratorPrototype, methods, KEY;
|
|
3400
|
+
|
|
3401
|
+
// fix native
|
|
3402
|
+
if (anyNativeIterator) {
|
|
3403
|
+
CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
|
|
3404
|
+
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
|
3405
|
+
if (objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
3406
|
+
if (objectSetPrototypeOf) {
|
|
3407
|
+
objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
3408
|
+
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
3409
|
+
redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3412
|
+
// Set @@toStringTag to native iterators
|
|
3413
|
+
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
|
|
3417
|
+
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
3418
|
+
if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
3419
|
+
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
3420
|
+
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
|
3421
|
+
} else {
|
|
3422
|
+
INCORRECT_VALUES_NAME = true;
|
|
3423
|
+
defaultIterator = function values() { return functionCall(nativeIterator, this); };
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3427
|
+
// export additional methods
|
|
3428
|
+
if (DEFAULT) {
|
|
3429
|
+
methods = {
|
|
3430
|
+
values: getIterationMethod(VALUES),
|
|
3431
|
+
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
|
3432
|
+
entries: getIterationMethod(ENTRIES)
|
|
3433
|
+
};
|
|
3434
|
+
if (FORCED) for (KEY in methods) {
|
|
3435
|
+
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
3436
|
+
redefine(IterablePrototype, KEY, methods[KEY]);
|
|
3437
|
+
}
|
|
3438
|
+
} else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
3439
|
+
}
|
|
3440
|
+
|
|
3441
|
+
// define iterator
|
|
3442
|
+
if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
|
3443
|
+
redefine(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
|
|
3444
|
+
}
|
|
3445
|
+
iterators[NAME] = defaultIterator;
|
|
3446
|
+
|
|
3447
|
+
return methods;
|
|
3448
|
+
};
|
|
3449
|
+
|
|
3450
|
+
var ARRAY_ITERATOR = 'Array Iterator';
|
|
3451
|
+
var setInternalState$2 = internalState.set;
|
|
3452
|
+
var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
|
|
3453
|
+
|
|
3454
|
+
// `Array.prototype.entries` method
|
|
3455
|
+
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
3456
|
+
// `Array.prototype.keys` method
|
|
3457
|
+
// https://tc39.es/ecma262/#sec-array.prototype.keys
|
|
3458
|
+
// `Array.prototype.values` method
|
|
3459
|
+
// https://tc39.es/ecma262/#sec-array.prototype.values
|
|
3460
|
+
// `Array.prototype[@@iterator]` method
|
|
3461
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
|
|
3462
|
+
// `CreateArrayIterator` internal method
|
|
3463
|
+
// https://tc39.es/ecma262/#sec-createarrayiterator
|
|
3464
|
+
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
|
3465
|
+
setInternalState$2(this, {
|
|
3466
|
+
type: ARRAY_ITERATOR,
|
|
3467
|
+
target: toIndexedObject(iterated), // target
|
|
3468
|
+
index: 0, // next index
|
|
3469
|
+
kind: kind // kind
|
|
3470
|
+
});
|
|
3471
|
+
// `%ArrayIteratorPrototype%.next` method
|
|
3472
|
+
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
3473
|
+
}, function () {
|
|
3474
|
+
var state = getInternalState$1(this);
|
|
3475
|
+
var target = state.target;
|
|
3476
|
+
var kind = state.kind;
|
|
3477
|
+
var index = state.index++;
|
|
3478
|
+
if (!target || index >= target.length) {
|
|
3479
|
+
state.target = undefined;
|
|
3480
|
+
return { value: undefined, done: true };
|
|
3481
|
+
}
|
|
3482
|
+
if (kind == 'keys') return { value: index, done: false };
|
|
3483
|
+
if (kind == 'values') return { value: target[index], done: false };
|
|
3484
|
+
return { value: [index, target[index]], done: false };
|
|
3485
|
+
}, 'values');
|
|
3486
|
+
|
|
3487
|
+
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
3488
|
+
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
|
3489
|
+
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
|
3490
|
+
iterators.Arguments = iterators.Array;
|
|
3491
|
+
|
|
3492
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
3493
|
+
addToUnscopables('keys');
|
|
3494
|
+
addToUnscopables('values');
|
|
3495
|
+
addToUnscopables('entries');
|
|
3496
|
+
|
|
3497
|
+
var charAt = stringMultibyte.charAt;
|
|
3498
|
+
|
|
3499
|
+
|
|
3500
|
+
|
|
3501
|
+
|
|
3502
|
+
var STRING_ITERATOR = 'String Iterator';
|
|
3503
|
+
var setInternalState$1 = internalState.set;
|
|
3504
|
+
var getInternalState = internalState.getterFor(STRING_ITERATOR);
|
|
3505
|
+
|
|
3506
|
+
// `String.prototype[@@iterator]` method
|
|
3507
|
+
// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
|
|
3508
|
+
defineIterator(String, 'String', function (iterated) {
|
|
3509
|
+
setInternalState$1(this, {
|
|
3510
|
+
type: STRING_ITERATOR,
|
|
3511
|
+
string: toString(iterated),
|
|
3512
|
+
index: 0
|
|
3513
|
+
});
|
|
3514
|
+
// `%StringIteratorPrototype%.next` method
|
|
3515
|
+
// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
|
|
3516
|
+
}, function next() {
|
|
3517
|
+
var state = getInternalState(this);
|
|
3518
|
+
var string = state.string;
|
|
3519
|
+
var index = state.index;
|
|
3520
|
+
var point;
|
|
3521
|
+
if (index >= string.length) return { value: undefined, done: true };
|
|
3522
|
+
point = charAt(string, index);
|
|
3523
|
+
state.index += point.length;
|
|
3524
|
+
return { value: point, done: false };
|
|
3525
|
+
});
|
|
3526
|
+
|
|
3527
|
+
var createProperty = function (object, key, value) {
|
|
3528
|
+
var propertyKey = toPropertyKey(key);
|
|
3529
|
+
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
|
3530
|
+
else object[propertyKey] = value;
|
|
3531
|
+
};
|
|
3532
|
+
|
|
3533
|
+
var Array$2 = global$1.Array;
|
|
3534
|
+
var max$1 = Math.max;
|
|
3535
|
+
|
|
3536
|
+
var arraySliceSimple = function (O, start, end) {
|
|
3537
|
+
var length = lengthOfArrayLike(O);
|
|
3538
|
+
var k = toAbsoluteIndex(start, length);
|
|
3539
|
+
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
|
3540
|
+
var result = Array$2(max$1(fin - k, 0));
|
|
3541
|
+
for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
|
|
3542
|
+
result.length = n;
|
|
3543
|
+
return result;
|
|
3544
|
+
};
|
|
3545
|
+
|
|
3546
|
+
/* eslint-disable es/no-object-getownpropertynames -- safe */
|
|
3547
|
+
|
|
3548
|
+
var $getOwnPropertyNames = objectGetOwnPropertyNames.f;
|
|
3549
|
+
|
|
3550
|
+
|
|
3551
|
+
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
|
3552
|
+
? Object.getOwnPropertyNames(window) : [];
|
|
3553
|
+
|
|
3554
|
+
var getWindowNames = function (it) {
|
|
3555
|
+
try {
|
|
3556
|
+
return $getOwnPropertyNames(it);
|
|
3557
|
+
} catch (error) {
|
|
3558
|
+
return arraySliceSimple(windowNames);
|
|
3559
|
+
}
|
|
3560
|
+
};
|
|
3561
|
+
|
|
3562
|
+
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
|
|
3563
|
+
var f = function getOwnPropertyNames(it) {
|
|
3564
|
+
return windowNames && classofRaw(it) == 'Window'
|
|
3565
|
+
? getWindowNames(it)
|
|
3566
|
+
: $getOwnPropertyNames(toIndexedObject(it));
|
|
3567
|
+
};
|
|
3568
|
+
|
|
3569
|
+
var objectGetOwnPropertyNamesExternal = {
|
|
3570
|
+
f: f
|
|
3571
|
+
};
|
|
3572
|
+
|
|
3573
|
+
// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
|
|
3574
|
+
|
|
3575
|
+
|
|
3576
|
+
var arrayBufferNonExtensible = fails(function () {
|
|
3577
|
+
if (typeof ArrayBuffer == 'function') {
|
|
3578
|
+
var buffer = new ArrayBuffer(8);
|
|
3579
|
+
// eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
|
|
3580
|
+
if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
|
|
3581
|
+
}
|
|
3582
|
+
});
|
|
3583
|
+
|
|
3584
|
+
// eslint-disable-next-line es/no-object-isextensible -- safe
|
|
3585
|
+
var $isExtensible = Object.isExtensible;
|
|
3586
|
+
var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
|
|
3587
|
+
|
|
3588
|
+
// `Object.isExtensible` method
|
|
3589
|
+
// https://tc39.es/ecma262/#sec-object.isextensible
|
|
3590
|
+
var objectIsExtensible = (FAILS_ON_PRIMITIVES || arrayBufferNonExtensible) ? function isExtensible(it) {
|
|
3591
|
+
if (!isObject(it)) return false;
|
|
3592
|
+
if (arrayBufferNonExtensible && classofRaw(it) == 'ArrayBuffer') return false;
|
|
3593
|
+
return $isExtensible ? $isExtensible(it) : true;
|
|
3594
|
+
} : $isExtensible;
|
|
3595
|
+
|
|
3596
|
+
var freezing = !fails(function () {
|
|
3597
|
+
// eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
|
|
3598
|
+
return Object.isExtensible(Object.preventExtensions({}));
|
|
3599
|
+
});
|
|
3600
|
+
|
|
3601
|
+
var internalMetadata = createCommonjsModule(function (module) {
|
|
3602
|
+
var defineProperty = objectDefineProperty.f;
|
|
3603
|
+
|
|
3604
|
+
|
|
3605
|
+
|
|
3606
|
+
|
|
3607
|
+
|
|
3608
|
+
|
|
3609
|
+
var REQUIRED = false;
|
|
3610
|
+
var METADATA = uid('meta');
|
|
3611
|
+
var id = 0;
|
|
3612
|
+
|
|
3613
|
+
var setMetadata = function (it) {
|
|
3614
|
+
defineProperty(it, METADATA, { value: {
|
|
3615
|
+
objectID: 'O' + id++, // object ID
|
|
3616
|
+
weakData: {} // weak collections IDs
|
|
3617
|
+
} });
|
|
3618
|
+
};
|
|
3619
|
+
|
|
3620
|
+
var fastKey = function (it, create) {
|
|
3621
|
+
// return a primitive with prefix
|
|
3622
|
+
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
|
3623
|
+
if (!hasOwnProperty_1(it, METADATA)) {
|
|
3624
|
+
// can't set metadata to uncaught frozen object
|
|
3625
|
+
if (!objectIsExtensible(it)) return 'F';
|
|
3626
|
+
// not necessary to add metadata
|
|
3627
|
+
if (!create) return 'E';
|
|
3628
|
+
// add missing metadata
|
|
3629
|
+
setMetadata(it);
|
|
3630
|
+
// return object ID
|
|
3631
|
+
} return it[METADATA].objectID;
|
|
3632
|
+
};
|
|
3633
|
+
|
|
3634
|
+
var getWeakData = function (it, create) {
|
|
3635
|
+
if (!hasOwnProperty_1(it, METADATA)) {
|
|
3636
|
+
// can't set metadata to uncaught frozen object
|
|
3637
|
+
if (!objectIsExtensible(it)) return true;
|
|
3638
|
+
// not necessary to add metadata
|
|
3639
|
+
if (!create) return false;
|
|
3640
|
+
// add missing metadata
|
|
3641
|
+
setMetadata(it);
|
|
3642
|
+
// return the store of weak collections IDs
|
|
3643
|
+
} return it[METADATA].weakData;
|
|
3644
|
+
};
|
|
3645
|
+
|
|
3646
|
+
// add metadata on freeze-family methods calling
|
|
3647
|
+
var onFreeze = function (it) {
|
|
3648
|
+
if (freezing && REQUIRED && objectIsExtensible(it) && !hasOwnProperty_1(it, METADATA)) setMetadata(it);
|
|
3649
|
+
return it;
|
|
3650
|
+
};
|
|
3651
|
+
|
|
3652
|
+
var enable = function () {
|
|
3653
|
+
meta.enable = function () { /* empty */ };
|
|
3654
|
+
REQUIRED = true;
|
|
3655
|
+
var getOwnPropertyNames = objectGetOwnPropertyNames.f;
|
|
3656
|
+
var splice = functionUncurryThis([].splice);
|
|
3657
|
+
var test = {};
|
|
3658
|
+
test[METADATA] = 1;
|
|
3659
|
+
|
|
3660
|
+
// prevent exposing of metadata key
|
|
3661
|
+
if (getOwnPropertyNames(test).length) {
|
|
3662
|
+
objectGetOwnPropertyNames.f = function (it) {
|
|
3663
|
+
var result = getOwnPropertyNames(it);
|
|
3664
|
+
for (var i = 0, length = result.length; i < length; i++) {
|
|
3665
|
+
if (result[i] === METADATA) {
|
|
3666
|
+
splice(result, i, 1);
|
|
3667
|
+
break;
|
|
3668
|
+
}
|
|
3669
|
+
} return result;
|
|
3670
|
+
};
|
|
3671
|
+
|
|
3672
|
+
_export({ target: 'Object', stat: true, forced: true }, {
|
|
3673
|
+
getOwnPropertyNames: objectGetOwnPropertyNamesExternal.f
|
|
3674
|
+
});
|
|
3675
|
+
}
|
|
3676
|
+
};
|
|
3677
|
+
|
|
3678
|
+
var meta = module.exports = {
|
|
3679
|
+
enable: enable,
|
|
3680
|
+
fastKey: fastKey,
|
|
3681
|
+
getWeakData: getWeakData,
|
|
3682
|
+
onFreeze: onFreeze
|
|
3683
|
+
};
|
|
3684
|
+
|
|
3685
|
+
hiddenKeys$1[METADATA] = true;
|
|
3686
|
+
});
|
|
3687
|
+
|
|
3688
|
+
// makes subclassing work correct for wrapped built-ins
|
|
3689
|
+
var inheritIfRequired = function ($this, dummy, Wrapper) {
|
|
3690
|
+
var NewTarget, NewTargetPrototype;
|
|
3691
|
+
if (
|
|
3692
|
+
// it can work only with native `setPrototypeOf`
|
|
3693
|
+
objectSetPrototypeOf &&
|
|
3694
|
+
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
|
|
3695
|
+
isCallable(NewTarget = dummy.constructor) &&
|
|
3696
|
+
NewTarget !== Wrapper &&
|
|
3697
|
+
isObject(NewTargetPrototype = NewTarget.prototype) &&
|
|
3698
|
+
NewTargetPrototype !== Wrapper.prototype
|
|
3699
|
+
) objectSetPrototypeOf($this, NewTargetPrototype);
|
|
3700
|
+
return $this;
|
|
3701
|
+
};
|
|
3702
|
+
|
|
3703
|
+
var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
|
|
3704
|
+
var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
|
3705
|
+
var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
|
3706
|
+
var ADDER = IS_MAP ? 'set' : 'add';
|
|
3707
|
+
var NativeConstructor = global$1[CONSTRUCTOR_NAME];
|
|
3708
|
+
var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
|
3709
|
+
var Constructor = NativeConstructor;
|
|
3710
|
+
var exported = {};
|
|
3711
|
+
|
|
3712
|
+
var fixMethod = function (KEY) {
|
|
3713
|
+
var uncurriedNativeMethod = functionUncurryThis(NativePrototype[KEY]);
|
|
3714
|
+
redefine(NativePrototype, KEY,
|
|
3715
|
+
KEY == 'add' ? function add(value) {
|
|
3716
|
+
uncurriedNativeMethod(this, value === 0 ? 0 : value);
|
|
3717
|
+
return this;
|
|
3718
|
+
} : KEY == 'delete' ? function (key) {
|
|
3719
|
+
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
3720
|
+
} : KEY == 'get' ? function get(key) {
|
|
3721
|
+
return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
3722
|
+
} : KEY == 'has' ? function has(key) {
|
|
3723
|
+
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
3724
|
+
} : function set(key, value) {
|
|
3725
|
+
uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
|
|
3726
|
+
return this;
|
|
3727
|
+
}
|
|
3728
|
+
);
|
|
3729
|
+
};
|
|
3730
|
+
|
|
3731
|
+
var REPLACE = isForced_1(
|
|
3732
|
+
CONSTRUCTOR_NAME,
|
|
3733
|
+
!isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
|
|
3734
|
+
new NativeConstructor().entries().next();
|
|
3735
|
+
}))
|
|
3736
|
+
);
|
|
3737
|
+
|
|
3738
|
+
if (REPLACE) {
|
|
3739
|
+
// create collection constructor
|
|
3740
|
+
Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
|
3741
|
+
internalMetadata.enable();
|
|
3742
|
+
} else if (isForced_1(CONSTRUCTOR_NAME, true)) {
|
|
3743
|
+
var instance = new Constructor();
|
|
3744
|
+
// early implementations not supports chaining
|
|
3745
|
+
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
|
|
3746
|
+
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
|
|
3747
|
+
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
|
|
3748
|
+
// most early implementations doesn't supports iterables, most modern - not close it correctly
|
|
3749
|
+
// eslint-disable-next-line no-new -- required for testing
|
|
3750
|
+
var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
|
|
3751
|
+
// for early implementations -0 and +0 not the same
|
|
3752
|
+
var BUGGY_ZERO = !IS_WEAK && fails(function () {
|
|
3753
|
+
// V8 ~ Chromium 42- fails only with 5+ elements
|
|
3754
|
+
var $instance = new NativeConstructor();
|
|
3755
|
+
var index = 5;
|
|
3756
|
+
while (index--) $instance[ADDER](index, index);
|
|
3757
|
+
return !$instance.has(-0);
|
|
3758
|
+
});
|
|
3759
|
+
|
|
3760
|
+
if (!ACCEPT_ITERABLES) {
|
|
3761
|
+
Constructor = wrapper(function (dummy, iterable) {
|
|
3762
|
+
anInstance(dummy, NativePrototype);
|
|
3763
|
+
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
|
3764
|
+
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
|
3765
|
+
return that;
|
|
3766
|
+
});
|
|
3767
|
+
Constructor.prototype = NativePrototype;
|
|
3768
|
+
NativePrototype.constructor = Constructor;
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3771
|
+
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
|
|
3772
|
+
fixMethod('delete');
|
|
3773
|
+
fixMethod('has');
|
|
3774
|
+
IS_MAP && fixMethod('get');
|
|
3775
|
+
}
|
|
3776
|
+
|
|
3777
|
+
if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
|
|
3778
|
+
|
|
3779
|
+
// weak collections should not contains .clear method
|
|
3780
|
+
if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
exported[CONSTRUCTOR_NAME] = Constructor;
|
|
3784
|
+
_export({ global: true, forced: Constructor != NativeConstructor }, exported);
|
|
3785
|
+
|
|
3786
|
+
setToStringTag(Constructor, CONSTRUCTOR_NAME);
|
|
3787
|
+
|
|
3788
|
+
if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
|
3789
|
+
|
|
3790
|
+
return Constructor;
|
|
3791
|
+
};
|
|
3792
|
+
|
|
3793
|
+
var getWeakData = internalMetadata.getWeakData;
|
|
3794
|
+
|
|
3795
|
+
|
|
3796
|
+
|
|
3797
|
+
|
|
3798
|
+
|
|
3799
|
+
|
|
3800
|
+
|
|
3801
|
+
|
|
3802
|
+
var setInternalState = internalState.set;
|
|
3803
|
+
var internalStateGetterFor = internalState.getterFor;
|
|
3804
|
+
var find = arrayIteration.find;
|
|
3805
|
+
var findIndex = arrayIteration.findIndex;
|
|
3806
|
+
var splice = functionUncurryThis([].splice);
|
|
3807
|
+
var id = 0;
|
|
3808
|
+
|
|
3809
|
+
// fallback for uncaught frozen keys
|
|
3810
|
+
var uncaughtFrozenStore = function (store) {
|
|
3811
|
+
return store.frozen || (store.frozen = new UncaughtFrozenStore());
|
|
3812
|
+
};
|
|
3813
|
+
|
|
3814
|
+
var UncaughtFrozenStore = function () {
|
|
3815
|
+
this.entries = [];
|
|
3816
|
+
};
|
|
3817
|
+
|
|
3818
|
+
var findUncaughtFrozen = function (store, key) {
|
|
3819
|
+
return find(store.entries, function (it) {
|
|
3820
|
+
return it[0] === key;
|
|
3821
|
+
});
|
|
3822
|
+
};
|
|
3823
|
+
|
|
3824
|
+
UncaughtFrozenStore.prototype = {
|
|
3825
|
+
get: function (key) {
|
|
3826
|
+
var entry = findUncaughtFrozen(this, key);
|
|
3827
|
+
if (entry) return entry[1];
|
|
3828
|
+
},
|
|
3829
|
+
has: function (key) {
|
|
3830
|
+
return !!findUncaughtFrozen(this, key);
|
|
3831
|
+
},
|
|
3832
|
+
set: function (key, value) {
|
|
3833
|
+
var entry = findUncaughtFrozen(this, key);
|
|
3834
|
+
if (entry) entry[1] = value;
|
|
3835
|
+
else this.entries.push([key, value]);
|
|
3836
|
+
},
|
|
3837
|
+
'delete': function (key) {
|
|
3838
|
+
var index = findIndex(this.entries, function (it) {
|
|
3839
|
+
return it[0] === key;
|
|
3840
|
+
});
|
|
3841
|
+
if (~index) splice(this.entries, index, 1);
|
|
3842
|
+
return !!~index;
|
|
3843
|
+
}
|
|
3844
|
+
};
|
|
3845
|
+
|
|
3846
|
+
var collectionWeak = {
|
|
3847
|
+
getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
|
3848
|
+
var Constructor = wrapper(function (that, iterable) {
|
|
3849
|
+
anInstance(that, Prototype);
|
|
3850
|
+
setInternalState(that, {
|
|
3851
|
+
type: CONSTRUCTOR_NAME,
|
|
3852
|
+
id: id++,
|
|
3853
|
+
frozen: undefined
|
|
3854
|
+
});
|
|
3855
|
+
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
|
3856
|
+
});
|
|
3857
|
+
|
|
3858
|
+
var Prototype = Constructor.prototype;
|
|
3859
|
+
|
|
3860
|
+
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
|
3861
|
+
|
|
3862
|
+
var define = function (that, key, value) {
|
|
3863
|
+
var state = getInternalState(that);
|
|
3864
|
+
var data = getWeakData(anObject(key), true);
|
|
3865
|
+
if (data === true) uncaughtFrozenStore(state).set(key, value);
|
|
3866
|
+
else data[state.id] = value;
|
|
3867
|
+
return that;
|
|
3868
|
+
};
|
|
3869
|
+
|
|
3870
|
+
redefineAll(Prototype, {
|
|
3871
|
+
// `{ WeakMap, WeakSet }.prototype.delete(key)` methods
|
|
3872
|
+
// https://tc39.es/ecma262/#sec-weakmap.prototype.delete
|
|
3873
|
+
// https://tc39.es/ecma262/#sec-weakset.prototype.delete
|
|
3874
|
+
'delete': function (key) {
|
|
3875
|
+
var state = getInternalState(this);
|
|
3876
|
+
if (!isObject(key)) return false;
|
|
3877
|
+
var data = getWeakData(key);
|
|
3878
|
+
if (data === true) return uncaughtFrozenStore(state)['delete'](key);
|
|
3879
|
+
return data && hasOwnProperty_1(data, state.id) && delete data[state.id];
|
|
3880
|
+
},
|
|
3881
|
+
// `{ WeakMap, WeakSet }.prototype.has(key)` methods
|
|
3882
|
+
// https://tc39.es/ecma262/#sec-weakmap.prototype.has
|
|
3883
|
+
// https://tc39.es/ecma262/#sec-weakset.prototype.has
|
|
3884
|
+
has: function has(key) {
|
|
3885
|
+
var state = getInternalState(this);
|
|
3886
|
+
if (!isObject(key)) return false;
|
|
3887
|
+
var data = getWeakData(key);
|
|
3888
|
+
if (data === true) return uncaughtFrozenStore(state).has(key);
|
|
3889
|
+
return data && hasOwnProperty_1(data, state.id);
|
|
3890
|
+
}
|
|
3891
|
+
});
|
|
3892
|
+
|
|
3893
|
+
redefineAll(Prototype, IS_MAP ? {
|
|
3894
|
+
// `WeakMap.prototype.get(key)` method
|
|
3895
|
+
// https://tc39.es/ecma262/#sec-weakmap.prototype.get
|
|
3896
|
+
get: function get(key) {
|
|
3897
|
+
var state = getInternalState(this);
|
|
3898
|
+
if (isObject(key)) {
|
|
3899
|
+
var data = getWeakData(key);
|
|
3900
|
+
if (data === true) return uncaughtFrozenStore(state).get(key);
|
|
3901
|
+
return data ? data[state.id] : undefined;
|
|
3902
|
+
}
|
|
3903
|
+
},
|
|
3904
|
+
// `WeakMap.prototype.set(key, value)` method
|
|
3905
|
+
// https://tc39.es/ecma262/#sec-weakmap.prototype.set
|
|
3906
|
+
set: function set(key, value) {
|
|
3907
|
+
return define(this, key, value);
|
|
3908
|
+
}
|
|
3909
|
+
} : {
|
|
3910
|
+
// `WeakSet.prototype.add(value)` method
|
|
3911
|
+
// https://tc39.es/ecma262/#sec-weakset.prototype.add
|
|
3912
|
+
add: function add(value) {
|
|
3913
|
+
return define(this, value, true);
|
|
3914
|
+
}
|
|
3915
|
+
});
|
|
3916
|
+
|
|
3917
|
+
return Constructor;
|
|
3918
|
+
}
|
|
3919
|
+
};
|
|
3920
|
+
|
|
3921
|
+
var enforceIternalState = internalState.enforce;
|
|
3922
|
+
|
|
3923
|
+
|
|
3924
|
+
var IS_IE11 = !global$1.ActiveXObject && 'ActiveXObject' in global$1;
|
|
3925
|
+
var InternalWeakMap;
|
|
3926
|
+
|
|
3927
|
+
var wrapper = function (init) {
|
|
3928
|
+
return function WeakMap() {
|
|
3929
|
+
return init(this, arguments.length ? arguments[0] : undefined);
|
|
3930
|
+
};
|
|
3931
|
+
};
|
|
3932
|
+
|
|
3933
|
+
// `WeakMap` constructor
|
|
3934
|
+
// https://tc39.es/ecma262/#sec-weakmap-constructor
|
|
3935
|
+
var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
|
|
3936
|
+
|
|
3937
|
+
// IE11 WeakMap frozen keys fix
|
|
3938
|
+
// We can't use feature detection because it crash some old IE builds
|
|
3939
|
+
// https://github.com/zloirock/core-js/issues/485
|
|
3940
|
+
if (nativeWeakMap && IS_IE11) {
|
|
3941
|
+
InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
|
|
3942
|
+
internalMetadata.enable();
|
|
3943
|
+
var WeakMapPrototype = $WeakMap.prototype;
|
|
3944
|
+
var nativeDelete = functionUncurryThis(WeakMapPrototype['delete']);
|
|
3945
|
+
var nativeHas = functionUncurryThis(WeakMapPrototype.has);
|
|
3946
|
+
var nativeGet = functionUncurryThis(WeakMapPrototype.get);
|
|
3947
|
+
var nativeSet = functionUncurryThis(WeakMapPrototype.set);
|
|
3948
|
+
redefineAll(WeakMapPrototype, {
|
|
3949
|
+
'delete': function (key) {
|
|
3950
|
+
if (isObject(key) && !objectIsExtensible(key)) {
|
|
3951
|
+
var state = enforceIternalState(this);
|
|
3952
|
+
if (!state.frozen) state.frozen = new InternalWeakMap();
|
|
3953
|
+
return nativeDelete(this, key) || state.frozen['delete'](key);
|
|
3954
|
+
} return nativeDelete(this, key);
|
|
3955
|
+
},
|
|
3956
|
+
has: function has(key) {
|
|
3957
|
+
if (isObject(key) && !objectIsExtensible(key)) {
|
|
3958
|
+
var state = enforceIternalState(this);
|
|
3959
|
+
if (!state.frozen) state.frozen = new InternalWeakMap();
|
|
3960
|
+
return nativeHas(this, key) || state.frozen.has(key);
|
|
3961
|
+
} return nativeHas(this, key);
|
|
3962
|
+
},
|
|
3963
|
+
get: function get(key) {
|
|
3964
|
+
if (isObject(key) && !objectIsExtensible(key)) {
|
|
3965
|
+
var state = enforceIternalState(this);
|
|
3966
|
+
if (!state.frozen) state.frozen = new InternalWeakMap();
|
|
3967
|
+
return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
|
|
3968
|
+
} return nativeGet(this, key);
|
|
3969
|
+
},
|
|
3970
|
+
set: function set(key, value) {
|
|
3971
|
+
if (isObject(key) && !objectIsExtensible(key)) {
|
|
3972
|
+
var state = enforceIternalState(this);
|
|
3973
|
+
if (!state.frozen) state.frozen = new InternalWeakMap();
|
|
3974
|
+
nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
|
|
3975
|
+
} else nativeSet(this, key, value);
|
|
3976
|
+
return this;
|
|
3977
|
+
}
|
|
3978
|
+
});
|
|
3979
|
+
}
|
|
3980
|
+
|
|
3981
|
+
// iterable DOM collections
|
|
3982
|
+
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
3983
|
+
var domIterables = {
|
|
3984
|
+
CSSRuleList: 0,
|
|
3985
|
+
CSSStyleDeclaration: 0,
|
|
3986
|
+
CSSValueList: 0,
|
|
3987
|
+
ClientRectList: 0,
|
|
3988
|
+
DOMRectList: 0,
|
|
3989
|
+
DOMStringList: 0,
|
|
3990
|
+
DOMTokenList: 1,
|
|
3991
|
+
DataTransferItemList: 0,
|
|
3992
|
+
FileList: 0,
|
|
3993
|
+
HTMLAllCollection: 0,
|
|
3994
|
+
HTMLCollection: 0,
|
|
3995
|
+
HTMLFormElement: 0,
|
|
3996
|
+
HTMLSelectElement: 0,
|
|
3997
|
+
MediaList: 0,
|
|
3998
|
+
MimeTypeArray: 0,
|
|
3999
|
+
NamedNodeMap: 0,
|
|
4000
|
+
NodeList: 1,
|
|
4001
|
+
PaintRequestList: 0,
|
|
4002
|
+
Plugin: 0,
|
|
4003
|
+
PluginArray: 0,
|
|
4004
|
+
SVGLengthList: 0,
|
|
4005
|
+
SVGNumberList: 0,
|
|
4006
|
+
SVGPathSegList: 0,
|
|
4007
|
+
SVGPointList: 0,
|
|
4008
|
+
SVGStringList: 0,
|
|
4009
|
+
SVGTransformList: 0,
|
|
4010
|
+
SourceBufferList: 0,
|
|
4011
|
+
StyleSheetList: 0,
|
|
4012
|
+
TextTrackCueList: 0,
|
|
4013
|
+
TextTrackList: 0,
|
|
4014
|
+
TouchList: 0
|
|
4015
|
+
};
|
|
4016
|
+
|
|
4017
|
+
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
|
|
4018
|
+
|
|
4019
|
+
|
|
4020
|
+
var classList = documentCreateElement('span').classList;
|
|
4021
|
+
var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
|
|
4022
|
+
|
|
4023
|
+
var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
|
|
4024
|
+
|
|
4025
|
+
var ITERATOR = wellKnownSymbol('iterator');
|
|
4026
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
4027
|
+
var ArrayValues = es_array_iterator.values;
|
|
4028
|
+
|
|
4029
|
+
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
4030
|
+
if (CollectionPrototype) {
|
|
4031
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
4032
|
+
if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
|
|
4033
|
+
createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
|
|
4034
|
+
} catch (error) {
|
|
4035
|
+
CollectionPrototype[ITERATOR] = ArrayValues;
|
|
4036
|
+
}
|
|
4037
|
+
if (!CollectionPrototype[TO_STRING_TAG]) {
|
|
4038
|
+
createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
|
|
4039
|
+
}
|
|
4040
|
+
if (domIterables[COLLECTION_NAME]) for (var METHOD_NAME in es_array_iterator) {
|
|
4041
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
4042
|
+
if (CollectionPrototype[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
|
|
4043
|
+
createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, es_array_iterator[METHOD_NAME]);
|
|
4044
|
+
} catch (error) {
|
|
4045
|
+
CollectionPrototype[METHOD_NAME] = es_array_iterator[METHOD_NAME];
|
|
4046
|
+
}
|
|
4047
|
+
}
|
|
4048
|
+
}
|
|
4049
|
+
};
|
|
4050
|
+
|
|
4051
|
+
for (var COLLECTION_NAME in domIterables) {
|
|
4052
|
+
handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
4053
|
+
}
|
|
4054
|
+
|
|
4055
|
+
handlePrototype(domTokenListPrototype, 'DOMTokenList');
|
|
4056
|
+
|
|
4057
|
+
var FUNCTION_NAME_EXISTS = functionName.EXISTS;
|
|
4058
|
+
|
|
4059
|
+
var defineProperty = objectDefineProperty.f;
|
|
4060
|
+
|
|
4061
|
+
var FunctionPrototype = Function.prototype;
|
|
4062
|
+
var functionToString = functionUncurryThis(FunctionPrototype.toString);
|
|
4063
|
+
var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
|
|
4064
|
+
var regExpExec = functionUncurryThis(nameRE.exec);
|
|
4065
|
+
var NAME = 'name';
|
|
4066
|
+
|
|
4067
|
+
// Function instances `.name` property
|
|
4068
|
+
// https://tc39.es/ecma262/#sec-function-instances-name
|
|
4069
|
+
if (descriptors && !FUNCTION_NAME_EXISTS) {
|
|
4070
|
+
defineProperty(FunctionPrototype, NAME, {
|
|
4071
|
+
configurable: true,
|
|
4072
|
+
get: function () {
|
|
4073
|
+
try {
|
|
4074
|
+
return regExpExec(nameRE, functionToString(this))[1];
|
|
4075
|
+
} catch (error) {
|
|
4076
|
+
return '';
|
|
4077
|
+
}
|
|
4078
|
+
}
|
|
4079
|
+
});
|
|
4080
|
+
}
|
|
4081
|
+
|
|
4082
|
+
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
|
|
4083
|
+
|
|
4084
|
+
var SPECIES = wellKnownSymbol('species');
|
|
4085
|
+
var Array$1 = global$1.Array;
|
|
4086
|
+
var max = Math.max;
|
|
4087
|
+
|
|
4088
|
+
// `Array.prototype.slice` method
|
|
4089
|
+
// https://tc39.es/ecma262/#sec-array.prototype.slice
|
|
4090
|
+
// fallback for not array-like ES3 strings and DOM objects
|
|
4091
|
+
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
|
4092
|
+
slice: function slice(start, end) {
|
|
4093
|
+
var O = toIndexedObject(this);
|
|
4094
|
+
var length = lengthOfArrayLike(O);
|
|
4095
|
+
var k = toAbsoluteIndex(start, length);
|
|
4096
|
+
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
|
4097
|
+
// inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
|
|
4098
|
+
var Constructor, result, n;
|
|
4099
|
+
if (isArray(O)) {
|
|
4100
|
+
Constructor = O.constructor;
|
|
4101
|
+
// cross-realm fallback
|
|
4102
|
+
if (isConstructor(Constructor) && (Constructor === Array$1 || isArray(Constructor.prototype))) {
|
|
4103
|
+
Constructor = undefined;
|
|
4104
|
+
} else if (isObject(Constructor)) {
|
|
4105
|
+
Constructor = Constructor[SPECIES];
|
|
4106
|
+
if (Constructor === null) Constructor = undefined;
|
|
4107
|
+
}
|
|
4108
|
+
if (Constructor === Array$1 || Constructor === undefined) {
|
|
4109
|
+
return arraySlice(O, k, fin);
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
result = new (Constructor === undefined ? Array$1 : Constructor)(max(fin - k, 0));
|
|
4113
|
+
for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
|
4114
|
+
result.length = n;
|
|
4115
|
+
return result;
|
|
4116
|
+
}
|
|
4117
|
+
});
|
|
4118
|
+
|
|
4119
|
+
function getMenuConfig(editor) {
|
|
4120
|
+
return editor.getMenuConfig('uploadVideo');
|
|
4121
|
+
}
|
|
4122
|
+
var EDITOR_TO_UPPY_MAP = new WeakMap();
|
|
4123
|
+
function getUppy(editor) {
|
|
4124
|
+
var uppy = EDITOR_TO_UPPY_MAP.get(editor);
|
|
4125
|
+
if (uppy != null) return uppy;
|
|
4126
|
+
var menuConfig = getMenuConfig(editor);
|
|
4127
|
+
var onSuccess = menuConfig.onSuccess,
|
|
4128
|
+
onProgress = menuConfig.onProgress,
|
|
4129
|
+
onFailed = menuConfig.onFailed,
|
|
4130
|
+
customInsert = menuConfig.customInsert,
|
|
4131
|
+
onError = menuConfig.onError;
|
|
4132
|
+
var successHandler = function successHandler(file, res) {
|
|
4133
|
+
if (customInsert) {
|
|
4134
|
+
customInsert(res, function (src, poster) {
|
|
4135
|
+
return insertVideo(editor, src, poster);
|
|
4136
|
+
});
|
|
4137
|
+
onSuccess(file, res);
|
|
4138
|
+
return;
|
|
4139
|
+
}
|
|
4140
|
+
var _a = res.errno,
|
|
4141
|
+
errno = _a === void 0 ? 1 : _a,
|
|
4142
|
+
_b = res.data,
|
|
4143
|
+
data = _b === void 0 ? {} : _b;
|
|
4144
|
+
if (errno !== 0) {
|
|
4145
|
+
onFailed(file, res);
|
|
4146
|
+
return;
|
|
4147
|
+
}
|
|
4148
|
+
var _c = data.url,
|
|
4149
|
+
url = _c === void 0 ? '' : _c,
|
|
4150
|
+
_d = data.poster,
|
|
4151
|
+
poster = _d === void 0 ? '' : _d;
|
|
4152
|
+
insertVideo(editor, url, poster);
|
|
4153
|
+
onSuccess(file, res);
|
|
4154
|
+
};
|
|
4155
|
+
var progressHandler = function progressHandler(progress) {
|
|
4156
|
+
editor.showProgressBar(progress);
|
|
4157
|
+
onProgress && onProgress(progress);
|
|
4158
|
+
};
|
|
4159
|
+
var errorHandler = function errorHandler(file, err, res) {
|
|
4160
|
+
onError(file, err, res);
|
|
4161
|
+
};
|
|
4162
|
+
uppy = createUploader(__assign(__assign({}, menuConfig), {
|
|
4163
|
+
onProgress: progressHandler,
|
|
4164
|
+
onSuccess: successHandler,
|
|
4165
|
+
onError: errorHandler
|
|
4166
|
+
}));
|
|
4167
|
+
EDITOR_TO_UPPY_MAP.set(editor, uppy);
|
|
4168
|
+
return uppy;
|
|
4169
|
+
}
|
|
4170
|
+
function uploadFile(editor, file) {
|
|
4171
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4172
|
+
var uppy, name, type, size;
|
|
4173
|
+
return __generator(this, function (_a) {
|
|
4174
|
+
switch (_a.label) {
|
|
4175
|
+
case 0:
|
|
4176
|
+
uppy = getUppy(editor);
|
|
4177
|
+
name = file.name, type = file.type, size = file.size;
|
|
4178
|
+
uppy.addFile({
|
|
4179
|
+
name: name,
|
|
4180
|
+
type: type,
|
|
4181
|
+
size: size,
|
|
4182
|
+
data: file
|
|
4183
|
+
});
|
|
4184
|
+
return [4
|
|
4185
|
+
, uppy.upload()];
|
|
4186
|
+
case 1:
|
|
4187
|
+
_a.sent();
|
|
4188
|
+
return [2
|
|
4189
|
+
];
|
|
4190
|
+
}
|
|
4191
|
+
});
|
|
4192
|
+
});
|
|
4193
|
+
}
|
|
4194
|
+
function uploadVideos (editor, files) {
|
|
4195
|
+
var e_1, _a;
|
|
4196
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4197
|
+
var fileList, customUpload, fileList_1, fileList_1_1, file, e_1_1;
|
|
4198
|
+
return __generator(this, function (_b) {
|
|
4199
|
+
switch (_b.label) {
|
|
4200
|
+
case 0:
|
|
4201
|
+
if (files == null) return [2
|
|
4202
|
+
];
|
|
4203
|
+
fileList = Array.prototype.slice.call(files);
|
|
4204
|
+
customUpload = getMenuConfig(editor).customUpload;
|
|
4205
|
+
_b.label = 1;
|
|
4206
|
+
case 1:
|
|
4207
|
+
_b.trys.push([1, 9, 10, 15]);
|
|
4208
|
+
fileList_1 = __asyncValues(fileList);
|
|
4209
|
+
_b.label = 2;
|
|
4210
|
+
case 2:
|
|
4211
|
+
return [4
|
|
4212
|
+
, fileList_1.next()];
|
|
4213
|
+
case 3:
|
|
4214
|
+
if (!(fileList_1_1 = _b.sent(), !fileList_1_1.done)) return [3
|
|
4215
|
+
, 8];
|
|
4216
|
+
file = fileList_1_1.value;
|
|
4217
|
+
if (!customUpload) return [3
|
|
4218
|
+
, 5];
|
|
4219
|
+
return [4
|
|
4220
|
+
, customUpload(file, function (src, poster) {
|
|
4221
|
+
return insertVideo(editor, src, poster);
|
|
4222
|
+
})];
|
|
4223
|
+
case 4:
|
|
4224
|
+
_b.sent();
|
|
4225
|
+
return [3
|
|
4226
|
+
, 7];
|
|
4227
|
+
case 5:
|
|
4228
|
+
return [4
|
|
4229
|
+
, uploadFile(editor, file)];
|
|
4230
|
+
case 6:
|
|
4231
|
+
_b.sent();
|
|
4232
|
+
_b.label = 7;
|
|
4233
|
+
case 7:
|
|
4234
|
+
return [3
|
|
4235
|
+
, 2];
|
|
4236
|
+
case 8:
|
|
4237
|
+
return [3
|
|
4238
|
+
, 15];
|
|
4239
|
+
case 9:
|
|
4240
|
+
e_1_1 = _b.sent();
|
|
4241
|
+
e_1 = {
|
|
4242
|
+
error: e_1_1
|
|
4243
|
+
};
|
|
4244
|
+
return [3
|
|
4245
|
+
, 15];
|
|
4246
|
+
case 10:
|
|
4247
|
+
_b.trys.push([10,, 13, 14]);
|
|
4248
|
+
if (!(fileList_1_1 && !fileList_1_1.done && (_a = fileList_1.return))) return [3
|
|
4249
|
+
, 12];
|
|
4250
|
+
return [4
|
|
4251
|
+
, _a.call(fileList_1)];
|
|
4252
|
+
case 11:
|
|
4253
|
+
_b.sent();
|
|
4254
|
+
_b.label = 12;
|
|
4255
|
+
case 12:
|
|
4256
|
+
return [3
|
|
4257
|
+
, 14];
|
|
4258
|
+
case 13:
|
|
4259
|
+
if (e_1) throw e_1.error;
|
|
4260
|
+
return [7
|
|
4261
|
+
];
|
|
4262
|
+
case 14:
|
|
4263
|
+
return [7
|
|
4264
|
+
];
|
|
4265
|
+
case 15:
|
|
4266
|
+
return [2
|
|
4267
|
+
];
|
|
4268
|
+
}
|
|
4269
|
+
});
|
|
4270
|
+
});
|
|
4271
|
+
}
|
|
4272
|
+
|
|
4273
|
+
var UploadVideoMenu =
|
|
4274
|
+
function () {
|
|
4275
|
+
function UploadVideoMenu() {
|
|
4276
|
+
this.title = t('videoModule.uploadVideo');
|
|
4277
|
+
this.iconSvg = UPLOAD_VIDEO_SVG;
|
|
4278
|
+
this.tag = 'button';
|
|
4279
|
+
}
|
|
4280
|
+
UploadVideoMenu.prototype.getValue = function (editor) {
|
|
4281
|
+
return '';
|
|
4282
|
+
};
|
|
4283
|
+
UploadVideoMenu.prototype.isActive = function (editor) {
|
|
4284
|
+
return false;
|
|
4285
|
+
};
|
|
4286
|
+
UploadVideoMenu.prototype.exec = function (editor, value) {
|
|
4287
|
+
var _a = this.getMenuConfig(editor),
|
|
4288
|
+
_b = _a.allowedFileTypes,
|
|
4289
|
+
allowedFileTypes = _b === void 0 ? [] : _b,
|
|
4290
|
+
customBrowseAndUpload = _a.customBrowseAndUpload;
|
|
4291
|
+
if (customBrowseAndUpload) {
|
|
4292
|
+
customBrowseAndUpload(function (src, poster) {
|
|
4293
|
+
return insertVideo(editor, src, poster);
|
|
4294
|
+
});
|
|
4295
|
+
return;
|
|
4296
|
+
}
|
|
4297
|
+
var acceptAttr = '';
|
|
4298
|
+
if (allowedFileTypes.length > 0) {
|
|
4299
|
+
acceptAttr = "accept=\"" + allowedFileTypes.join(', ') + "\"";
|
|
4300
|
+
}
|
|
4301
|
+
var $body = $('body');
|
|
4302
|
+
var $inputFile = $("<input type=\"file\" " + acceptAttr + " multiple/>");
|
|
4303
|
+
$inputFile.hide();
|
|
4304
|
+
$body.append($inputFile);
|
|
4305
|
+
$inputFile.click();
|
|
4306
|
+
$inputFile.on('change', function () {
|
|
4307
|
+
var files = $inputFile[0].files;
|
|
4308
|
+
uploadVideos(editor, files);
|
|
4309
|
+
});
|
|
4310
|
+
};
|
|
4311
|
+
UploadVideoMenu.prototype.isDisabled = function (editor) {
|
|
4312
|
+
var selection = editor.selection;
|
|
4313
|
+
if (selection == null) return true;
|
|
4314
|
+
if (!Range.isCollapsed(selection)) return true;
|
|
4315
|
+
var selectedElems = DomEditor.getSelectedElems(editor);
|
|
4316
|
+
var hasVoidOrPre = selectedElems.some(function (elem) {
|
|
4317
|
+
var type = DomEditor.getNodeType(elem);
|
|
4318
|
+
if (type === 'pre') return true;
|
|
4319
|
+
if (type === 'list-item') return true;
|
|
4320
|
+
if (editor.isVoid(elem)) return true;
|
|
4321
|
+
return false;
|
|
4322
|
+
});
|
|
4323
|
+
if (hasVoidOrPre) return true;
|
|
4324
|
+
return false;
|
|
4325
|
+
};
|
|
4326
|
+
UploadVideoMenu.prototype.getMenuConfig = function (editor) {
|
|
4327
|
+
return editor.getMenuConfig('uploadVideo');
|
|
4328
|
+
};
|
|
4329
|
+
return UploadVideoMenu;
|
|
4330
|
+
}();
|
|
4331
|
+
|
|
4332
|
+
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
4333
|
+
|
|
4334
|
+
|
|
4335
|
+
|
|
4336
|
+
|
|
4337
|
+
|
|
4338
|
+
|
|
4339
|
+
|
|
4340
|
+
var TO_STRING = 'toString';
|
|
4341
|
+
var RegExpPrototype = RegExp.prototype;
|
|
4342
|
+
var n$ToString = RegExpPrototype[TO_STRING];
|
|
4343
|
+
var getFlags = functionUncurryThis(regexpFlags);
|
|
4344
|
+
|
|
4345
|
+
var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
|
4346
|
+
// FF44- RegExp#toString has a wrong name
|
|
4347
|
+
var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
|
|
4348
|
+
|
|
4349
|
+
// `RegExp.prototype.toString` method
|
|
4350
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
|
|
4351
|
+
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
4352
|
+
redefine(RegExp.prototype, TO_STRING, function toString$1() {
|
|
4353
|
+
var R = anObject(this);
|
|
4354
|
+
var p = toString(R.source);
|
|
4355
|
+
var rf = R.flags;
|
|
4356
|
+
var f = toString(rf === undefined && objectIsPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype) ? getFlags(R) : rf);
|
|
4357
|
+
return '/' + p + '/' + f;
|
|
4358
|
+
}, { unsafe: true });
|
|
4359
|
+
}
|
|
4360
|
+
|
|
4361
|
+
function genDomID() {
|
|
4362
|
+
return genRandomStr('w-e-insert-video');
|
|
4363
|
+
}
|
|
4364
|
+
var EditorVideoSizeMenu =
|
|
4365
|
+
function () {
|
|
4366
|
+
function EditorVideoSizeMenu() {
|
|
4367
|
+
this.title = t('videoModule.editSize');
|
|
4368
|
+
this.tag = 'button';
|
|
4369
|
+
this.showModal = true;
|
|
4370
|
+
this.modalWidth = 320;
|
|
4371
|
+
this.$content = null;
|
|
4372
|
+
this.widthInputId = genDomID();
|
|
4373
|
+
this.heightInputId = genDomID();
|
|
4374
|
+
this.buttonId = genDomID();
|
|
4375
|
+
}
|
|
4376
|
+
EditorVideoSizeMenu.prototype.getSelectedVideoNode = function (editor) {
|
|
4377
|
+
return DomEditor.getSelectedNodeByType(editor, 'video');
|
|
4378
|
+
};
|
|
4379
|
+
EditorVideoSizeMenu.prototype.getValue = function (editor) {
|
|
4380
|
+
return '';
|
|
4381
|
+
};
|
|
4382
|
+
EditorVideoSizeMenu.prototype.isActive = function (editor) {
|
|
4383
|
+
return false;
|
|
4384
|
+
};
|
|
4385
|
+
EditorVideoSizeMenu.prototype.exec = function (editor, value) {
|
|
4386
|
+
};
|
|
4387
|
+
EditorVideoSizeMenu.prototype.isDisabled = function (editor) {
|
|
4388
|
+
if (editor.selection == null) return true;
|
|
4389
|
+
var videoNode = this.getSelectedVideoNode(editor);
|
|
4390
|
+
if (videoNode == null) {
|
|
4391
|
+
return true;
|
|
4392
|
+
}
|
|
4393
|
+
return false;
|
|
4394
|
+
};
|
|
4395
|
+
EditorVideoSizeMenu.prototype.getModalPositionNode = function (editor) {
|
|
4396
|
+
return this.getSelectedVideoNode(editor);
|
|
4397
|
+
};
|
|
4398
|
+
EditorVideoSizeMenu.prototype.getModalContentElem = function (editor) {
|
|
4399
|
+
var _a = this,
|
|
4400
|
+
widthInputId = _a.widthInputId,
|
|
4401
|
+
heightInputId = _a.heightInputId,
|
|
4402
|
+
buttonId = _a.buttonId;
|
|
4403
|
+
var _b = __read(genModalInputElems(t('videoModule.width'), widthInputId, 'auto'), 2),
|
|
4404
|
+
widthContainerElem = _b[0],
|
|
4405
|
+
inputWidthElem = _b[1];
|
|
4406
|
+
var $inputWidth = $(inputWidthElem);
|
|
4407
|
+
var _c = __read(genModalInputElems(t('videoModule.height'), heightInputId, 'auto'), 2),
|
|
4408
|
+
heightContainerElem = _c[0],
|
|
4409
|
+
inputHeightElem = _c[1];
|
|
4410
|
+
var $inputHeight = $(inputHeightElem);
|
|
4411
|
+
var _d = __read(genModalButtonElems(buttonId, t('videoModule.ok')), 1),
|
|
4412
|
+
buttonContainerElem = _d[0];
|
|
4413
|
+
if (this.$content == null) {
|
|
4414
|
+
var $content_1 = $('<div></div>');
|
|
4415
|
+
$content_1.on('click', "#" + buttonId, function (e) {
|
|
4416
|
+
e.preventDefault();
|
|
4417
|
+
var rawWidth = $content_1.find("#" + widthInputId).val().trim();
|
|
4418
|
+
var rawHeight = $content_1.find("#" + heightInputId).val().trim();
|
|
4419
|
+
var numberWidth = parseInt(rawWidth);
|
|
4420
|
+
var numberHeight = parseInt(rawHeight);
|
|
4421
|
+
var width = numberWidth ? numberWidth.toString() : 'auto';
|
|
4422
|
+
var height = numberHeight ? numberHeight.toString() : 'auto';
|
|
4423
|
+
editor.restoreSelection();
|
|
4424
|
+
Transforms.setNodes(editor, {
|
|
4425
|
+
width: width,
|
|
4426
|
+
height: height
|
|
4427
|
+
}, {
|
|
4428
|
+
match: function match(n) {
|
|
4429
|
+
return DomEditor.checkNodeType(n, 'video');
|
|
4430
|
+
}
|
|
4431
|
+
});
|
|
4432
|
+
editor.hidePanelOrModal();
|
|
4433
|
+
});
|
|
4434
|
+
this.$content = $content_1;
|
|
4435
|
+
}
|
|
4436
|
+
var $content = this.$content;
|
|
4437
|
+
$content.empty();
|
|
4438
|
+
$content.append(widthContainerElem);
|
|
4439
|
+
$content.append(heightContainerElem);
|
|
4440
|
+
$content.append(buttonContainerElem);
|
|
4441
|
+
var videoNode = this.getSelectedVideoNode(editor);
|
|
4442
|
+
if (videoNode == null) return $content[0];
|
|
4443
|
+
var _e = videoNode.width,
|
|
4444
|
+
width = _e === void 0 ? 'auto' : _e,
|
|
4445
|
+
_f = videoNode.height,
|
|
4446
|
+
height = _f === void 0 ? 'auto' : _f;
|
|
4447
|
+
$inputWidth.val(width);
|
|
4448
|
+
$inputHeight.val(height);
|
|
4449
|
+
setTimeout(function () {
|
|
4450
|
+
$inputWidth.focus();
|
|
4451
|
+
});
|
|
4452
|
+
return $content[0];
|
|
4453
|
+
};
|
|
4454
|
+
return EditorVideoSizeMenu;
|
|
4455
|
+
}();
|
|
4456
|
+
|
|
4457
|
+
function genUploadVideoMenuConfig() {
|
|
4458
|
+
return {
|
|
4459
|
+
server: '',
|
|
4460
|
+
fieldName: 'wangeditor-uploaded-video',
|
|
4461
|
+
maxFileSize: 10 * 1024 * 1024,
|
|
4462
|
+
maxNumberOfFiles: 5,
|
|
4463
|
+
allowedFileTypes: ['video/*'],
|
|
4464
|
+
meta: {
|
|
4465
|
+
},
|
|
4466
|
+
metaWithUrl: false,
|
|
4467
|
+
withCredentials: false,
|
|
4468
|
+
timeout: 30 * 1000,
|
|
4469
|
+
onBeforeUpload: function onBeforeUpload(files) {
|
|
4470
|
+
return files;
|
|
4471
|
+
},
|
|
4472
|
+
onProgress: function onProgress(progress) {
|
|
4473
|
+
},
|
|
4474
|
+
onSuccess: function onSuccess(file, res) {
|
|
4475
|
+
},
|
|
4476
|
+
onFailed: function onFailed(file, res) {
|
|
4477
|
+
console.error("'" + file.name + "' upload failed", res);
|
|
4478
|
+
},
|
|
4479
|
+
onError: function onError(file, err, res) {
|
|
4480
|
+
console.error("'" + file.name + " upload error", err, res);
|
|
4481
|
+
}
|
|
4482
|
+
};
|
|
4483
|
+
}
|
|
4484
|
+
function genInsertVideoMenuConfig() {
|
|
4485
|
+
return {
|
|
4486
|
+
onInsertedVideo: function onInsertedVideo(node) {
|
|
4487
|
+
},
|
|
4488
|
+
checkVideo: function checkVideo(src, poster) {
|
|
4489
|
+
return true;
|
|
4490
|
+
},
|
|
4491
|
+
parseVideoSrc: function parseVideoSrc(src) {
|
|
4492
|
+
return src;
|
|
4493
|
+
}
|
|
4494
|
+
};
|
|
4495
|
+
}
|
|
4496
|
+
|
|
4497
|
+
var insertVideoMenuConf = {
|
|
4498
|
+
key: 'insertVideo',
|
|
4499
|
+
factory: function factory() {
|
|
4500
|
+
return new InsertVideoMenu();
|
|
4501
|
+
},
|
|
4502
|
+
config: genInsertVideoMenuConfig()
|
|
4503
|
+
};
|
|
4504
|
+
var uploadVideoMenuConf = {
|
|
4505
|
+
key: 'uploadVideo',
|
|
4506
|
+
factory: function factory() {
|
|
4507
|
+
return new UploadVideoMenu();
|
|
4508
|
+
},
|
|
4509
|
+
config: genUploadVideoMenuConfig()
|
|
4510
|
+
};
|
|
4511
|
+
var editorVideSizeMenuConf = {
|
|
4512
|
+
key: 'editVideoSize',
|
|
4513
|
+
factory: function factory() {
|
|
4514
|
+
return new EditorVideoSizeMenu();
|
|
4515
|
+
}
|
|
4516
|
+
};
|
|
4517
|
+
|
|
4518
|
+
var video = {
|
|
4519
|
+
renderElems: [renderVideoConf],
|
|
4520
|
+
elemsToHtml: [videoToHtmlConf],
|
|
4521
|
+
preParseHtml: [preParseHtmlConf],
|
|
4522
|
+
parseElemsHtml: [parseHtmlConf],
|
|
4523
|
+
menus: [insertVideoMenuConf, uploadVideoMenuConf, editorVideSizeMenuConf],
|
|
4524
|
+
editorPlugin: withVideo
|
|
4525
|
+
};
|
|
4526
|
+
|
|
4527
|
+
export { video as default };
|
|
4528
|
+
//# sourceMappingURL=index.esm.js.map
|