cloudinary-video-player 3.12.1 → 3.12.2-edge.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/dist/134.min.js +8 -0
- package/dist/309.min.js +6 -0
- package/dist/adaptive-streaming.js +9 -9
- package/dist/adaptive-streaming.min.js +2 -2
- package/dist/chapters.js +4 -4
- package/dist/chapters.min.js +3 -3
- package/dist/cld-player-core.js +37 -0
- package/dist/cld-player-core.min.js +6 -0
- package/dist/cld-video-player-lazy.js +494 -0
- package/dist/cld-video-player-lazy.min.js +6 -0
- package/dist/cld-video-player.css +2 -2
- package/dist/cld-video-player.js +366 -332
- package/dist/cld-video-player.light.js +366 -332
- package/dist/cld-video-player.light.min.js +4 -4
- package/dist/cld-video-player.min.css +2 -2
- package/dist/cld-video-player.min.js +4 -4
- package/dist/colors.js +4 -4
- package/dist/colors.min.js +2 -2
- package/dist/dash.js +6 -6
- package/dist/dash.min.js +2 -2
- package/dist/debug.js +8 -8
- package/dist/debug.min.js +3 -3
- package/dist/ima.js +9 -9
- package/dist/ima.min.js +2 -2
- package/dist/interaction-areas.js +11 -11
- package/dist/interaction-areas.min.js +2 -2
- package/dist/node_modules_lodash_throttle_js.js +8 -8
- package/dist/playlist.js +31 -31
- package/dist/playlist.min.js +3 -3
- package/dist/recommendations-overlay.js +10 -10
- package/dist/recommendations-overlay.min.js +2 -2
- package/dist/schema.json +19 -0
- package/dist/share.js +5 -5
- package/dist/share.min.js +3 -3
- package/dist/shoppable.js +12 -12
- package/dist/shoppable.min.js +2 -2
- package/dist/utils_fetch-config_js.js +81 -0
- package/dist/video-player_js.js +3111 -0
- package/dist/visual-search.js +7 -7
- package/dist/visual-search.min.js +2 -2
- package/lib/_commonjsHelpers.js +7 -0
- package/lib/_videojs-proxy.js +30294 -0
- package/lib/abr-strategies.js +31 -0
- package/lib/adaptive-streaming.js +468 -2
- package/lib/all.js +25 -2
- package/lib/chapters.js +205 -1
- package/lib/cld-video-player.min.css +5 -22
- package/lib/colors.js +59 -1
- package/lib/{schema.json → config/configSchema.json} +19 -0
- package/lib/dash.js +69943 -2
- package/lib/debug.js +322 -1
- package/lib/document.js +770 -0
- package/lib/download-button.js +48 -0
- package/lib/fetch-config.js +93 -0
- package/lib/ima.js +6851 -1
- package/lib/index.js +27 -0
- package/lib/interaction-areas.const.js +24 -0
- package/lib/interaction-areas.service.js +469 -0
- package/lib/lazy.js +20 -0
- package/lib/noop.js +33 -0
- package/lib/player-api.js +469 -0
- package/lib/player.js +7 -2
- package/lib/playlist-panel.js +602 -0
- package/lib/playlist.js +637 -1
- package/lib/querystring.js +81 -0
- package/lib/recommendations-overlay.js +320 -1
- package/lib/share.js +129 -1
- package/lib/shoppable-post-widget.js +572 -0
- package/lib/shoppable-widget.js +77 -0
- package/lib/throttle.js +318 -0
- package/lib/toNumber.js +134 -0
- package/lib/validators-functions.js +485 -0
- package/lib/video-player.js +16241 -0
- package/lib/videoPlayer.js +7 -2
- package/lib/videojs-contrib-hlsjs.js +37638 -0
- package/lib/visual-search.js +235 -1
- package/package.json +31 -15
- package/lib/adaptive-streaming.js.LICENSE.txt +0 -3
- package/lib/all.js.LICENSE.txt +0 -25
- package/lib/cld-video-player.js +0 -2
- package/lib/cld-video-player.js.LICENSE.txt +0 -21
- package/lib/dash.js.LICENSE.txt +0 -1842
- package/lib/interaction-areas.js +0 -1
- package/lib/player.js.LICENSE.txt +0 -21
- package/lib/shoppable.js +0 -1
- package/lib/videoPlayer.js.LICENSE.txt +0 -21
package/lib/document.js
ADDED
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
|
2
|
+
|
|
3
|
+
var window_1;
|
|
4
|
+
var hasRequiredWindow;
|
|
5
|
+
|
|
6
|
+
function requireWindow () {
|
|
7
|
+
if (hasRequiredWindow) return window_1;
|
|
8
|
+
hasRequiredWindow = 1;
|
|
9
|
+
var win;
|
|
10
|
+
|
|
11
|
+
if (typeof window !== "undefined") {
|
|
12
|
+
win = window;
|
|
13
|
+
} else if (typeof commonjsGlobal !== "undefined") {
|
|
14
|
+
win = commonjsGlobal;
|
|
15
|
+
} else if (typeof self !== "undefined"){
|
|
16
|
+
win = self;
|
|
17
|
+
} else {
|
|
18
|
+
win = {};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
window_1 = win;
|
|
22
|
+
return window_1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var windowExports = requireWindow();
|
|
26
|
+
var window$1 = /*@__PURE__*/getDefaultExportFromCjs(windowExports);
|
|
27
|
+
|
|
28
|
+
var domWalk;
|
|
29
|
+
var hasRequiredDomWalk;
|
|
30
|
+
|
|
31
|
+
function requireDomWalk () {
|
|
32
|
+
if (hasRequiredDomWalk) return domWalk;
|
|
33
|
+
hasRequiredDomWalk = 1;
|
|
34
|
+
var slice = Array.prototype.slice;
|
|
35
|
+
|
|
36
|
+
domWalk = iterativelyWalk;
|
|
37
|
+
|
|
38
|
+
function iterativelyWalk(nodes, cb) {
|
|
39
|
+
if (!('length' in nodes)) {
|
|
40
|
+
nodes = [nodes];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
nodes = slice.call(nodes);
|
|
44
|
+
|
|
45
|
+
while(nodes.length) {
|
|
46
|
+
var node = nodes.shift(),
|
|
47
|
+
ret = cb(node);
|
|
48
|
+
|
|
49
|
+
if (ret) {
|
|
50
|
+
return ret
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (node.childNodes && node.childNodes.length) {
|
|
54
|
+
nodes = slice.call(node.childNodes).concat(nodes);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return domWalk;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var domComment;
|
|
62
|
+
var hasRequiredDomComment;
|
|
63
|
+
|
|
64
|
+
function requireDomComment () {
|
|
65
|
+
if (hasRequiredDomComment) return domComment;
|
|
66
|
+
hasRequiredDomComment = 1;
|
|
67
|
+
domComment = Comment;
|
|
68
|
+
|
|
69
|
+
function Comment(data, owner) {
|
|
70
|
+
if (!(this instanceof Comment)) {
|
|
71
|
+
return new Comment(data, owner)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
this.data = data;
|
|
75
|
+
this.nodeValue = data;
|
|
76
|
+
this.length = data.length;
|
|
77
|
+
this.ownerDocument = owner || null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Comment.prototype.nodeType = 8;
|
|
81
|
+
Comment.prototype.nodeName = "#comment";
|
|
82
|
+
|
|
83
|
+
Comment.prototype.toString = function _Comment_toString() {
|
|
84
|
+
return "[object Comment]"
|
|
85
|
+
};
|
|
86
|
+
return domComment;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
var domText;
|
|
90
|
+
var hasRequiredDomText;
|
|
91
|
+
|
|
92
|
+
function requireDomText () {
|
|
93
|
+
if (hasRequiredDomText) return domText;
|
|
94
|
+
hasRequiredDomText = 1;
|
|
95
|
+
domText = DOMText;
|
|
96
|
+
|
|
97
|
+
function DOMText(value, owner) {
|
|
98
|
+
if (!(this instanceof DOMText)) {
|
|
99
|
+
return new DOMText(value)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
this.data = value || "";
|
|
103
|
+
this.length = this.data.length;
|
|
104
|
+
this.ownerDocument = owner || null;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
DOMText.prototype.type = "DOMTextNode";
|
|
108
|
+
DOMText.prototype.nodeType = 3;
|
|
109
|
+
DOMText.prototype.nodeName = "#text";
|
|
110
|
+
|
|
111
|
+
DOMText.prototype.toString = function _Text_toString() {
|
|
112
|
+
return this.data
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
DOMText.prototype.replaceData = function replaceData(index, length, value) {
|
|
116
|
+
var current = this.data;
|
|
117
|
+
var left = current.substring(0, index);
|
|
118
|
+
var right = current.substring(index + length, current.length);
|
|
119
|
+
this.data = left + value + right;
|
|
120
|
+
this.length = this.data.length;
|
|
121
|
+
};
|
|
122
|
+
return domText;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
var dispatchEvent_1;
|
|
126
|
+
var hasRequiredDispatchEvent;
|
|
127
|
+
|
|
128
|
+
function requireDispatchEvent () {
|
|
129
|
+
if (hasRequiredDispatchEvent) return dispatchEvent_1;
|
|
130
|
+
hasRequiredDispatchEvent = 1;
|
|
131
|
+
dispatchEvent_1 = dispatchEvent;
|
|
132
|
+
|
|
133
|
+
function dispatchEvent(ev) {
|
|
134
|
+
var elem = this;
|
|
135
|
+
var type = ev.type;
|
|
136
|
+
|
|
137
|
+
if (!ev.target) {
|
|
138
|
+
ev.target = elem;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (!elem.listeners) {
|
|
142
|
+
elem.listeners = {};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var listeners = elem.listeners[type];
|
|
146
|
+
|
|
147
|
+
if (listeners) {
|
|
148
|
+
return listeners.forEach(function (listener) {
|
|
149
|
+
ev.currentTarget = elem;
|
|
150
|
+
if (typeof listener === 'function') {
|
|
151
|
+
listener(ev);
|
|
152
|
+
} else {
|
|
153
|
+
listener.handleEvent(ev);
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (elem.parentNode) {
|
|
159
|
+
elem.parentNode.dispatchEvent(ev);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return dispatchEvent_1;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
var addEventListener_1;
|
|
166
|
+
var hasRequiredAddEventListener;
|
|
167
|
+
|
|
168
|
+
function requireAddEventListener () {
|
|
169
|
+
if (hasRequiredAddEventListener) return addEventListener_1;
|
|
170
|
+
hasRequiredAddEventListener = 1;
|
|
171
|
+
addEventListener_1 = addEventListener;
|
|
172
|
+
|
|
173
|
+
function addEventListener(type, listener) {
|
|
174
|
+
var elem = this;
|
|
175
|
+
|
|
176
|
+
if (!elem.listeners) {
|
|
177
|
+
elem.listeners = {};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (!elem.listeners[type]) {
|
|
181
|
+
elem.listeners[type] = [];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (elem.listeners[type].indexOf(listener) === -1) {
|
|
185
|
+
elem.listeners[type].push(listener);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return addEventListener_1;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
var removeEventListener_1;
|
|
192
|
+
var hasRequiredRemoveEventListener;
|
|
193
|
+
|
|
194
|
+
function requireRemoveEventListener () {
|
|
195
|
+
if (hasRequiredRemoveEventListener) return removeEventListener_1;
|
|
196
|
+
hasRequiredRemoveEventListener = 1;
|
|
197
|
+
removeEventListener_1 = removeEventListener;
|
|
198
|
+
|
|
199
|
+
function removeEventListener(type, listener) {
|
|
200
|
+
var elem = this;
|
|
201
|
+
|
|
202
|
+
if (!elem.listeners) {
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (!elem.listeners[type]) {
|
|
207
|
+
return
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
var list = elem.listeners[type];
|
|
211
|
+
var index = list.indexOf(listener);
|
|
212
|
+
if (index !== -1) {
|
|
213
|
+
list.splice(index, 1);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return removeEventListener_1;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
var serialize;
|
|
220
|
+
var hasRequiredSerialize;
|
|
221
|
+
|
|
222
|
+
function requireSerialize () {
|
|
223
|
+
if (hasRequiredSerialize) return serialize;
|
|
224
|
+
hasRequiredSerialize = 1;
|
|
225
|
+
serialize = serializeNode;
|
|
226
|
+
|
|
227
|
+
var voidElements = ["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];
|
|
228
|
+
|
|
229
|
+
function serializeNode(node) {
|
|
230
|
+
switch (node.nodeType) {
|
|
231
|
+
case 3:
|
|
232
|
+
return escapeText(node.data)
|
|
233
|
+
case 8:
|
|
234
|
+
return "<!--" + node.data + "-->"
|
|
235
|
+
default:
|
|
236
|
+
return serializeElement(node)
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function serializeElement(elem) {
|
|
241
|
+
var strings = [];
|
|
242
|
+
|
|
243
|
+
var tagname = elem.tagName;
|
|
244
|
+
|
|
245
|
+
if (elem.namespaceURI === "http://www.w3.org/1999/xhtml") {
|
|
246
|
+
tagname = tagname.toLowerCase();
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
strings.push("<" + tagname + properties(elem) + datasetify(elem));
|
|
250
|
+
|
|
251
|
+
if (voidElements.indexOf(tagname) > -1) {
|
|
252
|
+
strings.push(" />");
|
|
253
|
+
} else {
|
|
254
|
+
strings.push(">");
|
|
255
|
+
|
|
256
|
+
if (elem.childNodes.length) {
|
|
257
|
+
strings.push.apply(strings, elem.childNodes.map(serializeNode));
|
|
258
|
+
} else if (elem.textContent || elem.innerText) {
|
|
259
|
+
strings.push(escapeText(elem.textContent || elem.innerText));
|
|
260
|
+
} else if (elem.innerHTML) {
|
|
261
|
+
strings.push(elem.innerHTML);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
strings.push("</" + tagname + ">");
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return strings.join("")
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function isProperty(elem, key) {
|
|
271
|
+
var type = typeof elem[key];
|
|
272
|
+
|
|
273
|
+
if (key === "style" && Object.keys(elem.style).length > 0) {
|
|
274
|
+
return true
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return elem.hasOwnProperty(key) &&
|
|
278
|
+
(type === "string" || type === "boolean" || type === "number") &&
|
|
279
|
+
key !== "nodeName" && key !== "className" && key !== "tagName" &&
|
|
280
|
+
key !== "textContent" && key !== "innerText" && key !== "namespaceURI" && key !== "innerHTML"
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function stylify(styles) {
|
|
284
|
+
if (typeof styles === 'string') return styles
|
|
285
|
+
var attr = "";
|
|
286
|
+
Object.keys(styles).forEach(function (key) {
|
|
287
|
+
var value = styles[key];
|
|
288
|
+
key = key.replace(/[A-Z]/g, function(c) {
|
|
289
|
+
return "-" + c.toLowerCase();
|
|
290
|
+
});
|
|
291
|
+
attr += key + ":" + value + ";";
|
|
292
|
+
});
|
|
293
|
+
return attr
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function datasetify(elem) {
|
|
297
|
+
var ds = elem.dataset;
|
|
298
|
+
var props = [];
|
|
299
|
+
|
|
300
|
+
for (var key in ds) {
|
|
301
|
+
props.push({ name: "data-" + key, value: ds[key] });
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return props.length ? stringify(props) : ""
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function stringify(list) {
|
|
308
|
+
var attributes = [];
|
|
309
|
+
list.forEach(function (tuple) {
|
|
310
|
+
var name = tuple.name;
|
|
311
|
+
var value = tuple.value;
|
|
312
|
+
|
|
313
|
+
if (name === "style") {
|
|
314
|
+
value = stylify(value);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
attributes.push(name + "=" + "\"" + escapeAttributeValue(value) + "\"");
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
return attributes.length ? " " + attributes.join(" ") : ""
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function properties(elem) {
|
|
324
|
+
var props = [];
|
|
325
|
+
for (var key in elem) {
|
|
326
|
+
if (isProperty(elem, key)) {
|
|
327
|
+
props.push({ name: key, value: elem[key] });
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
for (var ns in elem._attributes) {
|
|
332
|
+
for (var attribute in elem._attributes[ns]) {
|
|
333
|
+
var prop = elem._attributes[ns][attribute];
|
|
334
|
+
var name = (prop.prefix ? prop.prefix + ":" : "") + attribute;
|
|
335
|
+
props.push({ name: name, value: prop.value });
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (elem.className) {
|
|
340
|
+
props.push({ name: "class", value: elem.className });
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return props.length ? stringify(props) : ""
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function escapeText(s) {
|
|
347
|
+
var str = '';
|
|
348
|
+
|
|
349
|
+
if (typeof(s) === 'string') {
|
|
350
|
+
str = s;
|
|
351
|
+
} else if (s) {
|
|
352
|
+
str = s.toString();
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return str
|
|
356
|
+
.replace(/&/g, "&")
|
|
357
|
+
.replace(/</g, "<")
|
|
358
|
+
.replace(/>/g, ">")
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function escapeAttributeValue(str) {
|
|
362
|
+
return escapeText(str).replace(/"/g, """)
|
|
363
|
+
}
|
|
364
|
+
return serialize;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
var domElement;
|
|
368
|
+
var hasRequiredDomElement;
|
|
369
|
+
|
|
370
|
+
function requireDomElement () {
|
|
371
|
+
if (hasRequiredDomElement) return domElement;
|
|
372
|
+
hasRequiredDomElement = 1;
|
|
373
|
+
var domWalk = requireDomWalk();
|
|
374
|
+
var dispatchEvent = requireDispatchEvent();
|
|
375
|
+
var addEventListener = requireAddEventListener();
|
|
376
|
+
var removeEventListener = requireRemoveEventListener();
|
|
377
|
+
var serializeNode = requireSerialize();
|
|
378
|
+
|
|
379
|
+
var htmlns = "http://www.w3.org/1999/xhtml";
|
|
380
|
+
|
|
381
|
+
domElement = DOMElement;
|
|
382
|
+
|
|
383
|
+
function DOMElement(tagName, owner, namespace) {
|
|
384
|
+
if (!(this instanceof DOMElement)) {
|
|
385
|
+
return new DOMElement(tagName)
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
var ns = namespace === undefined ? htmlns : (namespace || null);
|
|
389
|
+
|
|
390
|
+
this.tagName = ns === htmlns ? String(tagName).toUpperCase() : tagName;
|
|
391
|
+
this.nodeName = this.tagName;
|
|
392
|
+
this.className = "";
|
|
393
|
+
this.dataset = {};
|
|
394
|
+
this.childNodes = [];
|
|
395
|
+
this.parentNode = null;
|
|
396
|
+
this.style = {};
|
|
397
|
+
this.ownerDocument = owner || null;
|
|
398
|
+
this.namespaceURI = ns;
|
|
399
|
+
this._attributes = {};
|
|
400
|
+
|
|
401
|
+
if (this.tagName === 'INPUT') {
|
|
402
|
+
this.type = 'text';
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
DOMElement.prototype.type = "DOMElement";
|
|
407
|
+
DOMElement.prototype.nodeType = 1;
|
|
408
|
+
|
|
409
|
+
DOMElement.prototype.appendChild = function _Element_appendChild(child) {
|
|
410
|
+
if (child.parentNode) {
|
|
411
|
+
child.parentNode.removeChild(child);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
this.childNodes.push(child);
|
|
415
|
+
child.parentNode = this;
|
|
416
|
+
|
|
417
|
+
return child
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
DOMElement.prototype.replaceChild =
|
|
421
|
+
function _Element_replaceChild(elem, needle) {
|
|
422
|
+
// TODO: Throw NotFoundError if needle.parentNode !== this
|
|
423
|
+
|
|
424
|
+
if (elem.parentNode) {
|
|
425
|
+
elem.parentNode.removeChild(elem);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
var index = this.childNodes.indexOf(needle);
|
|
429
|
+
|
|
430
|
+
needle.parentNode = null;
|
|
431
|
+
this.childNodes[index] = elem;
|
|
432
|
+
elem.parentNode = this;
|
|
433
|
+
|
|
434
|
+
return needle
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
DOMElement.prototype.removeChild = function _Element_removeChild(elem) {
|
|
438
|
+
// TODO: Throw NotFoundError if elem.parentNode !== this
|
|
439
|
+
|
|
440
|
+
var index = this.childNodes.indexOf(elem);
|
|
441
|
+
this.childNodes.splice(index, 1);
|
|
442
|
+
|
|
443
|
+
elem.parentNode = null;
|
|
444
|
+
return elem
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
DOMElement.prototype.insertBefore =
|
|
448
|
+
function _Element_insertBefore(elem, needle) {
|
|
449
|
+
// TODO: Throw NotFoundError if referenceElement is a dom node
|
|
450
|
+
// and parentNode !== this
|
|
451
|
+
|
|
452
|
+
if (elem.parentNode) {
|
|
453
|
+
elem.parentNode.removeChild(elem);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
var index = needle === null || needle === undefined ?
|
|
457
|
+
-1 :
|
|
458
|
+
this.childNodes.indexOf(needle);
|
|
459
|
+
|
|
460
|
+
if (index > -1) {
|
|
461
|
+
this.childNodes.splice(index, 0, elem);
|
|
462
|
+
} else {
|
|
463
|
+
this.childNodes.push(elem);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
elem.parentNode = this;
|
|
467
|
+
return elem
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
DOMElement.prototype.setAttributeNS =
|
|
471
|
+
function _Element_setAttributeNS(namespace, name, value) {
|
|
472
|
+
var prefix = null;
|
|
473
|
+
var localName = name;
|
|
474
|
+
var colonPosition = name.indexOf(":");
|
|
475
|
+
if (colonPosition > -1) {
|
|
476
|
+
prefix = name.substr(0, colonPosition);
|
|
477
|
+
localName = name.substr(colonPosition + 1);
|
|
478
|
+
}
|
|
479
|
+
if (this.tagName === 'INPUT' && name === 'type') {
|
|
480
|
+
this.type = value;
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
var attributes = this._attributes[namespace] || (this._attributes[namespace] = {});
|
|
484
|
+
attributes[localName] = {value: value, prefix: prefix};
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
DOMElement.prototype.getAttributeNS =
|
|
489
|
+
function _Element_getAttributeNS(namespace, name) {
|
|
490
|
+
var attributes = this._attributes[namespace];
|
|
491
|
+
var value = attributes && attributes[name] && attributes[name].value;
|
|
492
|
+
if (this.tagName === 'INPUT' && name === 'type') {
|
|
493
|
+
return this.type;
|
|
494
|
+
}
|
|
495
|
+
if (typeof value !== "string") {
|
|
496
|
+
return null
|
|
497
|
+
}
|
|
498
|
+
return value
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
DOMElement.prototype.removeAttributeNS =
|
|
502
|
+
function _Element_removeAttributeNS(namespace, name) {
|
|
503
|
+
// Prevent prototype pollution by checking if namespace is a direct property
|
|
504
|
+
if (!Object.prototype.hasOwnProperty.call(this._attributes, namespace)) {
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
var attributes = this._attributes[namespace];
|
|
508
|
+
if (attributes && Object.prototype.hasOwnProperty.call(attributes, name)) {
|
|
509
|
+
delete attributes[name];
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
DOMElement.prototype.hasAttributeNS =
|
|
514
|
+
function _Element_hasAttributeNS(namespace, name) {
|
|
515
|
+
var attributes = this._attributes[namespace];
|
|
516
|
+
return !!attributes && name in attributes;
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
DOMElement.prototype.setAttribute = function _Element_setAttribute(name, value) {
|
|
520
|
+
return this.setAttributeNS(null, name, value)
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
DOMElement.prototype.getAttribute = function _Element_getAttribute(name) {
|
|
524
|
+
return this.getAttributeNS(null, name)
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
DOMElement.prototype.removeAttribute = function _Element_removeAttribute(name) {
|
|
528
|
+
return this.removeAttributeNS(null, name)
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
DOMElement.prototype.hasAttribute = function _Element_hasAttribute(name) {
|
|
532
|
+
return this.hasAttributeNS(null, name)
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
DOMElement.prototype.removeEventListener = removeEventListener;
|
|
536
|
+
DOMElement.prototype.addEventListener = addEventListener;
|
|
537
|
+
DOMElement.prototype.dispatchEvent = dispatchEvent;
|
|
538
|
+
|
|
539
|
+
// Un-implemented
|
|
540
|
+
DOMElement.prototype.focus = function _Element_focus() {
|
|
541
|
+
return void 0
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
DOMElement.prototype.toString = function _Element_toString() {
|
|
545
|
+
return serializeNode(this)
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
DOMElement.prototype.getElementsByClassName = function _Element_getElementsByClassName(classNames) {
|
|
549
|
+
var classes = classNames.split(" ");
|
|
550
|
+
var elems = [];
|
|
551
|
+
|
|
552
|
+
domWalk(this, function (node) {
|
|
553
|
+
if (node.nodeType === 1) {
|
|
554
|
+
var nodeClassName = node.className || "";
|
|
555
|
+
var nodeClasses = nodeClassName.split(" ");
|
|
556
|
+
|
|
557
|
+
if (classes.every(function (item) {
|
|
558
|
+
return nodeClasses.indexOf(item) !== -1
|
|
559
|
+
})) {
|
|
560
|
+
elems.push(node);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
return elems
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
DOMElement.prototype.getElementsByTagName = function _Element_getElementsByTagName(tagName) {
|
|
569
|
+
tagName = tagName.toLowerCase();
|
|
570
|
+
var elems = [];
|
|
571
|
+
|
|
572
|
+
domWalk(this.childNodes, function (node) {
|
|
573
|
+
if (node.nodeType === 1 && (tagName === '*' || node.tagName.toLowerCase() === tagName)) {
|
|
574
|
+
elems.push(node);
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
return elems
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
DOMElement.prototype.contains = function _Element_contains(element) {
|
|
582
|
+
return domWalk(this, function (node) {
|
|
583
|
+
return element === node
|
|
584
|
+
}) || false
|
|
585
|
+
};
|
|
586
|
+
return domElement;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
var domFragment;
|
|
590
|
+
var hasRequiredDomFragment;
|
|
591
|
+
|
|
592
|
+
function requireDomFragment () {
|
|
593
|
+
if (hasRequiredDomFragment) return domFragment;
|
|
594
|
+
hasRequiredDomFragment = 1;
|
|
595
|
+
var DOMElement = requireDomElement();
|
|
596
|
+
|
|
597
|
+
domFragment = DocumentFragment;
|
|
598
|
+
|
|
599
|
+
function DocumentFragment(owner) {
|
|
600
|
+
if (!(this instanceof DocumentFragment)) {
|
|
601
|
+
return new DocumentFragment()
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
this.childNodes = [];
|
|
605
|
+
this.parentNode = null;
|
|
606
|
+
this.ownerDocument = owner || null;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
DocumentFragment.prototype.type = "DocumentFragment";
|
|
610
|
+
DocumentFragment.prototype.nodeType = 11;
|
|
611
|
+
DocumentFragment.prototype.nodeName = "#document-fragment";
|
|
612
|
+
|
|
613
|
+
DocumentFragment.prototype.appendChild = DOMElement.prototype.appendChild;
|
|
614
|
+
DocumentFragment.prototype.replaceChild = DOMElement.prototype.replaceChild;
|
|
615
|
+
DocumentFragment.prototype.removeChild = DOMElement.prototype.removeChild;
|
|
616
|
+
|
|
617
|
+
DocumentFragment.prototype.toString =
|
|
618
|
+
function _DocumentFragment_toString() {
|
|
619
|
+
return this.childNodes.map(function (node) {
|
|
620
|
+
return String(node)
|
|
621
|
+
}).join("")
|
|
622
|
+
};
|
|
623
|
+
return domFragment;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
var event;
|
|
627
|
+
var hasRequiredEvent;
|
|
628
|
+
|
|
629
|
+
function requireEvent () {
|
|
630
|
+
if (hasRequiredEvent) return event;
|
|
631
|
+
hasRequiredEvent = 1;
|
|
632
|
+
event = Event;
|
|
633
|
+
|
|
634
|
+
function Event(family) {}
|
|
635
|
+
|
|
636
|
+
Event.prototype.initEvent = function _Event_initEvent(type, bubbles, cancelable) {
|
|
637
|
+
this.type = type;
|
|
638
|
+
this.bubbles = bubbles;
|
|
639
|
+
this.cancelable = cancelable;
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
Event.prototype.preventDefault = function _Event_preventDefault() {
|
|
643
|
+
|
|
644
|
+
};
|
|
645
|
+
return event;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
var document$2;
|
|
649
|
+
var hasRequiredDocument$1;
|
|
650
|
+
|
|
651
|
+
function requireDocument$1 () {
|
|
652
|
+
if (hasRequiredDocument$1) return document$2;
|
|
653
|
+
hasRequiredDocument$1 = 1;
|
|
654
|
+
var domWalk = requireDomWalk();
|
|
655
|
+
|
|
656
|
+
var Comment = requireDomComment();
|
|
657
|
+
var DOMText = requireDomText();
|
|
658
|
+
var DOMElement = requireDomElement();
|
|
659
|
+
var DocumentFragment = requireDomFragment();
|
|
660
|
+
var Event = requireEvent();
|
|
661
|
+
var dispatchEvent = requireDispatchEvent();
|
|
662
|
+
var addEventListener = requireAddEventListener();
|
|
663
|
+
var removeEventListener = requireRemoveEventListener();
|
|
664
|
+
|
|
665
|
+
document$2 = Document;
|
|
666
|
+
|
|
667
|
+
function Document() {
|
|
668
|
+
if (!(this instanceof Document)) {
|
|
669
|
+
return new Document();
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
this.head = this.createElement("head");
|
|
673
|
+
this.body = this.createElement("body");
|
|
674
|
+
this.documentElement = this.createElement("html");
|
|
675
|
+
this.documentElement.appendChild(this.head);
|
|
676
|
+
this.documentElement.appendChild(this.body);
|
|
677
|
+
this.childNodes = [this.documentElement];
|
|
678
|
+
this.nodeType = 9;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
var proto = Document.prototype;
|
|
682
|
+
proto.createTextNode = function createTextNode(value) {
|
|
683
|
+
return new DOMText(value, this)
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
proto.createElementNS = function createElementNS(namespace, tagName) {
|
|
687
|
+
var ns = namespace === null ? null : String(namespace);
|
|
688
|
+
return new DOMElement(tagName, this, ns)
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
proto.createElement = function createElement(tagName) {
|
|
692
|
+
return new DOMElement(tagName, this)
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
proto.createDocumentFragment = function createDocumentFragment() {
|
|
696
|
+
return new DocumentFragment(this)
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
proto.createEvent = function createEvent(family) {
|
|
700
|
+
return new Event(family)
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
proto.createComment = function createComment(data) {
|
|
704
|
+
return new Comment(data, this)
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
proto.getElementById = function getElementById(id) {
|
|
708
|
+
id = String(id);
|
|
709
|
+
|
|
710
|
+
var result = domWalk(this.childNodes, function (node) {
|
|
711
|
+
if (String(node.id) === id) {
|
|
712
|
+
return node
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
return result || null
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
proto.getElementsByClassName = DOMElement.prototype.getElementsByClassName;
|
|
720
|
+
proto.getElementsByTagName = DOMElement.prototype.getElementsByTagName;
|
|
721
|
+
proto.contains = DOMElement.prototype.contains;
|
|
722
|
+
|
|
723
|
+
proto.removeEventListener = removeEventListener;
|
|
724
|
+
proto.addEventListener = addEventListener;
|
|
725
|
+
proto.dispatchEvent = dispatchEvent;
|
|
726
|
+
return document$2;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
var minDocument;
|
|
730
|
+
var hasRequiredMinDocument;
|
|
731
|
+
|
|
732
|
+
function requireMinDocument () {
|
|
733
|
+
if (hasRequiredMinDocument) return minDocument;
|
|
734
|
+
hasRequiredMinDocument = 1;
|
|
735
|
+
var Document = requireDocument$1();
|
|
736
|
+
|
|
737
|
+
minDocument = new Document();
|
|
738
|
+
return minDocument;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
var document_1;
|
|
742
|
+
var hasRequiredDocument;
|
|
743
|
+
|
|
744
|
+
function requireDocument () {
|
|
745
|
+
if (hasRequiredDocument) return document_1;
|
|
746
|
+
hasRequiredDocument = 1;
|
|
747
|
+
var topLevel = typeof commonjsGlobal !== 'undefined' ? commonjsGlobal :
|
|
748
|
+
typeof window !== 'undefined' ? window : {};
|
|
749
|
+
var minDoc = requireMinDocument();
|
|
750
|
+
|
|
751
|
+
var doccy;
|
|
752
|
+
|
|
753
|
+
if (typeof document !== 'undefined') {
|
|
754
|
+
doccy = document;
|
|
755
|
+
} else {
|
|
756
|
+
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
|
|
757
|
+
|
|
758
|
+
if (!doccy) {
|
|
759
|
+
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
document_1 = doccy;
|
|
764
|
+
return document_1;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
var documentExports = requireDocument();
|
|
768
|
+
var document$1 = /*@__PURE__*/getDefaultExportFromCjs(documentExports);
|
|
769
|
+
|
|
770
|
+
export { document$1 as d, window$1 as w };
|