import F from "react";
import { __require as G } from "../../../../load-script@1.0.0/node_modules/load-script/index.js";
import { __require as V } from "../../../../deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js";
var _, P;
function te() {
  if (P) return _;
  P = 1;
  var S = Object.create, u = Object.defineProperty, h = Object.getOwnPropertyDescriptor, M = Object.getOwnPropertyNames, O = Object.getPrototypeOf, T = Object.prototype.hasOwnProperty, x = (e, t) => {
    for (var r in t)
      u(e, r, { get: t[r], enumerable: !0 });
  }, w = (e, t, r, n) => {
    if (t && typeof t == "object" || typeof t == "function")
      for (let o of M(t))
        !T.call(e, o) && o !== r && u(e, o, { get: () => t[o], enumerable: !(n = h(t, o)) || n.enumerable });
    return e;
  }, c = (e, t, r) => (r = e != null ? S(O(e)) : {}, w(
    // If the importer is in node compatibility mode or this is not an ESM
    // file that has been converted to a CommonJS file using a Babel-
    // compatible transform (i.e. "__esModule" has not been set), then set
    // "default" to the CommonJS "module.exports" for node compatibility.
    !e || !e.__esModule ? u(r, "default", { value: e, enumerable: !0 }) : r,
    e
  )), j = (e) => w(u({}, "__esModule", { value: !0 }), e), m = {};
  x(m, {
    callPlayer: () => Q,
    getConfig: () => B,
    getSDK: () => z,
    isBlobUrl: () => Y,
    isMediaStream: () => W,
    lazy: () => C,
    omit: () => L,
    parseEndTime: () => I,
    parseStartTime: () => R,
    queryString: () => H,
    randomString: () => $,
    supportsWebKitPresentationMode: () => J
  }), _ = j(m);
  var q = c(F), E = c(G()), A = c(V());
  const C = (e) => q.default.lazy(async () => {
    const t = await e();
    return typeof t.default == "function" ? t : t.default;
  }), U = /[?&#](?:start|t)=([0-9hms]+)/, D = /[?&#]end=([0-9hms]+)/, f = /(\d+)(h|m|s)/g, K = /^\d+$/;
  function y(e, t) {
    if (e instanceof Array)
      return;
    const r = e.match(t);
    if (r) {
      const n = r[1];
      if (n.match(f))
        return N(n);
      if (K.test(n))
        return parseInt(n);
    }
  }
  function N(e) {
    let t = 0, r = f.exec(e);
    for (; r !== null; ) {
      const [, n, o] = r;
      o === "h" && (t += parseInt(n, 10) * 60 * 60), o === "m" && (t += parseInt(n, 10) * 60), o === "s" && (t += parseInt(n, 10)), r = f.exec(e);
    }
    return t;
  }
  function R(e) {
    return y(e, U);
  }
  function I(e) {
    return y(e, D);
  }
  function $() {
    return Math.random().toString(36).substr(2, 5);
  }
  function H(e) {
    return Object.keys(e).map((t) => `${t}=${e[t]}`).join("&");
  }
  function l(e) {
    return window[e] ? window[e] : window.exports && window.exports[e] ? window.exports[e] : window.module && window.module.exports && window.module.exports[e] ? window.module.exports[e] : null;
  }
  const a = {}, z = function(t, r, n = null, o = () => !0, s = E.default) {
    const p = l(r);
    return p && o(p) ? Promise.resolve(p) : new Promise((g, b) => {
      if (a[t]) {
        a[t].push({ resolve: g, reject: b });
        return;
      }
      a[t] = [{ resolve: g, reject: b }];
      const v = (i) => {
        a[t].forEach((d) => d.resolve(i));
      };
      if (n) {
        const i = window[n];
        window[n] = function() {
          i && i(), v(l(r));
        };
      }
      s(t, (i) => {
        i ? (a[t].forEach((d) => d.reject(i)), a[t] = null) : n || v(l(r));
      });
    });
  };
  function B(e, t) {
    return (0, A.default)(t.config, e.config);
  }
  function L(e, ...t) {
    const r = [].concat(...t), n = {}, o = Object.keys(e);
    for (const s of o)
      r.indexOf(s) === -1 && (n[s] = e[s]);
    return n;
  }
  function Q(e, ...t) {
    if (!this.player || !this.player[e]) {
      let r = `ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;
      return this.player ? this.player[e] || (r += "The method was not available") : r += "The player was not available", console.warn(r, "font-weight: bold", ""), null;
    }
    return this.player[e](...t);
  }
  function W(e) {
    return typeof window < "u" && typeof window.MediaStream < "u" && e instanceof window.MediaStream;
  }
  function Y(e) {
    return /^blob:/.test(e);
  }
  function J(e = document.createElement("video")) {
    const t = /iPhone|iPod/.test(navigator.userAgent) === !1;
    return e.webkitSupportsPresentationMode && typeof e.webkitSetPresentationMode == "function" && t;
  }
  function X(e) {
    return e;
  }
  return _;
}
export {
  te as __require
};
//# sourceMappingURL=utils.js.map
