@ix_waterford/lib 1.0.7 → 1.0.9

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 (40) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.js +139697 -5081
  3. package/dist/index.js.map +1 -1
  4. package/dist/static/css/index.css +537 -0
  5. package/dist/static/css/index.css.map +1 -1
  6. package/dist/types/components/index.d.ts +3 -0
  7. package/dist/types/components/index.d.ts.map +1 -1
  8. package/dist/types/index.d.ts +1 -1
  9. package/dist/types/index.d.ts.map +1 -1
  10. package/package.json +1 -1
  11. package/dist/async/reactPlayerDash.js +0 -350
  12. package/dist/async/reactPlayerDash.js.map +0 -1
  13. package/dist/async/reactPlayerHls.js +0 -429
  14. package/dist/async/reactPlayerHls.js.map +0 -1
  15. package/dist/async/reactPlayerMux.js +0 -16075
  16. package/dist/async/reactPlayerMux.js.map +0 -1
  17. package/dist/async/reactPlayerPreview.js +0 -111
  18. package/dist/async/reactPlayerPreview.js.map +0 -1
  19. package/dist/async/reactPlayerSpotify.js +0 -518
  20. package/dist/async/reactPlayerSpotify.js.map +0 -1
  21. package/dist/async/reactPlayerTiktok.js +0 -488
  22. package/dist/async/reactPlayerTiktok.js.map +0 -1
  23. package/dist/async/reactPlayerTwitch.js +0 -586
  24. package/dist/async/reactPlayerTwitch.js.map +0 -1
  25. package/dist/async/reactPlayerVimeo.js +0 -4264
  26. package/dist/async/reactPlayerVimeo.js.map +0 -1
  27. package/dist/async/reactPlayerWistia.js +0 -767
  28. package/dist/async/reactPlayerWistia.js.map +0 -1
  29. package/dist/async/reactPlayerYouTube.js +0 -738
  30. package/dist/async/reactPlayerYouTube.js.map +0 -1
  31. package/dist/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js +0 -1253
  32. package/dist/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js.map +0 -1
  33. package/dist/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js +0 -21
  34. package/dist/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js.map +0 -1
  35. package/dist/async/vendors-node_modules_hls_js_dist_hls_mjs.js +0 -36691
  36. package/dist/async/vendors-node_modules_hls_js_dist_hls_mjs.js.map +0 -1
  37. package/dist/lib-react.js +0 -1462
  38. package/dist/lib-react.js.map +0 -1
  39. package/dist/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-5eb95d.js +0 -53062
  40. package/dist/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-5eb95d.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"async/reactPlayerYouTube.js","sources":["/Users/kirubakaran.r/Documents/projects/hub/components/waterford_library/node_modules/youtube-video-element/dist/react.js","/Users/kirubakaran.r/Documents/projects/hub/components/waterford_library/node_modules/youtube-video-element/dist/youtube-video-element.js"],"sourcesContent":["\"use client\";\n\n// dist/react.ts\nimport React from \"react\";\nimport CustomMediaElement from \"./youtube-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: \"youtube-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.youtube.com/embed\";\nconst EMBED_BASE_NOCOOKIE = \"https://www.youtube-nocookie.com/embed\";\nconst API_URL = \"https://www.youtube.com/iframe_api\";\nconst API_GLOBAL = \"YT\";\nconst API_GLOBAL_READY = \"onYouTubeIframeAPIReady\";\nconst VIDEO_MATCH_SRC = /(?:youtu\\.be\\/|youtube(?:-nocookie)?\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=|shorts\\/|live\\/))((\\w|-){11})/;\nconst PLAYLIST_MATCH_SRC = /(?:youtu\\.be\\/|youtube(?:-nocookie)?\\.com\\/.*?[?&]list=)([\\w_-]+)/;\nfunction getTemplateHTML(attrs, props = {}) {\n var _a;\n const iframeAttrs = {\n src: serializeIframeUrl(attrs, props),\n frameborder: 0,\n width: \"100%\",\n height: \"100%\",\n allow: \"accelerometer; fullscreen; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n };\n if ((_a = props.config) == null ? void 0 : _a.referrerpolicy) {\n iframeAttrs.referrerpolicy = props.config.referrerpolicy;\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 line-height: 0;\n position: relative;\n min-width: 300px;\n min-height: 150px;\n }\n iframe {\n position: absolute;\n top: 0;\n left: 0;\n }\n </style>\n <iframe${serializeAttributes(iframeAttrs)}></iframe>\n `\n );\n}\nfunction serializeIframeUrl(attrs, props) {\n if (!attrs.src) return;\n const embedBase = attrs.src.includes(\"-nocookie\") ? EMBED_BASE_NOCOOKIE : EMBED_BASE;\n const params = {\n // ?controls=true is enabled by default in the iframe\n controls: attrs.controls === \"\" ? null : 0,\n autoplay: attrs.autoplay,\n loop: attrs.loop,\n mute: attrs.muted,\n playsinline: attrs.playsinline,\n preload: attrs.preload ?? \"metadata\",\n // https://developers.google.com/youtube/player_parameters#Parameters\n // origin: globalThis.location?.origin,\n enablejsapi: 1,\n cc_load_policy: 1,\n showinfo: 0,\n rel: 0,\n iv_load_policy: 3,\n modestbranding: 1,\n ...props.config\n };\n if (VIDEO_MATCH_SRC.test(attrs.src)) {\n const matches2 = attrs.src.match(VIDEO_MATCH_SRC);\n const srcId = matches2 && matches2[1];\n return `${embedBase}/${srcId}?${serialize(params)}`;\n }\n const matches = attrs.src.match(PLAYLIST_MATCH_SRC);\n const playlistId = matches && matches[1];\n const extendedParams = {\n listType: \"playlist\",\n list: playlistId,\n ...params\n };\n return `${embedBase}?${serialize(extendedParams)}`;\n}\nclass YoutubeVideoElement extends (globalThis.HTMLElement ?? class {\n}) {\n static getTemplateHTML = getTemplateHTML;\n static shadowRootOptions = { mode: \"open\" };\n static observedAttributes = [\n \"autoplay\",\n \"controls\",\n \"crossorigin\",\n \"loop\",\n \"muted\",\n \"playsinline\",\n \"poster\",\n \"preload\",\n \"src\"\n ];\n loadComplete = new PublicPromise();\n #loadRequested;\n #hasLoaded;\n #readyState = 0;\n #seeking = false;\n #seekComplete;\n isLoaded = false;\n #error = null;\n #config = null;\n #textTracksVideo = null;\n #initialVolume = 1;\n constructor() {\n super();\n this.#upgradeProperty(\"config\");\n }\n get config() {\n return this.#config;\n }\n set config(value) {\n this.#config = value;\n }\n async load() {\n if (this.#loadRequested) return;\n if (!this.shadowRoot) {\n this.attachShadow({ mode: \"open\" });\n }\n const isFirstLoad = !this.#hasLoaded;\n if (this.#hasLoaded) {\n this.loadComplete = new PublicPromise();\n this.isLoaded = false;\n }\n this.#hasLoaded = true;\n await (this.#loadRequested = Promise.resolve());\n this.#loadRequested = null;\n this.#readyState = 0;\n this.dispatchEvent(new Event(\"emptied\"));\n let oldApi = this.api;\n this.api = null;\n if (!this.src) {\n oldApi == null ? void 0 : oldApi.destroy();\n return;\n }\n this.#textTracksVideo = document.createElement(\"video\");\n this.textTracks = this.#textTracksVideo.textTracks;\n this.textTracks.addEventListener(\"change\", () => {\n var _a;\n const active = Array.from(this.textTracks).find((t) => t.mode === \"showing\");\n (_a = this.api) == null ? void 0 : _a.setOption(\"captions\", \"track\", active ? { languageCode: active.language } : {});\n });\n this.dispatchEvent(new Event(\"loadstart\"));\n let iframe = this.shadowRoot.querySelector(\"iframe\");\n let 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 const YT = await loadScript(API_URL, API_GLOBAL, API_GLOBAL_READY);\n this.api = new YT.Player(iframe, {\n events: {\n onReady: () => {\n var _a;\n this.#readyState = 1;\n this.dispatchEvent(new Event(\"loadedmetadata\"));\n this.dispatchEvent(new Event(\"durationchange\"));\n if (this.#initialVolume !== 1) {\n (_a = this.api) == null ? void 0 : _a.setVolume(this.#initialVolume * 100);\n }\n this.dispatchEvent(new Event(\"volumechange\"));\n this.dispatchEvent(new Event(\"loadcomplete\"));\n this.isLoaded = true;\n this.loadComplete.resolve();\n },\n onError: (error) => {\n console.error(error);\n this.#error = {\n code: error.data,\n message: `YouTube iframe player error #${error.data}; visit https://developers.google.com/youtube/iframe_api_reference#onError for the full error message.`\n };\n this.dispatchEvent(new Event(\"error\"));\n }\n }\n });\n let playFired = false;\n this.api.addEventListener(\"onStateChange\", (event) => {\n var _a;\n const state = event.data;\n if (state === YT.PlayerState.PLAYING || state === YT.PlayerState.BUFFERING) {\n if (!playFired) {\n playFired = true;\n this.dispatchEvent(new Event(\"play\"));\n }\n const captionList = this.api.getOption(\"captions\", \"tracklist\") || [];\n captionList.forEach((t) => {\n if (![...this.textTracks].some((tt) => tt.language === t.languageCode)) {\n this.#textTracksVideo.addTextTrack(\"subtitles\", t.displayName, t.languageCode);\n }\n this.textTracks = this.#textTracksVideo.textTracks;\n });\n this.dispatchEvent(new Event(\"loadstart\"));\n }\n if (state === YT.PlayerState.PLAYING) {\n if (this.seeking) {\n this.#seeking = false;\n (_a = this.#seekComplete) == null ? void 0 : _a.resolve();\n this.dispatchEvent(new Event(\"seeked\"));\n }\n this.#readyState = 3;\n this.dispatchEvent(new Event(\"playing\"));\n } else if (state === YT.PlayerState.PAUSED) {\n const diff = Math.abs(this.currentTime - lastCurrentTime);\n if (!this.seeking && diff > 0.1) {\n this.#seeking = true;\n this.dispatchEvent(new Event(\"seeking\"));\n }\n playFired = false;\n this.dispatchEvent(new Event(\"pause\"));\n }\n if (state === YT.PlayerState.ENDED) {\n playFired = false;\n this.dispatchEvent(new Event(\"pause\"));\n this.dispatchEvent(new Event(\"ended\"));\n if (this.loop) {\n this.play();\n }\n }\n });\n this.api.addEventListener(\"onPlaybackRateChange\", () => {\n this.dispatchEvent(new Event(\"ratechange\"));\n });\n this.api.addEventListener(\"onVolumeChange\", () => {\n var _a;\n const apiVolume = ((_a = this.api) == null ? void 0 : _a.getVolume()) / 100;\n this.#initialVolume = apiVolume;\n this.dispatchEvent(new Event(\"volumechange\"));\n });\n this.api.addEventListener(\"onVideoProgress\", () => {\n this.dispatchEvent(new Event(\"timeupdate\"));\n });\n await this.loadComplete;\n let lastCurrentTime = 0;\n setInterval(() => {\n var _a;\n const diff = Math.abs(this.currentTime - lastCurrentTime);\n const bufferedEnd = this.buffered.end(this.buffered.length - 1);\n if (this.seeking && bufferedEnd > 0.1) {\n this.#seeking = false;\n (_a = this.#seekComplete) == null ? void 0 : _a.resolve();\n this.dispatchEvent(new Event(\"seeked\"));\n } else if (!this.seeking && diff > 0.1) {\n this.#seeking = true;\n this.dispatchEvent(new Event(\"seeking\"));\n }\n lastCurrentTime = this.currentTime;\n }, 50);\n let lastBufferedEnd;\n const progressInterval = setInterval(() => {\n const bufferedEnd = this.buffered.end(this.buffered.length - 1);\n if (bufferedEnd >= this.duration) {\n clearInterval(progressInterval);\n this.#readyState = 4;\n }\n if (lastBufferedEnd != bufferedEnd) {\n lastBufferedEnd = bufferedEnd;\n this.dispatchEvent(new Event(\"progress\"));\n }\n }, 100);\n }\n async attributeChangedCallback(attrName, oldValue, newValue) {\n if (oldValue === newValue) return;\n switch (attrName) {\n case \"src\":\n case \"autoplay\":\n case \"controls\":\n case \"loop\":\n case \"playsinline\": {\n this.load();\n }\n }\n }\n async play() {\n var _a;\n this.#seekComplete = null;\n await this.loadComplete;\n (_a = this.api) == null ? void 0 : _a.playVideo();\n return createPlayPromise(this);\n }\n async pause() {\n var _a;\n await this.loadComplete;\n return (_a = this.api) == null ? void 0 : _a.pauseVideo();\n }\n get seeking() {\n return this.#seeking;\n }\n get readyState() {\n return this.#readyState;\n }\n get src() {\n return this.getAttribute(\"src\");\n }\n set src(val) {\n if (this.src == val) return;\n this.setAttribute(\"src\", val);\n }\n get error() {\n return this.#error;\n }\n /* onStateChange\n -1 (unstarted)\n 0 (ended)\n 1 (playing)\n 2 (paused)\n 3 (buffering)\n 5 (video cued).\n */\n get paused() {\n var _a, _b;\n if (!this.isLoaded) return !this.autoplay;\n return [-1, 0, 2, 5].includes((_b = (_a = this.api) == null ? void 0 : _a.getPlayerState) == null ? void 0 : _b.call(_a));\n }\n get duration() {\n var _a, _b;\n return ((_b = (_a = this.api) == null ? void 0 : _a.getDuration) == null ? void 0 : _b.call(_a)) ?? NaN;\n }\n get autoplay() {\n return this.hasAttribute(\"autoplay\");\n }\n set autoplay(val) {\n if (this.autoplay == val) return;\n this.toggleAttribute(\"autoplay\", Boolean(val));\n }\n get buffered() {\n var _a, _b;\n if (!this.isLoaded) return createTimeRanges();\n const progress = ((_a = this.api) == null ? void 0 : _a.getVideoLoadedFraction()) * ((_b = this.api) == null ? void 0 : _b.getDuration());\n if (progress > 0) {\n return createTimeRanges(0, progress);\n }\n return createTimeRanges();\n }\n get controls() {\n return this.hasAttribute(\"controls\");\n }\n set controls(val) {\n if (this.controls == val) return;\n this.toggleAttribute(\"controls\", Boolean(val));\n }\n get currentTime() {\n var _a, _b;\n return ((_b = (_a = this.api) == null ? void 0 : _a.getCurrentTime) == null ? void 0 : _b.call(_a)) ?? 0;\n }\n set currentTime(val) {\n if (this.currentTime == val) return;\n this.#seekComplete = new PublicPromise();\n this.loadComplete.then(() => {\n var _a, _b;\n (_a = this.api) == null ? void 0 : _a.seekTo(val, true);\n if (this.paused) {\n (_b = this.#seekComplete) == null ? void 0 : _b.then(() => {\n var _a2;\n if (!this.#seekComplete) return;\n (_a2 = this.api) == null ? void 0 : _a2.pauseVideo();\n });\n }\n });\n }\n set defaultMuted(val) {\n if (this.defaultMuted == val) return;\n this.toggleAttribute(\"muted\", Boolean(val));\n }\n get defaultMuted() {\n return this.hasAttribute(\"muted\");\n }\n get loop() {\n return this.hasAttribute(\"loop\");\n }\n set loop(val) {\n if (this.loop == val) return;\n this.toggleAttribute(\"loop\", Boolean(val));\n }\n set muted(val) {\n if (this.muted == val) return;\n this.loadComplete.then(() => {\n var _a, _b;\n val ? (_a = this.api) == null ? void 0 : _a.mute() : (_b = this.api) == null ? void 0 : _b.unMute();\n });\n }\n get muted() {\n var _a, _b;\n if (!this.isLoaded) return this.defaultMuted;\n return (_b = (_a = this.api) == null ? void 0 : _a.isMuted) == null ? void 0 : _b.call(_a);\n }\n get playbackRate() {\n var _a, _b;\n return ((_b = (_a = this.api) == null ? void 0 : _a.getPlaybackRate) == null ? void 0 : _b.call(_a)) ?? 1;\n }\n set playbackRate(val) {\n if (this.playbackRate == val) return;\n this.loadComplete.then(() => {\n var _a;\n (_a = this.api) == null ? void 0 : _a.setPlaybackRate(val);\n });\n }\n get playsInline() {\n return this.hasAttribute(\"playsinline\");\n }\n set playsInline(val) {\n if (this.playsInline == val) return;\n this.toggleAttribute(\"playsinline\", Boolean(val));\n }\n get poster() {\n return this.getAttribute(\"poster\");\n }\n set poster(val) {\n if (this.poster == val) return;\n this.setAttribute(\"poster\", `${val}`);\n }\n set volume(val) {\n if (this.volume == val) return;\n this.#initialVolume = val;\n this.loadComplete.then(() => {\n var _a;\n (_a = this.api) == null ? void 0 : _a.setVolume(val * 100);\n });\n }\n get volume() {\n var _a;\n if (!this.isLoaded) {\n return this.#initialVolume;\n }\n return ((_a = this.api) == null ? void 0 : _a.getVolume()) / 100;\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}\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}\nfunction serialize(props) {\n return String(new URLSearchParams(boolToBinary(props)));\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 namedNodeMapToObject(namedNodeMap) {\n let obj = {};\n for (let attr of namedNodeMap) {\n obj[attr.name] = attr.value;\n }\n return obj;\n}\nconst loadScriptCache = {};\nasync function loadScript(src, globalName, readyFnName) {\n if (loadScriptCache[src]) return loadScriptCache[src];\n if (globalName && self[globalName]) {\n await delay(0);\n return self[globalName];\n }\n return loadScriptCache[src] = new Promise(function(resolve, reject) {\n const script = document.createElement(\"script\");\n script.src = src;\n const ready = () => resolve(self[globalName]);\n if (readyFnName) self[readyFnName] = ready;\n script.onload = () => !readyFnName && ready();\n script.onerror = reject;\n document.head.append(script);\n });\n}\nconst delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\nfunction promisify(fn) {\n return (...args) => new Promise((resolve) => {\n fn(...args, (...res) => {\n if (res.length > 1) resolve(res);\n else resolve(res[0]);\n });\n });\n}\nfunction createPlayPromise(player) {\n return promisify((event, cb) => {\n let fn;\n player.addEventListener(\n event,\n fn = () => {\n player.removeEventListener(event, fn);\n cb();\n }\n );\n })(\"playing\");\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 createTimeRanges(start, end) {\n if (Array.isArray(start)) {\n return createTimeRangesObj(start);\n } else if (start == null || end == null || start === 0 && end === 0) {\n return createTimeRangesObj([[0, 0]]);\n }\n return createTimeRangesObj([[start, end]]);\n}\nfunction createTimeRangesObj(ranges) {\n Object.defineProperties(ranges, {\n start: {\n value: (i) => ranges[i][0]\n },\n end: {\n value: (i) => ranges[i][1]\n }\n });\n return ranges;\n}\nif (globalThis.customElements && !globalThis.customElements.get(\"youtube-video\")) {\n globalThis.customElements.define(\"youtube-video\", YoutubeVideoElement);\n}\nvar youtube_video_element_default = YoutubeVideoElement;\nexport {\n youtube_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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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"}