{
  "version": 3,
  "sources": ["../src/index.ts", "../src/env.ts", "../../../shared/castable-video/castable-video.js", "../src/CustomVideoElement.js"],
  "sourcesContent": ["import {\n  initialize,\n  setupAutoplay,\n  generatePlayerInitTime,\n  MuxMediaProps,\n  StreamTypes,\n  ValueOf,\n  toMuxVideoURL,\n  teardown,\n  Metadata,\n  mux,\n  MediaError,\n  getError,\n} from '@mux-elements/playback-core';\nimport type { PlaybackEngine, Autoplay, UpdateAutoplay, ExtensionMimeTypeMap } from '@mux-elements/playback-core';\nimport { getPlayerVersion } from './env';\n// this must be imported after playback-core for the polyfill to be included\nimport CustomVideoElement, { VideoEvents } from './CustomVideoElement';\n\nconsole.warn(`\nWe have recently transitioned the package name from @mux-elements/<element name> to @mux/<element name>.\nPlease update your imports or scripts. See https://www.mux.com/blog/mux-elements-are-getting-a-new-old-home-on-npm-mux for more information.\n`);\n\n/** @TODO make the relationship between name+value smarter and more deriveable (CJP) */\ntype AttributeNames = {\n  ENV_KEY: 'env-key';\n  DEBUG: 'debug';\n  METADATA_URL: 'metadata-url';\n  PLAYER_SOFTWARE_VERSION: 'player-software-version';\n  PLAYER_SOFTWARE_NAME: 'player-software-name';\n  METADATA_VIDEO_ID: 'metadata-video-id';\n  METADATA_VIDEO_TITLE: 'metadata-video-title';\n  METADATA_VIEWER_USER_ID: 'metadata-viewer-user-id';\n  BEACON_COLLECTION_DOMAIN: 'beacon-collection-domain';\n  CUSTOM_DOMAIN: 'custom-domain';\n  PLAYBACK_ID: 'playback-id';\n  PREFER_MSE: 'prefer-mse';\n  TYPE: 'type';\n  STREAM_TYPE: 'stream-type';\n  START_TIME: 'start-time';\n};\n\nconst Attributes: AttributeNames = {\n  ENV_KEY: 'env-key',\n  DEBUG: 'debug',\n  PLAYBACK_ID: 'playback-id',\n  METADATA_URL: 'metadata-url',\n  PREFER_MSE: 'prefer-mse',\n  PLAYER_SOFTWARE_VERSION: 'player-software-version',\n  PLAYER_SOFTWARE_NAME: 'player-software-name',\n  METADATA_VIDEO_ID: 'metadata-video-id',\n  METADATA_VIDEO_TITLE: 'metadata-video-title',\n  METADATA_VIEWER_USER_ID: 'metadata-viewer-user-id',\n  BEACON_COLLECTION_DOMAIN: 'beacon-collection-domain',\n  CUSTOM_DOMAIN: 'custom-domain',\n  TYPE: 'type',\n  STREAM_TYPE: 'stream-type',\n  START_TIME: 'start-time',\n};\n\nconst AttributeNameValues = Object.values(Attributes);\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-video';\n\nclass MuxVideoElement extends CustomVideoElement<HTMLVideoElement> implements Partial<MuxMediaProps> {\n  static get observedAttributes() {\n    return [...AttributeNameValues, ...(CustomVideoElement.observedAttributes ?? [])];\n  }\n\n  // Keeping this named \"__hls\" since it's exposed for unadvertised \"advanced usage\" via getter that assumes specifically hls.js (CJP)\n  protected __hls?: PlaybackEngine;\n  protected __playerInitTime: number;\n  protected __metadata: Readonly<Metadata> = {};\n  protected __playerSoftwareVersion?: string;\n  protected __playerSoftwareName?: string;\n  protected __updateAutoplay?: UpdateAutoplay;\n  protected __errorTranslator?: Function;\n\n  constructor() {\n    super();\n    this.__playerInitTime = generatePlayerInitTime();\n  }\n\n  get playerInitTime() {\n    return this.__playerInitTime;\n  }\n\n  get playerSoftwareName() {\n    return this.__playerSoftwareName ?? playerSoftwareName;\n  }\n\n  set playerSoftwareName(value: string | undefined) {\n    this.__playerSoftwareName = value;\n  }\n\n  get playerSoftwareVersion() {\n    return this.__playerSoftwareVersion ?? playerSoftwareVersion;\n  }\n\n  set playerSoftwareVersion(value: string | undefined) {\n    this.__playerSoftwareVersion = value;\n  }\n\n  /**\n   * @deprecated please use ._hls instead\n   */\n  get hls() {\n    console.warn('<mux-video>.hls is deprecated, please use ._hls instead');\n    return this._hls;\n  }\n\n  get _hls() {\n    return this.__hls;\n  }\n\n  get mux(): Readonly<HTMLVideoElement['mux']> | undefined {\n    return this.nativeEl.mux;\n  }\n\n  // @ts-ignore\n  get error(): MediaError | null {\n    return getError(this.nativeEl) ?? null;\n  }\n\n  get errorTranslator() {\n    return this.__errorTranslator;\n  }\n\n  set errorTranslator(value: Function | undefined) {\n    this.__errorTranslator = value;\n  }\n\n  get src() {\n    // Use the attribute value as the source of truth.\n    // No need to store it in two places.\n    // This avoids needing a to read the attribute initially and update the src.\n    return this.getAttribute('src') as string;\n  }\n\n  set src(val: string) {\n    // If being set by attributeChangedCallback,\n    // dont' cause an infinite loop\n    if (val === this.src) return;\n\n    if (val == null) {\n      this.removeAttribute('src');\n    } else {\n      this.setAttribute('src', val);\n    }\n  }\n\n  get type(): ValueOf<ExtensionMimeTypeMap> | undefined {\n    return (this.getAttribute(Attributes.TYPE) as ValueOf<ExtensionMimeTypeMap>) ?? undefined;\n  }\n\n  set type(val: ValueOf<ExtensionMimeTypeMap> | undefined) {\n    // dont' cause an infinite loop\n    if (val === this.type) return;\n\n    if (val) {\n      this.setAttribute(Attributes.TYPE, val);\n    } else {\n      this.removeAttribute(Attributes.TYPE);\n    }\n  }\n\n  get autoplay(): Autoplay {\n    const attr = this.getAttribute('autoplay');\n\n    if (attr === null) {\n      return false;\n    } else if (attr === '') {\n      return true;\n    } else {\n      return attr as Autoplay;\n    }\n  }\n\n  set autoplay(val: Autoplay) {\n    const currentVal = this.autoplay;\n    if (val === currentVal) {\n      return;\n    }\n\n    if (val) {\n      this.setAttribute('autoplay', typeof val === 'string' ? val : '');\n    } else {\n      this.removeAttribute('autoplay');\n    }\n  }\n\n  /** @TODO write a generic module for well defined primitive types -> attribute getter/setters/removers (CJP) */\n  get debug(): boolean {\n    return this.getAttribute(Attributes.DEBUG) != null;\n  }\n\n  set debug(val: boolean) {\n    // dont' cause an infinite loop\n    if (val === this.debug) return;\n\n    if (val) {\n      this.setAttribute(Attributes.DEBUG, '');\n    } else {\n      this.removeAttribute(Attributes.DEBUG);\n    }\n  }\n\n  get startTime(): number | undefined {\n    const val = this.getAttribute(Attributes.START_TIME);\n    if (val == null) return undefined;\n    const num = +val;\n    return !Number.isNaN(num) ? num : undefined;\n  }\n\n  set startTime(val: number | undefined) {\n    // dont' cause an infinite loop\n    if (val === this.startTime) return;\n\n    if (val == null) {\n      this.removeAttribute(Attributes.START_TIME);\n    } else {\n      this.setAttribute(Attributes.START_TIME, `${val}`);\n    }\n  }\n\n  get playbackId(): string | undefined {\n    return this.getAttribute(Attributes.PLAYBACK_ID) ?? undefined;\n  }\n\n  set playbackId(val: string | undefined) {\n    // dont' cause an infinite loop\n    if (val === this.playbackId) return;\n\n    if (val) {\n      this.setAttribute(Attributes.PLAYBACK_ID, val);\n    } else {\n      this.removeAttribute(Attributes.PLAYBACK_ID);\n    }\n  }\n\n  get customDomain() {\n    return this.getAttribute(Attributes.CUSTOM_DOMAIN) ?? undefined;\n  }\n\n  set customDomain(val: string | undefined) {\n    // dont' cause an infinite loop\n    if (val === this.customDomain) return;\n\n    if (val) {\n      this.setAttribute(Attributes.CUSTOM_DOMAIN, val);\n    } else {\n      this.removeAttribute(Attributes.CUSTOM_DOMAIN);\n    }\n  }\n\n  get envKey(): string | undefined {\n    return this.getAttribute(Attributes.ENV_KEY) ?? undefined;\n  }\n\n  set envKey(val: string | undefined) {\n    // dont' cause an infinite loop\n    if (val === this.envKey) return;\n\n    if (val) {\n      this.setAttribute(Attributes.ENV_KEY, val);\n    } else {\n      this.removeAttribute(Attributes.ENV_KEY);\n    }\n  }\n\n  get beaconCollectionDomain(): string | undefined {\n    return this.getAttribute(Attributes.BEACON_COLLECTION_DOMAIN) ?? undefined;\n  }\n\n  set beaconCollectionDomain(val: string | undefined) {\n    // don't cause an infinite loop\n    if (val === this.beaconCollectionDomain) return;\n\n    if (val) {\n      this.setAttribute(Attributes.BEACON_COLLECTION_DOMAIN, val);\n    } else {\n      this.removeAttribute(Attributes.BEACON_COLLECTION_DOMAIN);\n    }\n  }\n\n  get streamType(): ValueOf<StreamTypes> | undefined {\n    // getAttribute doesn't know that this attribute is well defined. Should explore extending for MuxVideo (CJP)\n    return (this.getAttribute(Attributes.STREAM_TYPE) as ValueOf<StreamTypes>) ?? undefined;\n  }\n\n  set streamType(val: ValueOf<StreamTypes> | undefined) {\n    // dont' cause an infinite loop\n    if (val === this.streamType) return;\n\n    if (val) {\n      this.setAttribute(Attributes.STREAM_TYPE, val);\n    } else {\n      this.removeAttribute(Attributes.STREAM_TYPE);\n    }\n  }\n\n  /** @TODO Followup: naming convention: all lower (common per HTMLElement props) vs. camel (common per JS convention) (CJP) */\n  get preferMse(): boolean {\n    return this.getAttribute(Attributes.PREFER_MSE) != null;\n  }\n\n  set preferMse(val: boolean) {\n    if (val) {\n      this.setAttribute(Attributes.PREFER_MSE, '');\n    } else {\n      this.removeAttribute(Attributes.PREFER_MSE);\n    }\n  }\n\n  get metadata() {\n    const video_id = this.getAttribute(Attributes.METADATA_VIDEO_ID);\n    const video_title = this.getAttribute(Attributes.METADATA_VIDEO_TITLE);\n    const viewer_user_id = this.getAttribute(Attributes.METADATA_VIEWER_USER_ID);\n    return {\n      ...this.__metadata,\n      ...(video_id != null ? { video_id } : {}),\n      ...(video_title != null ? { video_title } : {}),\n      ...(viewer_user_id != null ? { viewer_user_id } : {}),\n    };\n  }\n\n  set metadata(val: Readonly<Metadata> | undefined) {\n    this.__metadata = val ?? {};\n    if (!!this.mux) {\n      this.mux.emit('hb', this.__metadata);\n    }\n  }\n\n  load() {\n    const nextHlsInstance = initialize(this as Partial<MuxMediaProps>, this.nativeEl, this.__hls);\n    this.__hls = nextHlsInstance;\n    const updateAutoplay = setupAutoplay(this.nativeEl, this.autoplay, nextHlsInstance);\n    this.__updateAutoplay = updateAutoplay;\n  }\n\n  unload() {\n    teardown(this.nativeEl, this.__hls);\n    this.__hls = undefined;\n  }\n\n  // NOTE: This was carried over from hls-video-element. Is it needed for an edge case?\n  // play() {\n  //   if (this.readyState === 0 && this.networkState < 2) {\n  //     this.load();\n  //     this._hls.on(Hls.Events.MANIFEST_PARSED,function() {\n  //     video.play();\n  //\n  //     return this.nativeEl.play();\n  //   }\n  // }\n\n  attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string | null) {\n    switch (attrName) {\n      case Attributes.PLAYER_SOFTWARE_NAME:\n        this.playerSoftwareName = newValue ?? undefined;\n        break;\n      case Attributes.PLAYER_SOFTWARE_VERSION:\n        this.playerSoftwareVersion = newValue ?? undefined;\n        break;\n      case 'src':\n        const hadSrc = !!oldValue;\n        const hasSrc = !!newValue;\n        if (!hadSrc && hasSrc) {\n          this.load();\n        } else if (hadSrc && !hasSrc) {\n          this.unload();\n          /** @TODO Test this thoroughly (async?) and confirm unload() necessary (CJP) */\n        } else if (hadSrc && hasSrc) {\n          this.unload();\n          this.load();\n        }\n        break;\n      case 'autoplay':\n        if (newValue === oldValue) {\n          break;\n        }\n        /** In case newValue is an empty string or null, use this.autoplay which translates to booleans (WL) */\n        this.__updateAutoplay?.(this.autoplay);\n        break;\n      case Attributes.PLAYBACK_ID:\n        /** @TODO Improv+Discuss - how should playback-id update wrt src attr changes (and vice versa) (CJP) */\n        this.src = toMuxVideoURL(newValue ?? undefined, { domain: this.customDomain }) as string;\n        break;\n      case Attributes.DEBUG:\n        const debug = this.debug;\n        if (!!this.mux) {\n          /** @TODO Link to docs for a more detailed discussion (CJP) */\n          console.info(\n            'Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src.'\n          );\n        }\n        if (!!this._hls) {\n          this._hls.config.debug = debug;\n        }\n        break;\n      case Attributes.METADATA_URL:\n        if (newValue) {\n          fetch(newValue)\n            .then((resp) => resp.json())\n            .then((json) => (this.metadata = json))\n            .catch((_err) => console.error(`Unable to load or parse metadata JSON from metadata-url ${newValue}!`));\n        }\n        break;\n      default:\n        break;\n    }\n\n    super.attributeChangedCallback(attrName, oldValue, newValue);\n  }\n\n  disconnectedCallback() {\n    this.unload();\n  }\n}\n\ntype MuxVideoElementType = typeof MuxVideoElement;\ndeclare global {\n  var MuxVideoElement: MuxVideoElementType;\n}\n\n/** @TODO Refactor once using `globalThis` polyfills */\nif (!globalThis.customElements.get('mux-video')) {\n  globalThis.customElements.define('mux-video', MuxVideoElement);\n  /** @TODO consider externalizing this (breaks standard modularity) */\n  globalThis.MuxVideoElement = MuxVideoElement;\n}\n\nexport { PlaybackEngine, PlaybackEngine as Hls, ExtensionMimeTypeMap as MimeTypes, MediaError, VideoEvents };\n\nexport default MuxVideoElement;\n", "export const isMaybeBrowser = () => typeof window != 'undefined';\n// @ts-ignore\nexport const isMaybeServer = () => typeof global != 'undefined';\n\nconst getEnvPlayerVersion = () => {\n  try {\n    // @ts-ignore\n    return PLAYER_VERSION as string;\n  } catch {}\n  return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n", "/* global globalThis, chrome, cast */\n\n/**\n * CastableVideoMixin\n *\n * Because there can only be one custom built-in (is=\"my-video\") this mixin function\n * provides a way to compose multiple classes to create one custom built-in class.\n * @see https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/\n *\n * @param  {HTMLVideoElement} superclass - HTMLVideoElement or an extended class of it.\n * @return {CastableVideo}\n */\nconst CastableVideoMixin = (superclass) =>\n  class CastableVideo extends superclass {\n    static observedAttributes = ['cast-src', 'cast-content-type', 'cast-stream-type'];\n    static instances = new Set();\n\n    static #castElement;\n    static get castElement() {\n      return CastableVideo.#castElement;\n    }\n\n    static #castEnabled = false;\n    static get castEnabled() {\n      return CastableVideo.#castEnabled;\n    }\n\n    static get castState() {\n      return CastableVideo.#castContext?.getCastState();\n    }\n\n    static async exitCast() {\n      // Should the receiver application be stopped or just disconnected.\n      const stopCasting = true;\n      try {\n        await CastableVideo.#castContext.endCurrentSession(stopCasting);\n      } catch (err) {\n        console.error(err);\n        return;\n      }\n    }\n\n    static initCast = () => {\n      if (!this.#isChromeCastAvailable) {\n        globalThis.__onGCastApiAvailable = () => {\n          // The globalThis.__onGCastApiAvailable callback alone is not reliable for\n          // the added cast.framework. It's loaded in a separate JS file.\n          // http://www.gstatic.com/eureka/clank/101/cast_sender.js\n          // http://www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js\n          customElements.whenDefined('google-cast-button').then(() => this.#onSdkLoaded(chrome.cast.isAvailable));\n        };\n      } else if (!this.#isCastFrameworkAvailable) {\n        customElements.whenDefined('google-cast-button').then(() => this.#onSdkLoaded(chrome.cast.isAvailable));\n      } else {\n        this.#onSdkLoaded(chrome.cast.isAvailable);\n      }\n    };\n\n    static #onSdkLoaded = (isAvailable) => {\n      if (isAvailable) {\n        this.#castEnabled = true;\n\n        const { CAST_STATE_CHANGED } = cast.framework.CastContextEventType;\n        CastableVideo.#castContext.addEventListener(CAST_STATE_CHANGED, (e) => {\n          this.instances.forEach((video) => video.#onCastStateChanged(e));\n        });\n\n        const { SESSION_STATE_CHANGED } = cast.framework.CastContextEventType;\n        CastableVideo.#castContext.addEventListener(SESSION_STATE_CHANGED, (e) => {\n          this.instances.forEach((video) => video.#onSessionStateChanged(e));\n        });\n\n        this.instances.forEach((video) => video.#init());\n      }\n    };\n\n    static get #isChromeCastAvailable() {\n      return typeof chrome !== 'undefined' && chrome.cast && chrome.cast.isAvailable;\n    }\n\n    static get #isCastFrameworkAvailable() {\n      return typeof cast !== 'undefined' && cast.framework;\n    }\n\n    static get #castContext() {\n      if (CastableVideo.#isCastFrameworkAvailable) {\n        return cast.framework.CastContext.getInstance();\n      }\n      return undefined;\n    }\n\n    static get #currentSession() {\n      return CastableVideo.#castContext?.getCurrentSession();\n    }\n\n    static get #currentMedia() {\n      return CastableVideo.#currentSession?.getSessionObj().media[0];\n    }\n\n    static #editTracksInfo(request) {\n      return new Promise((resolve, reject) => {\n        CastableVideo.#currentMedia.editTracksInfo(request, resolve, reject);\n      });\n    }\n\n    static #getMediaStatus(request) {\n      return new Promise((resolve, reject) => {\n        CastableVideo.#currentMedia.getStatus(request, resolve, reject);\n      });\n    }\n\n    static #setOptions(options) {\n      return CastableVideo.#castContext.setOptions({\n        // Set the receiver application ID to your own (created in the\n        // Google Cast Developer Console), or optionally\n        // use the chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID\n        receiverApplicationId: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,\n\n        // Auto join policy can be one of the following three:\n        // ORIGIN_SCOPED - Auto connect from same appId and page origin\n        // TAB_AND_ORIGIN_SCOPED - Auto connect from same appId, page origin, and tab\n        // PAGE_SCOPED - No auto connect\n        autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,\n\n        // The following flag enables Cast Connect(requires Chrome 87 or higher)\n        // https://developers.googleblog.com/2020/08/introducing-cast-connect-android-tv.html\n        androidReceiverCompatible: false,\n\n        language: 'en-US',\n        resumeSavedSession: true,\n\n        ...options,\n      });\n    }\n\n    castEnabled = false;\n    #localState = { paused: false };\n    #remotePlayer;\n    #remoteListeners = {};\n    #enterCastCallback;\n    #leaveCastCallback;\n    #castChangeCallback;\n\n    constructor() {\n      super();\n\n      CastableVideo.instances.add(this);\n      this.#init();\n    }\n\n    get castPlayer() {\n      if (CastableVideo.castElement === this) return this.#remotePlayer;\n      return undefined;\n    }\n\n    get #isMediaLoaded() {\n      return this.castPlayer?.isMediaLoaded;\n    }\n\n    attributeChangedCallback(attrName) {\n      if (!this.castPlayer) return;\n\n      switch (attrName) {\n        case 'cast-stream-type':\n        case 'cast-src':\n          this.load();\n          break;\n      }\n    }\n\n    #disconnect() {\n      if (CastableVideo.#castElement !== this) return;\n\n      Object.entries(this.#remoteListeners).forEach(([event, listener]) => {\n        this.#remotePlayer.controller.removeEventListener(event, listener);\n      });\n\n      CastableVideo.#castElement = undefined;\n\n      // isMuted is not in savedPlayerState. should we sync this back to local?\n      this.muted = this.#remotePlayer.isMuted;\n      this.currentTime = this.#remotePlayer.savedPlayerState.currentTime;\n      if (this.#remotePlayer.savedPlayerState.isPaused === false) {\n        this.play();\n      }\n    }\n\n    #onCastStateChanged() {\n      // Cast state: NO_DEVICES_AVAILABLE, NOT_CONNECTED, CONNECTING, CONNECTED\n      // https://developers.google.com/cast/docs/reference/web_sender/cast.framework#.CastState\n      this.dispatchEvent(\n        new CustomEvent('castchange', {\n          detail: CastableVideo.#castContext.getCastState(),\n        })\n      );\n    }\n\n    async #onSessionStateChanged() {\n      // Session states: NO_SESSION, SESSION_STARTING, SESSION_STARTED, SESSION_START_FAILED,\n      //                 SESSION_ENDING, SESSION_ENDED, SESSION_RESUMED\n      // https://developers.google.com/cast/docs/reference/web_sender/cast.framework#.SessionState\n\n      const { SESSION_RESUMED } = cast.framework.SessionState;\n      if (CastableVideo.#castContext.getSessionState() === SESSION_RESUMED) {\n        /**\n         * Figure out if this was the video that started the resumed session.\n         * @TODO make this more specific than just checking against the video src!! (WL)\n         *\n         * If this video element can get the same unique id on each browser refresh\n         * it would be possible to pass this unique id w/ `LoadRequest.customData`\n         * and verify against CastableVideo.#currentMedia.customData below.\n         */\n        if (this.castSrc === CastableVideo.#currentMedia?.media.contentId) {\n          CastableVideo.#castElement = this;\n\n          Object.entries(this.#remoteListeners).forEach(([event, listener]) => {\n            this.#remotePlayer.controller.addEventListener(event, listener);\n          });\n\n          /**\n           * There is cast framework resume session bug when you refresh the page a few\n           * times the this.#remotePlayer.currentTime will not be in sync with the receiver :(\n           * The below status request syncs it back up.\n           */\n          try {\n            await CastableVideo.#getMediaStatus(new chrome.cast.media.GetStatusRequest());\n          } catch (error) {\n            console.error(error);\n          }\n\n          // Dispatch the play, playing events manually to sync remote playing state.\n          this.#remoteListeners[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]();\n          this.#remoteListeners[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]();\n        }\n      }\n    }\n\n    #init() {\n      if (!CastableVideo.#isCastFrameworkAvailable || this.castEnabled) return;\n      this.castEnabled = true;\n      CastableVideo.#setOptions();\n\n      /**\n       * @TODO add listeners for addtrack, removetrack (WL)\n       * This only has an impact on <track> with a `src` because these have to be\n       * loaded manually in the load() method. This will require a new load() call\n       * for each added/removed track w/ src.\n       */\n      this.textTracks.addEventListener('change', this.#updateRemoteTextTrack.bind(this));\n\n      this.#onCastStateChanged();\n\n      this.#remotePlayer = new cast.framework.RemotePlayer();\n      new cast.framework.RemotePlayerController(this.#remotePlayer);\n\n      this.#remoteListeners = {\n        [cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED]: ({ value }) => {\n          if (value === false) {\n            this.#disconnect();\n          }\n          this.dispatchEvent(new Event(value ? 'entercast' : 'leavecast'));\n        },\n        [cast.framework.RemotePlayerEventType.DURATION_CHANGED]: () => {\n          this.dispatchEvent(new Event('durationchange'));\n        },\n        [cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]: () => {\n          this.dispatchEvent(new Event('volumechange'));\n        },\n        [cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED]: () => {\n          this.dispatchEvent(new Event('volumechange'));\n        },\n        [cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED]: () => {\n          if (!this.#isMediaLoaded) return;\n          this.dispatchEvent(new Event('timeupdate'));\n        },\n        [cast.framework.RemotePlayerEventType.VIDEO_INFO_CHANGED]: () => {\n          this.dispatchEvent(new Event('resize'));\n        },\n        [cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]: () => {\n          this.dispatchEvent(new Event(this.paused ? 'pause' : 'play'));\n        },\n        [cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]: () => {\n          // Player states: IDLE, PLAYING, PAUSED, BUFFERING\n          // https://developers.google.com/cast/docs/reference/web_sender/chrome.cast.media#.PlayerState\n\n          // pause event is handled above.\n          if (this.castPlayer?.playerState === chrome.cast.media.PlayerState.PAUSED) {\n            return;\n          }\n          this.dispatchEvent(\n            new Event(\n              {\n                [chrome.cast.media.PlayerState.PLAYING]: 'playing',\n                [chrome.cast.media.PlayerState.BUFFERING]: 'waiting',\n                [chrome.cast.media.PlayerState.IDLE]: 'emptied',\n              }[this.castPlayer?.playerState]\n            )\n          );\n        },\n        [cast.framework.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]: async () => {\n          if (!this.#isMediaLoaded) return;\n\n          // mediaInfo is not immediately available due to a bug? wait one tick\n          await Promise.resolve();\n          this.#onRemoteMediaLoaded();\n        },\n      };\n    }\n\n    async requestCast(options = {}) {\n      CastableVideo.#setOptions(options);\n      CastableVideo.#castElement = this;\n\n      Object.entries(this.#remoteListeners).forEach(([event, listener]) => {\n        this.#remotePlayer.controller.addEventListener(event, listener);\n      });\n\n      try {\n        // Open browser cast menu.\n        await CastableVideo.#castContext.requestSession();\n      } catch (err) {\n        CastableVideo.#castElement = undefined;\n        // console.error(err); // Don't show an error if dismissing the menu.\n        return;\n      }\n\n      // Pause locally when the session is created.\n      this.#localState.paused = super.paused;\n      super.pause();\n\n      // Sync over the muted state but not volume, 100% is different on TV's :P\n      this.muted = super.muted;\n\n      try {\n        await this.load();\n      } catch (err) {\n        console.error(err);\n      }\n    }\n\n    async load() {\n      if (!this.castPlayer) return super.load();\n\n      const mediaInfo = new chrome.cast.media.MediaInfo(this.castSrc, this.castContentType);\n\n      // Manually add text tracks with a `src` attribute.\n      // M3U8's load text tracks in the receiver, handle these in the media loaded event.\n      const subtitles = [...this.querySelectorAll('track')].filter(({ kind, src }) => {\n        return src && (kind === 'subtitles' || kind === 'captions');\n      });\n\n      const activeTrackIds = [];\n      let textTrackIdCount = 0;\n\n      if (subtitles.length) {\n        mediaInfo.tracks = subtitles.map((trackEl) => {\n          const trackId = ++textTrackIdCount;\n          // only activate 1 subtitle text track.\n          if (activeTrackIds.length === 0 && trackEl.track.mode === 'showing') {\n            activeTrackIds.push(trackId);\n          }\n\n          const track = new chrome.cast.media.Track(trackId, chrome.cast.media.TrackType.TEXT);\n          track.trackContentId = trackEl.src;\n          track.trackContentType = 'text/vtt';\n          track.subtype =\n            trackEl.kind === 'captions'\n              ? chrome.cast.media.TextTrackType.CAPTIONS\n              : chrome.cast.media.TextTrackType.SUBTITLES;\n          track.name = trackEl.label;\n          track.language = trackEl.srclang;\n          return track;\n        });\n      }\n\n      if (this.castStreamType === 'live') {\n        mediaInfo.streamType = chrome.cast.media.StreamType.LIVE;\n      } else {\n        mediaInfo.streamType = chrome.cast.media.StreamType.BUFFERED;\n      }\n\n      mediaInfo.metadata = new chrome.cast.media.GenericMediaMetadata();\n      mediaInfo.metadata.title = this.title;\n      mediaInfo.metadata.images = [\n        {\n          url: this.poster,\n        },\n      ];\n\n      const request = new chrome.cast.media.LoadRequest(mediaInfo);\n      request.currentTime = super.currentTime ?? 0;\n      request.autoplay = !this.#localState.paused;\n      request.activeTrackIds = activeTrackIds;\n\n      await CastableVideo.#currentSession?.loadMedia(request);\n\n      this.dispatchEvent(new Event('volumechange'));\n    }\n\n    #onRemoteMediaLoaded() {\n      this.#updateRemoteTextTrack();\n    }\n\n    async #updateRemoteTextTrack() {\n      if (!this.castPlayer) return;\n\n      // Get the tracks w/ trackId's that have been loaded; manually or via a playlist like a M3U8 or MPD.\n      const remoteTracks = this.#remotePlayer.mediaInfo?.tracks ?? [];\n      const remoteSubtitles = remoteTracks.filter(({ type }) => type === chrome.cast.media.TrackType.TEXT);\n\n      const localSubtitles = [...this.textTracks].filter(({ kind }) => kind === 'subtitles' || kind === 'captions');\n\n      // Create a new array from the local subs w/ the trackId's from the remote subs.\n      const subtitles = remoteSubtitles\n        .map(({ language, name, trackId }) => {\n          // Find the corresponding local text track and assign the trackId.\n          const { mode } = localSubtitles.find((local) => local.language === language && local.label === name) ?? {};\n          if (mode) return { mode, trackId };\n          return false;\n        })\n        .filter(Boolean);\n\n      const hiddenSubtitles = subtitles.filter(({ mode }) => mode !== 'showing');\n      const hiddenTrackIds = hiddenSubtitles.map(({ trackId }) => trackId);\n      const showingSubtitle = subtitles.find(({ mode }) => mode === 'showing');\n\n      // Note this could also include audio or video tracks, diff against local state.\n      const activeTrackIds = CastableVideo.#currentSession?.getSessionObj().media[0]?.activeTrackIds ?? [];\n      let requestTrackIds = activeTrackIds;\n\n      if (activeTrackIds.length) {\n        // Filter out all local hidden subtitle trackId's.\n        requestTrackIds = requestTrackIds.filter((id) => !hiddenTrackIds.includes(id));\n      }\n\n      if (showingSubtitle?.trackId) {\n        requestTrackIds = [...requestTrackIds, showingSubtitle.trackId];\n      }\n\n      // Remove duplicate ids.\n      requestTrackIds = [...new Set(requestTrackIds)];\n\n      const arrayEquals = (a, b) => a.length === b.length && a.every((a) => b.includes(a));\n      if (!arrayEquals(activeTrackIds, requestTrackIds)) {\n        try {\n          const request = new chrome.cast.media.EditTracksInfoRequest(requestTrackIds);\n          await CastableVideo.#editTracksInfo(request);\n        } catch (error) {\n          console.error(error);\n        }\n      }\n    }\n\n    play() {\n      if (this.castPlayer) {\n        if (this.castPlayer.isPaused) {\n          this.castPlayer.controller?.playOrPause();\n        }\n        return;\n      }\n      return super.play();\n    }\n\n    pause() {\n      if (this.castPlayer) {\n        if (!this.castPlayer.isPaused) {\n          this.castPlayer.controller?.playOrPause();\n        }\n        return;\n      }\n      super.pause();\n    }\n\n    // Allow the cast source url to be different than <video src>, could be a blob.\n    get castSrc() {\n      // Try the first <source src> for usage with even more native markup.\n      return this.getAttribute('cast-src') ?? this.querySelector('source')?.src ?? this.currentSrc;\n    }\n\n    set castSrc(val) {\n      if (this.castSrc == val) return;\n      this.setAttribute('cast-src', `${val}`);\n    }\n\n    get castContentType() {\n      return this.getAttribute('cast-content-type') ?? undefined;\n    }\n\n    set castContentType(val) {\n      this.setAttribute('cast-content-type', `${val}`);\n    }\n\n    get castStreamType() {\n      return this.getAttribute('cast-stream-type') ?? undefined;\n    }\n\n    set castStreamType(val) {\n      this.setAttribute('cast-stream-type', `${val}`);\n    }\n\n    get readyState() {\n      if (this.castPlayer) {\n        switch (this.castPlayer.playerState) {\n          case chrome.cast.media.PlayerState.IDLE:\n            return 0;\n          case chrome.cast.media.PlayerState.BUFFERING:\n            return 2;\n          default:\n            return 3;\n        }\n      }\n      return super.readyState;\n    }\n\n    get paused() {\n      if (this.castPlayer) return this.castPlayer.isPaused;\n      return super.paused;\n    }\n\n    get muted() {\n      if (this.castPlayer) return this.castPlayer?.isMuted;\n      return super.muted;\n    }\n\n    set muted(val) {\n      if (this.castPlayer) {\n        if ((val && !this.castPlayer.isMuted) || (!val && this.castPlayer.isMuted)) {\n          this.castPlayer.controller?.muteOrUnmute();\n        }\n        return;\n      }\n      super.muted = val;\n    }\n\n    get volume() {\n      if (this.castPlayer) return this.castPlayer?.volumeLevel ?? 1;\n      return super.volume;\n    }\n\n    set volume(val) {\n      if (this.castPlayer) {\n        this.castPlayer.volumeLevel = val;\n        this.castPlayer.controller?.setVolumeLevel();\n        return;\n      }\n      super.volume = val;\n    }\n\n    get duration() {\n      // castPlayer duration returns `0` when no media is loaded.\n      if (this.castPlayer && this.#isMediaLoaded) {\n        return this.castPlayer?.duration ?? NaN;\n      }\n      return super.duration;\n    }\n\n    get currentTime() {\n      if (this.castPlayer && this.#isMediaLoaded) {\n        return this.castPlayer?.currentTime ?? 0;\n      }\n      return super.currentTime;\n    }\n\n    set currentTime(val) {\n      if (this.castPlayer) {\n        this.castPlayer.currentTime = val;\n        this.castPlayer.controller?.seek();\n        return;\n      }\n      super.currentTime = val;\n    }\n\n    get onentercast() {\n      return this.#enterCastCallback;\n    }\n\n    set onentercast(callback) {\n      if (this.#enterCastCallback) {\n        this.removeEventListener('entercast', this.#enterCastCallback);\n        this.#enterCastCallback = null;\n      }\n      if (typeof callback == 'function') {\n        this.#enterCastCallback = callback;\n        this.addEventListener('entercast', callback);\n      }\n    }\n\n    get onleavecast() {\n      return this.#leaveCastCallback;\n    }\n\n    set onleavecast(callback) {\n      if (this.#leaveCastCallback) {\n        this.removeEventListener('leavecast', this.#leaveCastCallback);\n        this.#leaveCastCallback = null;\n      }\n      if (typeof callback == 'function') {\n        this.#leaveCastCallback = callback;\n        this.addEventListener('leavecast', callback);\n      }\n    }\n\n    get oncastchange() {\n      return this.#castChangeCallback;\n    }\n\n    set oncastchange(callback) {\n      if (this.#castChangeCallback) {\n        this.removeEventListener('castchange', this.#castChangeCallback);\n        this.#castChangeCallback = null;\n      }\n      if (typeof callback == 'function') {\n        this.#castChangeCallback = callback;\n        this.addEventListener('castchange', callback);\n      }\n    }\n  };\n\nconst CastableVideoElement = CastableVideoMixin(HTMLVideoElement);\n\nif (!customElements.get('castable-video')) {\n  customElements.define('castable-video', CastableVideoElement, {\n    extends: 'video',\n  });\n  globalThis.CastableVideoElement = CastableVideoElement;\n}\n\nCastableVideoElement.initCast();\n", "import 'castable-video';\n\n/**\n * Custom Video Element\n * The goal is to create an element that works just like the video element\n * but can be extended/sub-classed, because native elements cannot be\n * extended today across browsers.\n */\n\n// The onevent like props are weirdly set on the HTMLElement prototype with other\n// generic events making it impossible to pick these specific to HTMLMediaElement.\nexport const VideoEvents = [\n  'abort',\n  'canplay',\n  'canplaythrough',\n  'durationchange',\n  'emptied',\n  'encrypted',\n  'ended',\n  'error',\n  'loadeddata',\n  'loadedmetadata',\n  'loadstart',\n  'pause',\n  'play',\n  'playing',\n  'progress',\n  'ratechange',\n  'seeked',\n  'seeking',\n  'stalled',\n  'suspend',\n  'timeupdate',\n  'volumechange',\n  'waiting',\n  'waitingforkey',\n  'resize',\n  'enterpictureinpicture',\n  'leavepictureinpicture',\n  'castchange',\n  'entercast',\n  'leavecast',\n];\n\nconst template = document.createElement('template');\n// Could you get styles to apply by passing a global button from global to shadow?\n\ntemplate.innerHTML = `\n<style>\n  :host {\n    display: inline-block;\n    line-height: 0;\n    width: auto;\n    height: auto;\n  }\n\n  video {\n    max-width: 100%;\n    max-height: 100%;\n    min-width: 100%;\n    min-height: 100%;\n  }\n</style>\n<video is=\"castable-video\" part=\"video\" crossorigin></video>\n<slot></slot>\n`;\n\nclass CustomVideoElement extends HTMLElement {\n  #hasAttrCallback;\n  #isInit;\n\n  constructor() {\n    super();\n    this.attachShadow({ mode: 'open' });\n\n    // If the custom element is defined before the <custom-video> HTML is parsed\n    // no attributes will be available in the constructor (construction process).\n    // Wait until initializing attributes in the attributeChangedCallback.\n    // If this element is connected to the DOM, the attributes will be available.\n    if (this.isConnected) {\n      this.#init();\n    }\n  }\n\n  #init() {\n    if (this.#isInit) return;\n    this.#isInit = true;\n\n    this.shadowRoot.append(template.content.cloneNode(true));\n    this.nativeEl = this.shadowRoot.querySelector('video');\n\n    // The video events are dispatched on the CustomVideoElement instance.\n    // This makes it possible to add event listeners before the element is upgraded.\n    VideoEvents.forEach((type) => {\n      this.nativeEl.addEventListener(type, (evt) => {\n        this.dispatchEvent(new CustomEvent(evt.type, { detail: evt.detail }));\n      });\n    });\n\n    // An unnamed <slot> will be filled with all of the custom element's\n    // top-level child nodes that do not have the slot attribute.\n    const slotEl = this.shadowRoot.querySelector('slot');\n    slotEl.addEventListener('slotchange', () => {\n      slotEl.assignedElements().forEach((el) => {\n        if (!['track', 'source'].includes(el.localName)) return;\n        this.nativeEl.append(el);\n      });\n    });\n\n    // Initialize all the attribute properties\n    // This is required before attributeChangedCallback is called after construction\n    // so the initial state of all the attributes are forwarded to the native element.\n    // Don't call attributeChangedCallback directly here because the extending class\n    // could have overridden attributeChangedCallback leading to unexpected results.\n    Array.prototype.forEach.call(this.attributes, (attrNode) => {\n      this.#forwardAttribute(attrNode.name, null, attrNode.value);\n    });\n\n    // Neither Chrome or Firefox support setting the muted attribute\n    // after using document.createElement.\n    // One way to get around this would be to build the native tag as a string.\n    // But just fixing it manually for now.\n    // Apparently this may also be an issue with <input checked> for buttons\n    if (this.nativeEl.defaultMuted) {\n      this.nativeEl.muted = true;\n    }\n  }\n\n  // observedAttributes is required to trigger attributeChangedCallback\n  // for any attributes on the custom element.\n  // Attributes need to be the lowercase word, e.g. crossorigin, not crossOrigin\n  static get observedAttributes() {\n    let attrs = [];\n\n    const kebabCase = (name) => {\n      return name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n    };\n\n    // Instead of manually creating a list of all observed attributes, observe\n    // any getter/setter prop name (lowercase or kebab-case for custom builtins)\n    Object.getOwnPropertyNames(this.prototype).forEach((propName) => {\n      let isFunc = false;\n\n      // Non-func properties throw errors because it's not an instance\n      try {\n        if (typeof this.prototype[propName] === 'function') {\n          isFunc = true;\n        }\n      } catch (e) {}\n\n      // Exclude functions and constants\n      if (!isFunc && propName !== propName.toUpperCase()) {\n        attrs.push(propName.toLowerCase(), kebabCase(propName));\n      }\n    });\n\n    // Include any attributes from the super class (recursive)\n    const supAttrs = Object.getPrototypeOf(this).observedAttributes;\n\n    if (supAttrs) {\n      attrs = attrs.concat(supAttrs);\n    }\n\n    return attrs;\n  }\n\n  attributeChangedCallback(attrName, oldValue, newValue) {\n    // Initialize the attributes right after construction when they become available.\n    if (!this.#hasAttrCallback && !this.isConnected) {\n      this.#hasAttrCallback = true;\n      this.#init();\n    }\n\n    this.#forwardAttribute(attrName, oldValue, newValue);\n  }\n\n  // We need to handle sub-class custom attributes differently from\n  // attrs meant to be passed to the internal native el.\n  #forwardAttribute(attrName, oldValue, newValue) {\n    // Find the matching prop for custom attributes\n    const ownProps = Object.getOwnPropertyNames(Object.getPrototypeOf(this));\n    const propName = arrayFindAnyCase(ownProps, attrName);\n\n    // Check if this is the original custom native elemnt or a subclass\n    const isBaseElement = Object.getPrototypeOf(this.constructor).toString().indexOf('function HTMLElement') === 0;\n\n    // If this is a subclass custom attribute we want to set the\n    // matching property on the subclass\n    if (propName && !isBaseElement) {\n      // Boolean props should never start as null\n      if (typeof this[propName] == 'boolean') {\n        // null is returned when attributes are removed i.e. boolean attrs\n        if (newValue === null) {\n          this[propName] = false;\n        } else {\n          // The new value might be an empty string, which is still true\n          // for boolean attributes\n          this[propName] = true;\n        }\n      } else {\n        this[propName] = newValue;\n      }\n    } else {\n      // When this is the original Custom Element, or the subclass doesn't\n      // have a matching prop, pass it through.\n      if (newValue === null) {\n        this.nativeEl.removeAttribute(attrName);\n      } else {\n        // Ignore a few that don't need to be passed through just in case\n        // it creates unexpected behavior.\n        if (['id', 'class'].indexOf(attrName) === -1) {\n          this.nativeEl.setAttribute(attrName, newValue);\n        }\n      }\n    }\n  }\n\n  connectedCallback() {}\n}\n\n// Map all native element properties to the custom element\n// so that they're applied to the native element.\n// Skipping HTMLElement because of things like \"attachShadow\"\n// causing issues. Most of those props still need to apply to\n// the custom element.\nlet nativeElProps = [];\n\n// Can't check typeof directly on element prototypes without\n// throwing Illegal Invocation errors, so creating an element\n// to check on instead.\nconst nativeElTest = document.createElement('video', {\n  is: 'castable-video',\n});\n\n// Deprecated props throw warnings if used, so exclude them\nconst deprecatedProps = ['webkitDisplayingFullscreen', 'webkitSupportsFullscreen'];\n\n// Walk the prototype chain up to HTMLElement.\n// This will grab all super class props in between.\n// i.e. VideoElement and MediaElement\nfor (\n  let proto = Object.getPrototypeOf(nativeElTest);\n  proto && proto !== HTMLElement.prototype;\n  proto = Object.getPrototypeOf(proto)\n) {\n  Object.getOwnPropertyNames(proto).forEach((key) => {\n    if (deprecatedProps.indexOf(key) === -1) {\n      nativeElProps.push(key);\n    }\n  });\n}\n\n// Passthrough native el functions from the custom el to the native el\nnativeElProps.forEach((prop) => {\n  if (prop in CustomVideoElement.prototype) return;\n\n  const type = typeof nativeElTest[prop];\n  if (type == 'function') {\n    // Function\n    CustomVideoElement.prototype[prop] = function () {\n      return this.nativeEl[prop].apply(this.nativeEl, arguments);\n    };\n  } else {\n    // Getter\n    let config = {\n      get() {\n        return this.nativeEl[prop];\n      },\n    };\n\n    if (prop !== prop.toUpperCase()) {\n      // Setter (not a CONSTANT)\n      config.set = function (val) {\n        this.nativeEl[prop] = val;\n      };\n    }\n\n    Object.defineProperty(CustomVideoElement.prototype, prop, config);\n  }\n});\n\nfunction arrayFindAnyCase(arr, word) {\n  let found = null;\n\n  arr.forEach((item) => {\n    if (item.toLowerCase() == word.toLowerCase()) {\n      found = item;\n    }\n  });\n\n  return found;\n}\n\nif (!globalThis.customElements.get('custom-video')) {\n  globalThis.customElements.define('custom-video', CustomVideoElement);\n  globalThis.CustomVideoElement = CustomVideoElement;\n}\n\nexport default CustomVideoElement;\n"],
  "mappings": "ijBAAA,8KCIA,GAAM,IAAsB,IAAM,CAChC,GAAI,CAEF,MA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