@ix_waterford/lib 1.0.6 → 1.0.8

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.
Files changed (36) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.js +122379 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +5 -5
  5. package/dist/static/js/async/reactPlayerDash.js +0 -351
  6. package/dist/static/js/async/reactPlayerDash.js.map +0 -1
  7. package/dist/static/js/async/reactPlayerHls.js +0 -430
  8. package/dist/static/js/async/reactPlayerHls.js.map +0 -1
  9. package/dist/static/js/async/reactPlayerMux.js +0 -16076
  10. package/dist/static/js/async/reactPlayerMux.js.map +0 -1
  11. package/dist/static/js/async/reactPlayerPreview.js +0 -112
  12. package/dist/static/js/async/reactPlayerPreview.js.map +0 -1
  13. package/dist/static/js/async/reactPlayerSpotify.js +0 -519
  14. package/dist/static/js/async/reactPlayerSpotify.js.map +0 -1
  15. package/dist/static/js/async/reactPlayerTiktok.js +0 -489
  16. package/dist/static/js/async/reactPlayerTiktok.js.map +0 -1
  17. package/dist/static/js/async/reactPlayerTwitch.js +0 -587
  18. package/dist/static/js/async/reactPlayerTwitch.js.map +0 -1
  19. package/dist/static/js/async/reactPlayerVimeo.js +0 -4265
  20. package/dist/static/js/async/reactPlayerVimeo.js.map +0 -1
  21. package/dist/static/js/async/reactPlayerWistia.js +0 -768
  22. package/dist/static/js/async/reactPlayerWistia.js.map +0 -1
  23. package/dist/static/js/async/reactPlayerYouTube.js +0 -739
  24. package/dist/static/js/async/reactPlayerYouTube.js.map +0 -1
  25. package/dist/static/js/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js +0 -1254
  26. package/dist/static/js/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js.map +0 -1
  27. package/dist/static/js/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js +0 -22
  28. package/dist/static/js/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js.map +0 -1
  29. package/dist/static/js/async/vendors-node_modules_hls_js_dist_hls_mjs.js +0 -36692
  30. package/dist/static/js/async/vendors-node_modules_hls_js_dist_hls_mjs.js.map +0 -1
  31. package/dist/static/js/index.js +0 -6362
  32. package/dist/static/js/index.js.map +0 -1
  33. package/dist/static/js/lib-react.js +0 -3235
  34. package/dist/static/js/lib-react.js.map +0 -1
  35. package/dist/static/js/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-897cfa.js +0 -113737
  36. package/dist/static/js/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-897cfa.js.map +0 -1
@@ -1,489 +0,0 @@
1
- "use strict";
2
- (self["webpackChunk_ix_waterford_lib"] = self["webpackChunk_ix_waterford_lib"] || []).push([["reactPlayerTiktok"], {
3
- "./node_modules/tiktok-video-element/dist/react.js": (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
4
- __webpack_require__.r(__webpack_exports__);
5
- __webpack_require__.d(__webpack_exports__, {
6
- "default": () => (react_default)
7
- });
8
- /* import */var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/react/index.js");
9
- /* import */var _tiktok_video_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/tiktok-video-element/dist/tiktok-video-element.js");
10
- "use client";
11
-
12
- // dist/react.ts
13
-
14
-
15
-
16
- // ../../node_modules/ce-la-react/dist/ce-la-react.js
17
- var reservedReactProps = /* @__PURE__ */ new Set([
18
- "style",
19
- "children",
20
- "ref",
21
- "key",
22
- "suppressContentEditableWarning",
23
- "suppressHydrationWarning",
24
- "dangerouslySetInnerHTML"
25
- ]);
26
- var reactPropToAttrNameMap = {
27
- className: "class",
28
- htmlFor: "for"
29
- };
30
- function defaultToAttributeName(propName) {
31
- return propName.toLowerCase();
32
- }
33
- function defaultToAttributeValue(propValue) {
34
- if (typeof propValue === "boolean") return propValue ? "" : void 0;
35
- if (typeof propValue === "function") return void 0;
36
- if (typeof propValue === "object" && propValue !== null) return void 0;
37
- return propValue;
38
- }
39
- function createComponent({
40
- react: React2,
41
- tagName,
42
- elementClass,
43
- events,
44
- displayName,
45
- defaultProps,
46
- toAttributeName = defaultToAttributeName,
47
- toAttributeValue = defaultToAttributeValue
48
- }) {
49
- const IS_REACT_19_OR_NEWER = Number.parseInt(React2.version) >= 19;
50
- const ReactComponent = React2.forwardRef((props, ref) => {
51
- var _a, _b;
52
- const elementRef = React2.useRef(null);
53
- const prevElemPropsRef = React2.useRef(/* @__PURE__ */ new Map());
54
- const eventProps = {};
55
- const attrs = {};
56
- const reactProps = {};
57
- const elementProps = {};
58
- for (const [k, v] of Object.entries(props)) {
59
- if (reservedReactProps.has(k)) {
60
- reactProps[k] = v;
61
- continue;
62
- }
63
- const attrName = toAttributeName(reactPropToAttrNameMap[k] ?? k);
64
- if (elementClass.prototype && k in elementClass.prototype && !(k in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) && !((_b = elementClass.observedAttributes) == null ? void 0 : _b.some((attr) => attr === attrName))) {
65
- elementProps[k] = v;
66
- continue;
67
- }
68
- if (k.startsWith("on")) {
69
- eventProps[k] = v;
70
- continue;
71
- }
72
- const attrValue = toAttributeValue(v);
73
- if (attrName && attrValue != null) {
74
- attrs[attrName] = String(attrValue);
75
- if (!IS_REACT_19_OR_NEWER) {
76
- reactProps[attrName] = attrValue;
77
- }
78
- }
79
- if (attrName && IS_REACT_19_OR_NEWER) {
80
- const attrValueFromDefault = defaultToAttributeValue(v);
81
- if (attrValue !== attrValueFromDefault) {
82
- reactProps[attrName] = attrValue;
83
- } else {
84
- reactProps[attrName] = v;
85
- }
86
- }
87
- }
88
- if (typeof window !== "undefined") {
89
- for (const propName in eventProps) {
90
- const callback = eventProps[propName];
91
- const useCapture = propName.endsWith("Capture");
92
- const eventName = ((events == null ? void 0 : events[propName]) ?? propName.slice(2).toLowerCase()).slice(
93
- 0,
94
- useCapture ? -7 : void 0
95
- );
96
- React2.useLayoutEffect(() => {
97
- const eventTarget = elementRef == null ? void 0 : elementRef.current;
98
- if (!eventTarget || typeof callback !== "function") return;
99
- eventTarget.addEventListener(eventName, callback, useCapture);
100
- return () => {
101
- eventTarget.removeEventListener(eventName, callback, useCapture);
102
- };
103
- }, [elementRef == null ? void 0 : elementRef.current, callback]);
104
- }
105
- React2.useLayoutEffect(() => {
106
- if (elementRef.current === null) return;
107
- const newElemProps = /* @__PURE__ */ new Map();
108
- for (const key in elementProps) {
109
- setProperty(elementRef.current, key, elementProps[key]);
110
- prevElemPropsRef.current.delete(key);
111
- newElemProps.set(key, elementProps[key]);
112
- }
113
- for (const [key, _value] of prevElemPropsRef.current) {
114
- setProperty(elementRef.current, key, void 0);
115
- }
116
- prevElemPropsRef.current = newElemProps;
117
- });
118
- }
119
- if (typeof window === "undefined" && (elementClass == null ? void 0 : elementClass.getTemplateHTML) && (elementClass == null ? void 0 : elementClass.shadowRootOptions)) {
120
- const { mode, delegatesFocus } = elementClass.shadowRootOptions;
121
- const templateShadowRoot = React2.createElement("template", {
122
- shadowrootmode: mode,
123
- shadowrootdelegatesfocus: delegatesFocus,
124
- dangerouslySetInnerHTML: {
125
- __html: elementClass.getTemplateHTML(attrs, props)
126
- }
127
- });
128
- reactProps.children = [templateShadowRoot, reactProps.children];
129
- }
130
- return React2.createElement(tagName, {
131
- ...defaultProps,
132
- ...reactProps,
133
- ref: React2.useCallback(
134
- (node) => {
135
- elementRef.current = node;
136
- if (typeof ref === "function") {
137
- ref(node);
138
- } else if (ref !== null) {
139
- ref.current = node;
140
- }
141
- },
142
- [ref]
143
- )
144
- });
145
- });
146
- ReactComponent.displayName = displayName ?? elementClass.name;
147
- return ReactComponent;
148
- }
149
- function setProperty(node, name, value) {
150
- var _a;
151
- node[name] = value;
152
- if (value == null && name in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) {
153
- node.removeAttribute(name);
154
- }
155
- }
156
-
157
- // dist/react.ts
158
- var react_default = createComponent({
159
- react: react__WEBPACK_IMPORTED_MODULE_0__,
160
- tagName: "tiktok-video",
161
- elementClass: _tiktok_video_element_js__WEBPACK_IMPORTED_MODULE_1__["default"],
162
- toAttributeName(propName) {
163
- if (propName === "muted") return "";
164
- if (propName === "defaultMuted") return "muted";
165
- return defaultToAttributeName(propName);
166
- }
167
- });
168
-
169
- /*! Bundled license information:
170
-
171
- ce-la-react/dist/ce-la-react.js:
172
- (**
173
- * @license
174
- * Copyright 2018 Google LLC
175
- * SPDX-License-Identifier: BSD-3-Clause
176
- *
177
- * Modified version of `@lit/react` for vanilla custom elements with support for SSR.
178
- *)
179
- */
180
-
181
-
182
- }),
183
- "./node_modules/tiktok-video-element/dist/tiktok-video-element.js": (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
184
- __webpack_require__.r(__webpack_exports__);
185
- __webpack_require__.d(__webpack_exports__, {
186
- "default": () => (tiktok_video_element_default)
187
- });
188
- const EMBED_BASE = "https://www.tiktok.com/player/v1";
189
- const MATCH_SRC = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/;
190
- const PlayerState = { INIT: -1, ENDED: 0, PLAYING: 1, PAUSED: 2, BUFFERING: 3 };
191
- const EventMap = {
192
- [PlayerState.INIT]: "emptied",
193
- [PlayerState.PAUSED]: "pause",
194
- [PlayerState.ENDED]: "ended",
195
- [PlayerState.PLAYING]: "play",
196
- [PlayerState.BUFFERING]: "waiting"
197
- };
198
- function getTemplateHTML(attrs, props = {}) {
199
- const iframeAttrs = {
200
- src: serializeIframeUrl(attrs, props),
201
- frameborder: 0,
202
- width: "100%",
203
- height: "100%",
204
- allow: "accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture"
205
- };
206
- if (props.config) {
207
- iframeAttrs["data-config"] = JSON.stringify(props.config);
208
- }
209
- return (
210
- /*html*/
211
- `
212
- <style>
213
- :host {
214
- display:inline-block;
215
- min-width: 300px;
216
- min-height: 150px;
217
- position: relative;
218
- }
219
- iframe {
220
- position:absolute;
221
- top:0;
222
- left:0;
223
- width:100%;
224
- height:100%;
225
- border:0;
226
- }
227
- </style>
228
- <iframe ${serializeAttributes(iframeAttrs)} title="TikTok video"></iframe>
229
- `
230
- );
231
- }
232
- function serializeIframeUrl(attrs, props = {}) {
233
- if (!attrs.src) return;
234
- const matches = attrs.src.match(MATCH_SRC);
235
- const srcId = matches && matches[1];
236
- const params = {
237
- controls: attrs.controls === "" ? null : 0,
238
- autoplay: attrs.autoplay,
239
- muted: attrs.muted,
240
- loop: attrs.loop,
241
- rel: 0,
242
- ...props.config
243
- };
244
- return `${EMBED_BASE}/${srcId}?${serialize(params)}`;
245
- }
246
- class TikTokVideoElement extends (globalThis.HTMLElement ?? class {
247
- }) {
248
- static getTemplateHTML = getTemplateHTML;
249
- static shadowRootOptions = { mode: "open" };
250
- static get observedAttributes() {
251
- return ["src", "controls", "loop", "autoplay", "muted"];
252
- }
253
- loadComplete = new PublicPromise();
254
- #loadRequested;
255
- #hasLoaded;
256
- #muted = false;
257
- #currentTime = 0;
258
- #paused = true;
259
- #config = null;
260
- #volume = 100;
261
- #duration = 0;
262
- #iframe;
263
- constructor() {
264
- super();
265
- this.#upgradeProperty("config");
266
- }
267
- async load() {
268
- if (this.#loadRequested) return;
269
- if (!this.shadowRoot) {
270
- this.attachShadow(TikTokVideoElement.shadowRootOptions);
271
- }
272
- const isFirstLoad = !this.#hasLoaded;
273
- if (this.#hasLoaded) {
274
- this.loadComplete = new PublicPromise();
275
- }
276
- this.#hasLoaded = true;
277
- await (this.#loadRequested = Promise.resolve());
278
- this.#loadRequested = null;
279
- this.#currentTime = 0;
280
- this.#muted = false;
281
- this.#paused = true;
282
- if (!this.src) {
283
- this.shadowRoot.innerHTML = "";
284
- globalThis.removeEventListener("message", this.#onMessage);
285
- return;
286
- }
287
- let iframe = this.shadowRoot.querySelector("iframe");
288
- const attrs = namedNodeMapToObject(this.attributes);
289
- if (isFirstLoad && iframe) {
290
- this.#config = JSON.parse(iframe.getAttribute("data-config") || "{}");
291
- }
292
- if (!(iframe == null ? void 0 : iframe.src) || iframe.src !== serializeIframeUrl(attrs, this)) {
293
- this.shadowRoot.innerHTML = getTemplateHTML(attrs, this);
294
- iframe = this.shadowRoot.querySelector("iframe");
295
- }
296
- this.#iframe = iframe;
297
- globalThis.addEventListener("message", this.#onMessage);
298
- }
299
- async attributeChangedCallback(attrName, oldValue, newValue) {
300
- if (oldValue === newValue) return;
301
- switch (attrName) {
302
- case "muted": {
303
- await this.loadComplete;
304
- this.muted = newValue != null;
305
- break;
306
- }
307
- case "autoplay":
308
- case "controls":
309
- case "loop":
310
- case "src": {
311
- this.load();
312
- return;
313
- }
314
- }
315
- }
316
- get config() {
317
- return this.#config;
318
- }
319
- set config(value) {
320
- this.#config = value;
321
- }
322
- #onMessage = (event) => {
323
- var _a;
324
- if (event.source !== ((_a = this.#iframe) == null ? void 0 : _a.contentWindow)) return;
325
- const msg = event.data;
326
- if (!(msg == null ? void 0 : msg["x-tiktok-player"])) return;
327
- switch (msg.type) {
328
- case "onPlayerReady":
329
- this.loadComplete.resolve();
330
- break;
331
- case "onStateChange": {
332
- this.#paused = [PlayerState.INIT, PlayerState.PAUSED, PlayerState.ENDED].includes(msg.value);
333
- const eventType = EventMap[msg.value];
334
- if (eventType) this.dispatchEvent(new Event(eventType));
335
- break;
336
- }
337
- case "onCurrentTime":
338
- this.#currentTime = msg.value.currentTime;
339
- this.#duration = msg.value.duration;
340
- this.dispatchEvent(new Event("durationchange"));
341
- this.dispatchEvent(new Event("timeupdate"));
342
- break;
343
- case "onVolumeChange":
344
- this.#volume = msg.value;
345
- this.dispatchEvent(new Event("volumechange"));
346
- break;
347
- case "onMute":
348
- this.#muted = msg.value ? true : false;
349
- this.#volume = msg.value ? 0 : this.#volume;
350
- this.dispatchEvent(new Event("volumechange"));
351
- break;
352
- case "onError":
353
- this.dispatchEvent(new Event("error"));
354
- break;
355
- default:
356
- console.warn("Unhandled TikTok player message:", msg);
357
- break;
358
- }
359
- };
360
- #post(type, value) {
361
- var _a;
362
- if (!((_a = this.#iframe) == null ? void 0 : _a.contentWindow)) return;
363
- const message = { "x-tiktok-player": true, type, ...value !== void 0 ? { value } : {} };
364
- this.#iframe.contentWindow.postMessage(message, "*");
365
- }
366
- async play() {
367
- await this.loadComplete;
368
- this.#post("play");
369
- }
370
- async pause() {
371
- await this.loadComplete;
372
- this.#post("pause");
373
- }
374
- async #seekTo(sec) {
375
- await this.loadComplete;
376
- this.#post("seekTo", Number(sec));
377
- }
378
- async #mute() {
379
- await this.loadComplete;
380
- this.#post("mute");
381
- }
382
- async #unMute() {
383
- await this.loadComplete;
384
- this.#post("unMute");
385
- }
386
- get volume() {
387
- return this.#volume / 100;
388
- }
389
- set volume(_val) {
390
- console.warn("Volume control is not supported for TikTok videos.");
391
- }
392
- get currentTime() {
393
- return this.#currentTime;
394
- }
395
- set currentTime(val) {
396
- this.#seekTo(val);
397
- }
398
- get muted() {
399
- return this.#muted;
400
- }
401
- set muted(val) {
402
- this.#muted = val;
403
- val ? this.#mute() : this.#unMute();
404
- }
405
- get defaultMuted() {
406
- return this.hasAttribute("muted");
407
- }
408
- set defaultMuted(val) {
409
- this.toggleAttribute("muted", !!val);
410
- }
411
- get paused() {
412
- return this.#paused;
413
- }
414
- get duration() {
415
- return this.#duration;
416
- }
417
- get src() {
418
- return this.getAttribute("src");
419
- }
420
- set src(val) {
421
- this.setAttribute("src", val ?? "");
422
- }
423
- // This is a pattern to update property values that are set before
424
- // the custom element is upgraded.
425
- // https://web.dev/custom-elements-best-practices/#make-properties-lazy
426
- #upgradeProperty(prop) {
427
- if (Object.prototype.hasOwnProperty.call(this, prop)) {
428
- const value = this[prop];
429
- delete this[prop];
430
- this[prop] = value;
431
- }
432
- }
433
- }
434
- class PublicPromise extends Promise {
435
- constructor(executor = () => {
436
- }) {
437
- let res, rej;
438
- super((resolve, reject) => {
439
- executor(resolve, reject);
440
- res = resolve;
441
- rej = reject;
442
- });
443
- this.resolve = res;
444
- this.reject = rej;
445
- }
446
- }
447
- function namedNodeMapToObject(namedNodeMap) {
448
- let obj = {};
449
- for (let attr of namedNodeMap) {
450
- obj[attr.name] = attr.value;
451
- }
452
- return obj;
453
- }
454
- function boolToBinary(props) {
455
- let p = {};
456
- for (let key in props) {
457
- let val = props[key];
458
- if (val === true || val === "") p[key] = 1;
459
- else if (val === false) p[key] = 0;
460
- else if (val != null) p[key] = val;
461
- }
462
- return p;
463
- }
464
- function serialize(props) {
465
- return String(new URLSearchParams(boolToBinary(props)));
466
- }
467
- function serializeAttributes(attrs) {
468
- let html = "";
469
- for (const key in attrs) {
470
- const value = attrs[key];
471
- if (value === "") html += ` ${escapeHtml(key)}`;
472
- else html += ` ${escapeHtml(key)}="${escapeHtml(`${value}`)}"`;
473
- }
474
- return html;
475
- }
476
- function escapeHtml(str) {
477
- return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/`/g, "&#x60;");
478
- }
479
- if (globalThis.customElements && !globalThis.customElements.get("tiktok-video")) {
480
- globalThis.customElements.define("tiktok-video", TikTokVideoElement);
481
- }
482
- var tiktok_video_element_default = TikTokVideoElement;
483
-
484
-
485
-
486
- }),
487
-
488
- }]);
489
- //# sourceMappingURL=reactPlayerTiktok.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/js/async/reactPlayerTiktok.js","sources":["/Users/kirubakaran.r/Documents/projects/hub/components/waterford_library/node_modules/tiktok-video-element/dist/react.js","/Users/kirubakaran.r/Documents/projects/hub/components/waterford_library/node_modules/tiktok-video-element/dist/tiktok-video-element.js"],"sourcesContent":["\"use client\";\n\n// dist/react.ts\nimport React from \"react\";\nimport CustomMediaElement from \"./tiktok-video-element.js\";\n\n// ../../node_modules/ce-la-react/dist/ce-la-react.js\nvar reservedReactProps = /* @__PURE__ */ new Set([\n \"style\",\n \"children\",\n \"ref\",\n \"key\",\n \"suppressContentEditableWarning\",\n \"suppressHydrationWarning\",\n \"dangerouslySetInnerHTML\"\n]);\nvar reactPropToAttrNameMap = {\n className: \"class\",\n htmlFor: \"for\"\n};\nfunction defaultToAttributeName(propName) {\n return propName.toLowerCase();\n}\nfunction defaultToAttributeValue(propValue) {\n if (typeof propValue === \"boolean\") return propValue ? \"\" : void 0;\n if (typeof propValue === \"function\") return void 0;\n if (typeof propValue === \"object\" && propValue !== null) return void 0;\n return propValue;\n}\nfunction createComponent({\n react: React2,\n tagName,\n elementClass,\n events,\n displayName,\n defaultProps,\n toAttributeName = defaultToAttributeName,\n toAttributeValue = defaultToAttributeValue\n}) {\n const IS_REACT_19_OR_NEWER = Number.parseInt(React2.version) >= 19;\n const ReactComponent = React2.forwardRef((props, ref) => {\n var _a, _b;\n const elementRef = React2.useRef(null);\n const prevElemPropsRef = React2.useRef(/* @__PURE__ */ new Map());\n const eventProps = {};\n const attrs = {};\n const reactProps = {};\n const elementProps = {};\n for (const [k, v] of Object.entries(props)) {\n if (reservedReactProps.has(k)) {\n reactProps[k] = v;\n continue;\n }\n const attrName = toAttributeName(reactPropToAttrNameMap[k] ?? k);\n if (elementClass.prototype && k in elementClass.prototype && !(k in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) && !((_b = elementClass.observedAttributes) == null ? void 0 : _b.some((attr) => attr === attrName))) {\n elementProps[k] = v;\n continue;\n }\n if (k.startsWith(\"on\")) {\n eventProps[k] = v;\n continue;\n }\n const attrValue = toAttributeValue(v);\n if (attrName && attrValue != null) {\n attrs[attrName] = String(attrValue);\n if (!IS_REACT_19_OR_NEWER) {\n reactProps[attrName] = attrValue;\n }\n }\n if (attrName && IS_REACT_19_OR_NEWER) {\n const attrValueFromDefault = defaultToAttributeValue(v);\n if (attrValue !== attrValueFromDefault) {\n reactProps[attrName] = attrValue;\n } else {\n reactProps[attrName] = v;\n }\n }\n }\n if (typeof window !== \"undefined\") {\n for (const propName in eventProps) {\n const callback = eventProps[propName];\n const useCapture = propName.endsWith(\"Capture\");\n const eventName = ((events == null ? void 0 : events[propName]) ?? propName.slice(2).toLowerCase()).slice(\n 0,\n useCapture ? -7 : void 0\n );\n React2.useLayoutEffect(() => {\n const eventTarget = elementRef == null ? void 0 : elementRef.current;\n if (!eventTarget || typeof callback !== \"function\") return;\n eventTarget.addEventListener(eventName, callback, useCapture);\n return () => {\n eventTarget.removeEventListener(eventName, callback, useCapture);\n };\n }, [elementRef == null ? void 0 : elementRef.current, callback]);\n }\n React2.useLayoutEffect(() => {\n if (elementRef.current === null) return;\n const newElemProps = /* @__PURE__ */ new Map();\n for (const key in elementProps) {\n setProperty(elementRef.current, key, elementProps[key]);\n prevElemPropsRef.current.delete(key);\n newElemProps.set(key, elementProps[key]);\n }\n for (const [key, _value] of prevElemPropsRef.current) {\n setProperty(elementRef.current, key, void 0);\n }\n prevElemPropsRef.current = newElemProps;\n });\n }\n if (typeof window === \"undefined\" && (elementClass == null ? void 0 : elementClass.getTemplateHTML) && (elementClass == null ? void 0 : elementClass.shadowRootOptions)) {\n const { mode, delegatesFocus } = elementClass.shadowRootOptions;\n const templateShadowRoot = React2.createElement(\"template\", {\n shadowrootmode: mode,\n shadowrootdelegatesfocus: delegatesFocus,\n dangerouslySetInnerHTML: {\n __html: elementClass.getTemplateHTML(attrs, props)\n }\n });\n reactProps.children = [templateShadowRoot, reactProps.children];\n }\n return React2.createElement(tagName, {\n ...defaultProps,\n ...reactProps,\n ref: React2.useCallback(\n (node) => {\n elementRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref !== null) {\n ref.current = node;\n }\n },\n [ref]\n )\n });\n });\n ReactComponent.displayName = displayName ?? elementClass.name;\n return ReactComponent;\n}\nfunction setProperty(node, name, value) {\n var _a;\n node[name] = value;\n if (value == null && name in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) {\n node.removeAttribute(name);\n }\n}\n\n// dist/react.ts\nvar react_default = createComponent({\n react: React,\n tagName: \"tiktok-video\",\n elementClass: CustomMediaElement,\n toAttributeName(propName) {\n if (propName === \"muted\") return \"\";\n if (propName === \"defaultMuted\") return \"muted\";\n return defaultToAttributeName(propName);\n }\n});\nexport {\n react_default as default\n};\n/*! Bundled license information:\n\nce-la-react/dist/ce-la-react.js:\n (**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Modified version of `@lit/react` for vanilla custom elements with support for SSR.\n *)\n*/\n","const EMBED_BASE = \"https://www.tiktok.com/player/v1\";\nconst MATCH_SRC = /tiktok\\.com\\/(?:player\\/v1\\/|share\\/video\\/|@[^/]+\\/video\\/)([0-9]+)/;\nconst PlayerState = { INIT: -1, ENDED: 0, PLAYING: 1, PAUSED: 2, BUFFERING: 3 };\nconst EventMap = {\n [PlayerState.INIT]: \"emptied\",\n [PlayerState.PAUSED]: \"pause\",\n [PlayerState.ENDED]: \"ended\",\n [PlayerState.PLAYING]: \"play\",\n [PlayerState.BUFFERING]: \"waiting\"\n};\nfunction getTemplateHTML(attrs, props = {}) {\n const iframeAttrs = {\n src: serializeIframeUrl(attrs, props),\n frameborder: 0,\n width: \"100%\",\n height: \"100%\",\n allow: \"accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture\"\n };\n if (props.config) {\n iframeAttrs[\"data-config\"] = JSON.stringify(props.config);\n }\n return (\n /*html*/\n `\n <style>\n :host {\n display:inline-block;\n min-width: 300px;\n min-height: 150px;\n position: relative;\n }\n iframe {\n position:absolute;\n top:0;\n left:0;\n width:100%;\n height:100%;\n border:0;\n }\n </style>\n <iframe ${serializeAttributes(iframeAttrs)} title=\"TikTok video\"></iframe>\n `\n );\n}\nfunction serializeIframeUrl(attrs, props = {}) {\n if (!attrs.src) return;\n const matches = attrs.src.match(MATCH_SRC);\n const srcId = matches && matches[1];\n const params = {\n controls: attrs.controls === \"\" ? null : 0,\n autoplay: attrs.autoplay,\n muted: attrs.muted,\n loop: attrs.loop,\n rel: 0,\n ...props.config\n };\n return `${EMBED_BASE}/${srcId}?${serialize(params)}`;\n}\nclass TikTokVideoElement extends (globalThis.HTMLElement ?? class {\n}) {\n static getTemplateHTML = getTemplateHTML;\n static shadowRootOptions = { mode: \"open\" };\n static get observedAttributes() {\n return [\"src\", \"controls\", \"loop\", \"autoplay\", \"muted\"];\n }\n loadComplete = new PublicPromise();\n #loadRequested;\n #hasLoaded;\n #muted = false;\n #currentTime = 0;\n #paused = true;\n #config = null;\n #volume = 100;\n #duration = 0;\n #iframe;\n constructor() {\n super();\n this.#upgradeProperty(\"config\");\n }\n async load() {\n if (this.#loadRequested) return;\n if (!this.shadowRoot) {\n this.attachShadow(TikTokVideoElement.shadowRootOptions);\n }\n const isFirstLoad = !this.#hasLoaded;\n if (this.#hasLoaded) {\n this.loadComplete = new PublicPromise();\n }\n this.#hasLoaded = true;\n await (this.#loadRequested = Promise.resolve());\n this.#loadRequested = null;\n this.#currentTime = 0;\n this.#muted = false;\n this.#paused = true;\n if (!this.src) {\n this.shadowRoot.innerHTML = \"\";\n globalThis.removeEventListener(\"message\", this.#onMessage);\n return;\n }\n let iframe = this.shadowRoot.querySelector(\"iframe\");\n const attrs = namedNodeMapToObject(this.attributes);\n if (isFirstLoad && iframe) {\n this.#config = JSON.parse(iframe.getAttribute(\"data-config\") || \"{}\");\n }\n if (!(iframe == null ? void 0 : iframe.src) || iframe.src !== serializeIframeUrl(attrs, this)) {\n this.shadowRoot.innerHTML = getTemplateHTML(attrs, this);\n iframe = this.shadowRoot.querySelector(\"iframe\");\n }\n this.#iframe = iframe;\n globalThis.addEventListener(\"message\", this.#onMessage);\n }\n async attributeChangedCallback(attrName, oldValue, newValue) {\n if (oldValue === newValue) return;\n switch (attrName) {\n case \"muted\": {\n await this.loadComplete;\n this.muted = newValue != null;\n break;\n }\n case \"autoplay\":\n case \"controls\":\n case \"loop\":\n case \"src\": {\n this.load();\n return;\n }\n }\n }\n get config() {\n return this.#config;\n }\n set config(value) {\n this.#config = value;\n }\n #onMessage = (event) => {\n var _a;\n if (event.source !== ((_a = this.#iframe) == null ? void 0 : _a.contentWindow)) return;\n const msg = event.data;\n if (!(msg == null ? void 0 : msg[\"x-tiktok-player\"])) return;\n switch (msg.type) {\n case \"onPlayerReady\":\n this.loadComplete.resolve();\n break;\n case \"onStateChange\": {\n this.#paused = [PlayerState.INIT, PlayerState.PAUSED, PlayerState.ENDED].includes(msg.value);\n const eventType = EventMap[msg.value];\n if (eventType) this.dispatchEvent(new Event(eventType));\n break;\n }\n case \"onCurrentTime\":\n this.#currentTime = msg.value.currentTime;\n this.#duration = msg.value.duration;\n this.dispatchEvent(new Event(\"durationchange\"));\n this.dispatchEvent(new Event(\"timeupdate\"));\n break;\n case \"onVolumeChange\":\n this.#volume = msg.value;\n this.dispatchEvent(new Event(\"volumechange\"));\n break;\n case \"onMute\":\n this.#muted = msg.value ? true : false;\n this.#volume = msg.value ? 0 : this.#volume;\n this.dispatchEvent(new Event(\"volumechange\"));\n break;\n case \"onError\":\n this.dispatchEvent(new Event(\"error\"));\n break;\n default:\n console.warn(\"Unhandled TikTok player message:\", msg);\n break;\n }\n };\n #post(type, value) {\n var _a;\n if (!((_a = this.#iframe) == null ? void 0 : _a.contentWindow)) return;\n const message = { \"x-tiktok-player\": true, type, ...value !== void 0 ? { value } : {} };\n this.#iframe.contentWindow.postMessage(message, \"*\");\n }\n async play() {\n await this.loadComplete;\n this.#post(\"play\");\n }\n async pause() {\n await this.loadComplete;\n this.#post(\"pause\");\n }\n async #seekTo(sec) {\n await this.loadComplete;\n this.#post(\"seekTo\", Number(sec));\n }\n async #mute() {\n await this.loadComplete;\n this.#post(\"mute\");\n }\n async #unMute() {\n await this.loadComplete;\n this.#post(\"unMute\");\n }\n get volume() {\n return this.#volume / 100;\n }\n set volume(_val) {\n console.warn(\"Volume control is not supported for TikTok videos.\");\n }\n get currentTime() {\n return this.#currentTime;\n }\n set currentTime(val) {\n this.#seekTo(val);\n }\n get muted() {\n return this.#muted;\n }\n set muted(val) {\n this.#muted = val;\n val ? this.#mute() : this.#unMute();\n }\n get defaultMuted() {\n return this.hasAttribute(\"muted\");\n }\n set defaultMuted(val) {\n this.toggleAttribute(\"muted\", !!val);\n }\n get paused() {\n return this.#paused;\n }\n get duration() {\n return this.#duration;\n }\n get src() {\n return this.getAttribute(\"src\");\n }\n set src(val) {\n this.setAttribute(\"src\", val ?? \"\");\n }\n // This is a pattern to update property values that are set before\n // the custom element is upgraded.\n // https://web.dev/custom-elements-best-practices/#make-properties-lazy\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n}\nclass PublicPromise extends Promise {\n constructor(executor = () => {\n }) {\n let res, rej;\n super((resolve, reject) => {\n executor(resolve, reject);\n res = resolve;\n rej = reject;\n });\n this.resolve = res;\n this.reject = rej;\n }\n}\nfunction namedNodeMapToObject(namedNodeMap) {\n let obj = {};\n for (let attr of namedNodeMap) {\n obj[attr.name] = attr.value;\n }\n return obj;\n}\nfunction boolToBinary(props) {\n let p = {};\n for (let key in props) {\n let val = props[key];\n if (val === true || val === \"\") p[key] = 1;\n else if (val === false) p[key] = 0;\n else if (val != null) p[key] = val;\n }\n return p;\n}\nfunction serialize(props) {\n return String(new URLSearchParams(boolToBinary(props)));\n}\nfunction serializeAttributes(attrs) {\n let html = \"\";\n for (const key in attrs) {\n const value = attrs[key];\n if (value === \"\") html += ` ${escapeHtml(key)}`;\n else html += ` ${escapeHtml(key)}=\"${escapeHtml(`${value}`)}\"`;\n }\n return html;\n}\nfunction escapeHtml(str) {\n return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\").replace(/'/g, \"&apos;\").replace(/`/g, \"&#x60;\");\n}\nif (globalThis.customElements && !globalThis.customElements.get(\"tiktok-video\")) {\n globalThis.customElements.define(\"tiktok-video\", TikTokVideoElement);\n}\nvar tiktok_video_element_default = TikTokVideoElement;\nexport {\n tiktok_video_element_default as default\n};\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA"}