"use strict";
(self["webpackChunkspeechwidgets"] = self["webpackChunkspeechwidgets"] || []).push([["vendors-node_modules_react-audio-spectrogram-player_dist_react-audio-spectrogram-player_es_js"],{

/***/ "./node_modules/react-audio-spectrogram-player/dist/react-audio-spectrogram-player.es.js":
/*!***********************************************************************************************!*\
  !*** ./node_modules/react-audio-spectrogram-player/dist/react-audio-spectrogram-player.es.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Yr)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("button{all:unset;border-radius:5px;font-family:monospace;text-align:center;padding:5px;cursor:pointer}button.light{background-color:#0001;color:#000}button.light:hover{background-color:#0003}button.dark{background-color:#fff2;color:#fff}button.dark:hover{background-color:#fff3}.gridcell{padding:5px;text-align:center}.gridcell:not(.header){cursor:pointer}.gridcell.light{background-color:#0001;color:#000}.gridcell.header.light{background-color:#0003}.gridcell.light:not(.header):not(.selected):hover{background-color:#0002}.gridcell.light.selected{background-color:#0003}.gridcell.dark{background-color:#fff1;color:#fff}.gridcell.header.dark{background-color:#fff3}.gridcell.dark:not(.header):not(.selected):hover{background-color:#fff2}.gridcell.dark.selected{background-color:#fff3}.slidecontainer{width:100%;display:flex;align-items:center}.slidervalue{padding:5px}.slider{-webkit-appearance:none;appearance:none;width:100%;height:25px;outline:none;opacity:.7;-webkit-transition:.2s;transition:opacity .2s}.slider:hover{opacity:1}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:25px;height:25px;cursor:pointer}.slider::-moz-range-thumb{width:25px;height:25px;cursor:pointer}.slidervalue.light{color:#000}.slider.light{background:#00000011}.slider.light::-webkit-slider-thumb{background:#00000044}.slider.light::-moz-range-thumb{background:#00000044}.slidervalue.dark{color:#fff}.slider.dark{background:#ffffff11}.slider.dark::-webkit-slider-thumb{background:#ffffff44}.slider.dark::-moz-range-thumb{background:#ffffff44}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();

var u = {}, pr = {
  get exports() {
    return u;
  },
  set exports(t) {
    u = t;
  }
}, q = {};
/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var Le;
function yr() {
  if (Le)
    return q;
  Le = 1;
  var t = (react__WEBPACK_IMPORTED_MODULE_0___default()), l = Symbol.for("react.element"), x = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, R = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
  function v(c, g, i) {
    var s, m = {}, o = null, S = null;
    i !== void 0 && (o = "" + i), g.key !== void 0 && (o = "" + g.key), g.ref !== void 0 && (S = g.ref);
    for (s in g)
      a.call(g, s) && !y.hasOwnProperty(s) && (m[s] = g[s]);
    if (c && c.defaultProps)
      for (s in g = c.defaultProps, g)
        m[s] === void 0 && (m[s] = g[s]);
    return { $$typeof: l, type: c, key: o, ref: S, props: m, _owner: R.current };
  }
  return q.Fragment = x, q.jsx = v, q.jsxs = v, q;
}
var G = {};
/**
 * @license React
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var Ue;
function Tr() {
  return Ue || (Ue = 1,  true && function() {
    var t = (react__WEBPACK_IMPORTED_MODULE_0___default()), l = Symbol.for("react.element"), x = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), c = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), i = Symbol.for("react.suspense"), s = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), o = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), _ = Symbol.iterator, C = "@@iterator";
    function w(e) {
      if (e === null || typeof e != "object")
        return null;
      var r = _ && e[_] || e[C];
      return typeof r == "function" ? r : null;
    }
    var b = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    function d(e) {
      {
        for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), f = 1; f < r; f++)
          n[f - 1] = arguments[f];
        $("error", e, n);
      }
    }
    function $(e, r, n) {
      {
        var f = b.ReactDebugCurrentFrame, T = f.getStackAddendum();
        T !== "" && (r += "%s", n = n.concat([T]));
        var E = n.map(function(p) {
          return String(p);
        });
        E.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, E);
      }
    }
    var Y = !1, W = !1, B = !1, k = !1, ae = !1, X;
    X = Symbol.for("react.module.reference");
    function oe(e) {
      return !!(typeof e == "string" || typeof e == "function" || e === a || e === y || ae || e === R || e === i || e === s || k || e === S || Y || W || B || typeof e == "object" && e !== null && (e.$$typeof === o || e.$$typeof === m || e.$$typeof === v || e.$$typeof === c || e.$$typeof === g || // This needs to include all possible module reference object
      // types supported by any Flight configuration anywhere since
      // we don't know which Flight build this will end up being used
      // with.
      e.$$typeof === X || e.getModuleId !== void 0));
    }
    function L(e, r, n) {
      var f = e.displayName;
      if (f)
        return f;
      var T = r.displayName || r.name || "";
      return T !== "" ? n + "(" + T + ")" : n;
    }
    function F(e) {
      return e.displayName || "Context";
    }
    function O(e) {
      if (e == null)
        return null;
      if (typeof e.tag == "number" && d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
        return e.displayName || e.name || null;
      if (typeof e == "string")
        return e;
      switch (e) {
        case a:
          return "Fragment";
        case x:
          return "Portal";
        case y:
          return "Profiler";
        case R:
          return "StrictMode";
        case i:
          return "Suspense";
        case s:
          return "SuspenseList";
      }
      if (typeof e == "object")
        switch (e.$$typeof) {
          case c:
            var r = e;
            return F(r) + ".Consumer";
          case v:
            var n = e;
            return F(n._context) + ".Provider";
          case g:
            return L(e, e.render, "ForwardRef");
          case m:
            var f = e.displayName || null;
            return f !== null ? f : O(e.type) || "Memo";
          case o: {
            var T = e, E = T._payload, p = T._init;
            try {
              return O(p(E));
            } catch {
              return null;
            }
          }
        }
      return null;
    }
    var A = Object.assign, U = 0, se, pe, ye, Te, Re, Ee, we;
    function _e() {
    }
    _e.__reactDisabledLog = !0;
    function Ge() {
      {
        if (U === 0) {
          se = console.log, pe = console.info, ye = console.warn, Te = console.error, Re = console.group, Ee = console.groupCollapsed, we = console.groupEnd;
          var e = {
            configurable: !0,
            enumerable: !0,
            value: _e,
            writable: !0
          };
          Object.defineProperties(console, {
            info: e,
            log: e,
            warn: e,
            error: e,
            group: e,
            groupCollapsed: e,
            groupEnd: e
          });
        }
        U++;
      }
    }
    function He() {
      {
        if (U--, U === 0) {
          var e = {
            configurable: !0,
            enumerable: !0,
            writable: !0
          };
          Object.defineProperties(console, {
            log: A({}, e, {
              value: se
            }),
            info: A({}, e, {
              value: pe
            }),
            warn: A({}, e, {
              value: ye
            }),
            error: A({}, e, {
              value: Te
            }),
            group: A({}, e, {
              value: Re
            }),
            groupCollapsed: A({}, e, {
              value: Ee
            }),
            groupEnd: A({}, e, {
              value: we
            })
          });
        }
        U < 0 && d("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
      }
    }
    var de = b.ReactCurrentDispatcher, le;
    function K(e, r, n) {
      {
        if (le === void 0)
          try {
            throw Error();
          } catch (T) {
            var f = T.stack.trim().match(/\n( *(at )?)/);
            le = f && f[1] || "";
          }
        return `
` + le + e;
      }
    }
    var ce = !1, Q;
    {
      var Je = typeof WeakMap == "function" ? WeakMap : Map;
      Q = new Je();
    }
    function Ce(e, r) {
      if (!e || ce)
        return "";
      {
        var n = Q.get(e);
        if (n !== void 0)
          return n;
      }
      var f;
      ce = !0;
      var T = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var E;
      E = de.current, de.current = null, Ge();
      try {
        if (r) {
          var p = function() {
            throw Error();
          };
          if (Object.defineProperty(p.prototype, "props", {
            set: function() {
              throw Error();
            }
          }), typeof Reflect == "object" && Reflect.construct) {
            try {
              Reflect.construct(p, []);
            } catch (N) {
              f = N;
            }
            Reflect.construct(e, [], p);
          } else {
            try {
              p.call();
            } catch (N) {
              f = N;
            }
            e.call(p.prototype);
          }
        } else {
          try {
            throw Error();
          } catch (N) {
            f = N;
          }
          e();
        }
      } catch (N) {
        if (N && f && typeof N.stack == "string") {
          for (var h = N.stack.split(`
`), D = f.stack.split(`
`), j = h.length - 1, P = D.length - 1; j >= 1 && P >= 0 && h[j] !== D[P]; )
            P--;
          for (; j >= 1 && P >= 0; j--, P--)
            if (h[j] !== D[P]) {
              if (j !== 1 || P !== 1)
                do
                  if (j--, P--, P < 0 || h[j] !== D[P]) {
                    var M = `
` + h[j].replace(" at new ", " at ");
                    return e.displayName && M.includes("<anonymous>") && (M = M.replace("<anonymous>", e.displayName)), typeof e == "function" && Q.set(e, M), M;
                  }
                while (j >= 1 && P >= 0);
              break;
            }
        }
      } finally {
        ce = !1, de.current = E, He(), Error.prepareStackTrace = T;
      }
      var z = e ? e.displayName || e.name : "", We = z ? K(z) : "";
      return typeof e == "function" && Q.set(e, We), We;
    }
    function Xe(e, r, n) {
      return Ce(e, !1);
    }
    function Ke(e) {
      var r = e.prototype;
      return !!(r && r.isReactComponent);
    }
    function ee(e, r, n) {
      if (e == null)
        return "";
      if (typeof e == "function")
        return Ce(e, Ke(e));
      if (typeof e == "string")
        return K(e);
      switch (e) {
        case i:
          return K("Suspense");
        case s:
          return K("SuspenseList");
      }
      if (typeof e == "object")
        switch (e.$$typeof) {
          case g:
            return Xe(e.render);
          case m:
            return ee(e.type, r, n);
          case o: {
            var f = e, T = f._payload, E = f._init;
            try {
              return ee(E(T), r, n);
            } catch {
            }
          }
        }
      return "";
    }
    var re = Object.prototype.hasOwnProperty, je = {}, Se = b.ReactDebugCurrentFrame;
    function ne(e) {
      if (e) {
        var r = e._owner, n = ee(e.type, e._source, r ? r.type : null);
        Se.setExtraStackFrame(n);
      } else
        Se.setExtraStackFrame(null);
    }
    function Qe(e, r, n, f, T) {
      {
        var E = Function.call.bind(re);
        for (var p in e)
          if (E(e, p)) {
            var h = void 0;
            try {
              if (typeof e[p] != "function") {
                var D = Error((f || "React class") + ": " + n + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                throw D.name = "Invariant Violation", D;
              }
              h = e[p](r, p, f, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
            } catch (j) {
              h = j;
            }
            h && !(h instanceof Error) && (ne(T), d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", f || "React class", n, p, typeof h), ne(null)), h instanceof Error && !(h.message in je) && (je[h.message] = !0, ne(T), d("Failed %s type: %s", n, h.message), ne(null));
          }
      }
    }
    var er = Array.isArray;
    function ue(e) {
      return er(e);
    }
    function rr(e) {
      {
        var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
        return n;
      }
    }
    function nr(e) {
      try {
        return Pe(e), !1;
      } catch {
        return !0;
      }
    }
    function Pe(e) {
      return "" + e;
    }
    function ke(e) {
      if (nr(e))
        return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rr(e)), Pe(e);
    }
    var Z = b.ReactCurrentOwner, tr = {
      key: !0,
      ref: !0,
      __self: !0,
      __source: !0
    }, Oe, De, ge;
    ge = {};
    function ir(e) {
      if (re.call(e, "ref")) {
        var r = Object.getOwnPropertyDescriptor(e, "ref").get;
        if (r && r.isReactWarning)
          return !1;
      }
      return e.ref !== void 0;
    }
    function ar(e) {
      if (re.call(e, "key")) {
        var r = Object.getOwnPropertyDescriptor(e, "key").get;
        if (r && r.isReactWarning)
          return !1;
      }
      return e.key !== void 0;
    }
    function or(e, r) {
      if (typeof e.ref == "string" && Z.current && r && Z.current.stateNode !== r) {
        var n = O(Z.current.type);
        ge[n] || (d('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', O(Z.current.type), e.ref), ge[n] = !0);
      }
    }
    function sr(e, r) {
      {
        var n = function() {
          Oe || (Oe = !0, d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
        };
        n.isReactWarning = !0, Object.defineProperty(e, "key", {
          get: n,
          configurable: !0
        });
      }
    }
    function dr(e, r) {
      {
        var n = function() {
          De || (De = !0, d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
        };
        n.isReactWarning = !0, Object.defineProperty(e, "ref", {
          get: n,
          configurable: !0
        });
      }
    }
    var lr = function(e, r, n, f, T, E, p) {
      var h = {
        // This tag allows us to uniquely identify this as a React Element
        $$typeof: l,
        // Built-in properties that belong on the element
        type: e,
        key: r,
        ref: n,
        props: p,
        // Record the component responsible for creating this element.
        _owner: E
      };
      return h._store = {}, Object.defineProperty(h._store, "validated", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: !1
      }), Object.defineProperty(h, "_self", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: f
      }), Object.defineProperty(h, "_source", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: T
      }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
    };
    function cr(e, r, n, f, T) {
      {
        var E, p = {}, h = null, D = null;
        n !== void 0 && (ke(n), h = "" + n), ar(r) && (ke(r.key), h = "" + r.key), ir(r) && (D = r.ref, or(r, T));
        for (E in r)
          re.call(r, E) && !tr.hasOwnProperty(E) && (p[E] = r[E]);
        if (e && e.defaultProps) {
          var j = e.defaultProps;
          for (E in j)
            p[E] === void 0 && (p[E] = j[E]);
        }
        if (h || D) {
          var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
          h && sr(p, P), D && dr(p, P);
        }
        return lr(e, h, D, T, f, Z.current, p);
      }
    }
    var fe = b.ReactCurrentOwner, Me = b.ReactDebugCurrentFrame;
    function V(e) {
      if (e) {
        var r = e._owner, n = ee(e.type, e._source, r ? r.type : null);
        Me.setExtraStackFrame(n);
      } else
        Me.setExtraStackFrame(null);
    }
    var be;
    be = !1;
    function xe(e) {
      return typeof e == "object" && e !== null && e.$$typeof === l;
    }
    function $e() {
      {
        if (fe.current) {
          var e = O(fe.current.type);
          if (e)
            return `

Check the render method of \`` + e + "`.";
        }
        return "";
      }
    }
    function ur(e) {
      {
        if (e !== void 0) {
          var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
          return `

Check your code at ` + r + ":" + n + ".";
        }
        return "";
      }
    }
    var Ae = {};
    function gr(e) {
      {
        var r = $e();
        if (!r) {
          var n = typeof e == "string" ? e : e.displayName || e.name;
          n && (r = `

Check the top-level render call using <` + n + ">.");
        }
        return r;
      }
    }
    function Ie(e, r) {
      {
        if (!e._store || e._store.validated || e.key != null)
          return;
        e._store.validated = !0;
        var n = gr(r);
        if (Ae[n])
          return;
        Ae[n] = !0;
        var f = "";
        e && e._owner && e._owner !== fe.current && (f = " It was passed a child from " + O(e._owner.type) + "."), V(e), d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, f), V(null);
      }
    }
    function Fe(e, r) {
      {
        if (typeof e != "object")
          return;
        if (ue(e))
          for (var n = 0; n < e.length; n++) {
            var f = e[n];
            xe(f) && Ie(f, r);
          }
        else if (xe(e))
          e._store && (e._store.validated = !0);
        else if (e) {
          var T = w(e);
          if (typeof T == "function" && T !== e.entries)
            for (var E = T.call(e), p; !(p = E.next()).done; )
              xe(p.value) && Ie(p.value, r);
        }
      }
    }
    function fr(e) {
      {
        var r = e.type;
        if (r == null || typeof r == "string")
          return;
        var n;
        if (typeof r == "function")
          n = r.propTypes;
        else if (typeof r == "object" && (r.$$typeof === g || // Note: Memo only checks outer props here.
        // Inner props are checked in the reconciler.
        r.$$typeof === m))
          n = r.propTypes;
        else
          return;
        if (n) {
          var f = O(r);
          Qe(n, e.props, "prop", f, e);
        } else if (r.PropTypes !== void 0 && !be) {
          be = !0;
          var T = O(r);
          d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
        }
        typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
      }
    }
    function br(e) {
      {
        for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
          var f = r[n];
          if (f !== "children" && f !== "key") {
            V(e), d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", f), V(null);
            break;
          }
        }
        e.ref !== null && (V(e), d("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
      }
    }
    function Ne(e, r, n, f, T, E) {
      {
        var p = oe(e);
        if (!p) {
          var h = "";
          (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
          var D = ur(T);
          D ? h += D : h += $e();
          var j;
          e === null ? j = "null" : ue(e) ? j = "array" : e !== void 0 && e.$$typeof === l ? (j = "<" + (O(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : j = typeof e, d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, h);
        }
        var P = cr(e, r, n, T, E);
        if (P == null)
          return P;
        if (p) {
          var M = r.children;
          if (M !== void 0)
            if (f)
              if (ue(M)) {
                for (var z = 0; z < M.length; z++)
                  Fe(M[z], e);
                Object.freeze && Object.freeze(M);
              } else
                d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
            else
              Fe(M, e);
        }
        return e === a ? br(P) : fr(P), P;
      }
    }
    function xr(e, r, n) {
      return Ne(e, r, n, !0);
    }
    function mr(e, r, n) {
      return Ne(e, r, n, !1);
    }
    var vr = mr, hr = xr;
    G.Fragment = a, G.jsx = vr, G.jsxs = hr;
  }()), G;
}
(function(t) {
   false ? 0 : t.exports = Tr();
})(pr);
var Rr = {
  jet: [{ index: 0, rgb: [0, 0, 131] }, { index: 0.125, rgb: [0, 60, 170] }, { index: 0.375, rgb: [5, 255, 255] }, { index: 0.625, rgb: [255, 255, 0] }, { index: 0.875, rgb: [250, 0, 0] }, { index: 1, rgb: [128, 0, 0] }],
  hsv: [{ index: 0, rgb: [255, 0, 0] }, { index: 0.169, rgb: [253, 255, 2] }, { index: 0.173, rgb: [247, 255, 2] }, { index: 0.337, rgb: [0, 252, 4] }, { index: 0.341, rgb: [0, 252, 10] }, { index: 0.506, rgb: [1, 249, 255] }, { index: 0.671, rgb: [2, 0, 253] }, { index: 0.675, rgb: [8, 0, 253] }, { index: 0.839, rgb: [255, 0, 251] }, { index: 0.843, rgb: [255, 0, 245] }, { index: 1, rgb: [255, 0, 6] }],
  hot: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.3, rgb: [230, 0, 0] }, { index: 0.6, rgb: [255, 210, 0] }, { index: 1, rgb: [255, 255, 255] }],
  spring: [{ index: 0, rgb: [255, 0, 255] }, { index: 1, rgb: [255, 255, 0] }],
  summer: [{ index: 0, rgb: [0, 128, 102] }, { index: 1, rgb: [255, 255, 102] }],
  autumn: [{ index: 0, rgb: [255, 0, 0] }, { index: 1, rgb: [255, 255, 0] }],
  winter: [{ index: 0, rgb: [0, 0, 255] }, { index: 1, rgb: [0, 255, 128] }],
  bone: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.376, rgb: [84, 84, 116] }, { index: 0.753, rgb: [169, 200, 200] }, { index: 1, rgb: [255, 255, 255] }],
  copper: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.804, rgb: [255, 160, 102] }, { index: 1, rgb: [255, 199, 127] }],
  greys: [{ index: 0, rgb: [0, 0, 0] }, { index: 1, rgb: [255, 255, 255] }],
  yignbu: [{ index: 0, rgb: [8, 29, 88] }, { index: 0.125, rgb: [37, 52, 148] }, { index: 0.25, rgb: [34, 94, 168] }, { index: 0.375, rgb: [29, 145, 192] }, { index: 0.5, rgb: [65, 182, 196] }, { index: 0.625, rgb: [127, 205, 187] }, { index: 0.75, rgb: [199, 233, 180] }, { index: 0.875, rgb: [237, 248, 217] }, { index: 1, rgb: [255, 255, 217] }],
  greens: [{ index: 0, rgb: [0, 68, 27] }, { index: 0.125, rgb: [0, 109, 44] }, { index: 0.25, rgb: [35, 139, 69] }, { index: 0.375, rgb: [65, 171, 93] }, { index: 0.5, rgb: [116, 196, 118] }, { index: 0.625, rgb: [161, 217, 155] }, { index: 0.75, rgb: [199, 233, 192] }, { index: 0.875, rgb: [229, 245, 224] }, { index: 1, rgb: [247, 252, 245] }],
  yiorrd: [{ index: 0, rgb: [128, 0, 38] }, { index: 0.125, rgb: [189, 0, 38] }, { index: 0.25, rgb: [227, 26, 28] }, { index: 0.375, rgb: [252, 78, 42] }, { index: 0.5, rgb: [253, 141, 60] }, { index: 0.625, rgb: [254, 178, 76] }, { index: 0.75, rgb: [254, 217, 118] }, { index: 0.875, rgb: [255, 237, 160] }, { index: 1, rgb: [255, 255, 204] }],
  bluered: [{ index: 0, rgb: [0, 0, 255] }, { index: 1, rgb: [255, 0, 0] }],
  rdbu: [{ index: 0, rgb: [5, 10, 172] }, { index: 0.35, rgb: [106, 137, 247] }, { index: 0.5, rgb: [190, 190, 190] }, { index: 0.6, rgb: [220, 170, 132] }, { index: 0.7, rgb: [230, 145, 90] }, { index: 1, rgb: [178, 10, 28] }],
  picnic: [{ index: 0, rgb: [0, 0, 255] }, { index: 0.1, rgb: [51, 153, 255] }, { index: 0.2, rgb: [102, 204, 255] }, { index: 0.3, rgb: [153, 204, 255] }, { index: 0.4, rgb: [204, 204, 255] }, { index: 0.5, rgb: [255, 255, 255] }, { index: 0.6, rgb: [255, 204, 255] }, { index: 0.7, rgb: [255, 153, 255] }, { index: 0.8, rgb: [255, 102, 204] }, { index: 0.9, rgb: [255, 102, 102] }, { index: 1, rgb: [255, 0, 0] }],
  rainbow: [{ index: 0, rgb: [150, 0, 90] }, { index: 0.125, rgb: [0, 0, 200] }, { index: 0.25, rgb: [0, 25, 255] }, { index: 0.375, rgb: [0, 152, 255] }, { index: 0.5, rgb: [44, 255, 150] }, { index: 0.625, rgb: [151, 255, 0] }, { index: 0.75, rgb: [255, 234, 0] }, { index: 0.875, rgb: [255, 111, 0] }, { index: 1, rgb: [255, 0, 0] }],
  portland: [{ index: 0, rgb: [12, 51, 131] }, { index: 0.25, rgb: [10, 136, 186] }, { index: 0.5, rgb: [242, 211, 56] }, { index: 0.75, rgb: [242, 143, 56] }, { index: 1, rgb: [217, 30, 30] }],
  blackbody: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.2, rgb: [230, 0, 0] }, { index: 0.4, rgb: [230, 210, 0] }, { index: 0.7, rgb: [255, 255, 255] }, { index: 1, rgb: [160, 200, 255] }],
  earth: [{ index: 0, rgb: [0, 0, 130] }, { index: 0.1, rgb: [0, 180, 180] }, { index: 0.2, rgb: [40, 210, 40] }, { index: 0.4, rgb: [230, 230, 50] }, { index: 0.6, rgb: [120, 70, 20] }, { index: 1, rgb: [255, 255, 255] }],
  electric: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.15, rgb: [30, 0, 100] }, { index: 0.4, rgb: [120, 0, 100] }, { index: 0.6, rgb: [160, 90, 0] }, { index: 0.8, rgb: [230, 200, 0] }, { index: 1, rgb: [255, 250, 220] }],
  alpha: [{ index: 0, rgb: [255, 255, 255, 0] }, { index: 1, rgb: [255, 255, 255, 1] }],
  viridis: [{ index: 0, rgb: [68, 1, 84] }, { index: 0.13, rgb: [71, 44, 122] }, { index: 0.25, rgb: [59, 81, 139] }, { index: 0.38, rgb: [44, 113, 142] }, { index: 0.5, rgb: [33, 144, 141] }, { index: 0.63, rgb: [39, 173, 129] }, { index: 0.75, rgb: [92, 200, 99] }, { index: 0.88, rgb: [170, 220, 50] }, { index: 1, rgb: [253, 231, 37] }],
  inferno: [{ index: 0, rgb: [0, 0, 4] }, { index: 0.13, rgb: [31, 12, 72] }, { index: 0.25, rgb: [85, 15, 109] }, { index: 0.38, rgb: [136, 34, 106] }, { index: 0.5, rgb: [186, 54, 85] }, { index: 0.63, rgb: [227, 89, 51] }, { index: 0.75, rgb: [249, 140, 10] }, { index: 0.88, rgb: [249, 201, 50] }, { index: 1, rgb: [252, 255, 164] }],
  magma: [{ index: 0, rgb: [0, 0, 4] }, { index: 0.13, rgb: [28, 16, 68] }, { index: 0.25, rgb: [79, 18, 123] }, { index: 0.38, rgb: [129, 37, 129] }, { index: 0.5, rgb: [181, 54, 122] }, { index: 0.63, rgb: [229, 80, 100] }, { index: 0.75, rgb: [251, 135, 97] }, { index: 0.88, rgb: [254, 194, 135] }, { index: 1, rgb: [252, 253, 191] }],
  plasma: [{ index: 0, rgb: [13, 8, 135] }, { index: 0.13, rgb: [75, 3, 161] }, { index: 0.25, rgb: [125, 3, 168] }, { index: 0.38, rgb: [168, 34, 150] }, { index: 0.5, rgb: [203, 70, 121] }, { index: 0.63, rgb: [229, 107, 93] }, { index: 0.75, rgb: [248, 148, 65] }, { index: 0.88, rgb: [253, 195, 40] }, { index: 1, rgb: [240, 249, 33] }],
  warm: [{ index: 0, rgb: [125, 0, 179] }, { index: 0.13, rgb: [172, 0, 187] }, { index: 0.25, rgb: [219, 0, 170] }, { index: 0.38, rgb: [255, 0, 130] }, { index: 0.5, rgb: [255, 63, 74] }, { index: 0.63, rgb: [255, 123, 0] }, { index: 0.75, rgb: [234, 176, 0] }, { index: 0.88, rgb: [190, 228, 0] }, { index: 1, rgb: [147, 255, 0] }],
  cool: [{ index: 0, rgb: [125, 0, 179] }, { index: 0.13, rgb: [116, 0, 218] }, { index: 0.25, rgb: [98, 74, 237] }, { index: 0.38, rgb: [68, 146, 231] }, { index: 0.5, rgb: [0, 204, 197] }, { index: 0.63, rgb: [0, 247, 146] }, { index: 0.75, rgb: [0, 255, 88] }, { index: 0.88, rgb: [40, 255, 8] }, { index: 1, rgb: [147, 255, 0] }],
  "rainbow-soft": [{ index: 0, rgb: [125, 0, 179] }, { index: 0.1, rgb: [199, 0, 180] }, { index: 0.2, rgb: [255, 0, 121] }, { index: 0.3, rgb: [255, 108, 0] }, { index: 0.4, rgb: [222, 194, 0] }, { index: 0.5, rgb: [150, 255, 0] }, { index: 0.6, rgb: [0, 255, 55] }, { index: 0.7, rgb: [0, 246, 150] }, { index: 0.8, rgb: [50, 167, 222] }, { index: 0.9, rgb: [103, 51, 235] }, { index: 1, rgb: [124, 0, 186] }],
  bathymetry: [{ index: 0, rgb: [40, 26, 44] }, { index: 0.13, rgb: [59, 49, 90] }, { index: 0.25, rgb: [64, 76, 139] }, { index: 0.38, rgb: [63, 110, 151] }, { index: 0.5, rgb: [72, 142, 158] }, { index: 0.63, rgb: [85, 174, 163] }, { index: 0.75, rgb: [120, 206, 163] }, { index: 0.88, rgb: [187, 230, 172] }, { index: 1, rgb: [253, 254, 204] }],
  cdom: [{ index: 0, rgb: [47, 15, 62] }, { index: 0.13, rgb: [87, 23, 86] }, { index: 0.25, rgb: [130, 28, 99] }, { index: 0.38, rgb: [171, 41, 96] }, { index: 0.5, rgb: [206, 67, 86] }, { index: 0.63, rgb: [230, 106, 84] }, { index: 0.75, rgb: [242, 149, 103] }, { index: 0.88, rgb: [249, 193, 135] }, { index: 1, rgb: [254, 237, 176] }],
  chlorophyll: [{ index: 0, rgb: [18, 36, 20] }, { index: 0.13, rgb: [25, 63, 41] }, { index: 0.25, rgb: [24, 91, 59] }, { index: 0.38, rgb: [13, 119, 72] }, { index: 0.5, rgb: [18, 148, 80] }, { index: 0.63, rgb: [80, 173, 89] }, { index: 0.75, rgb: [132, 196, 122] }, { index: 0.88, rgb: [175, 221, 162] }, { index: 1, rgb: [215, 249, 208] }],
  density: [{ index: 0, rgb: [54, 14, 36] }, { index: 0.13, rgb: [89, 23, 80] }, { index: 0.25, rgb: [110, 45, 132] }, { index: 0.38, rgb: [120, 77, 178] }, { index: 0.5, rgb: [120, 113, 213] }, { index: 0.63, rgb: [115, 151, 228] }, { index: 0.75, rgb: [134, 185, 227] }, { index: 0.88, rgb: [177, 214, 227] }, { index: 1, rgb: [230, 241, 241] }],
  "freesurface-blue": [{ index: 0, rgb: [30, 4, 110] }, { index: 0.13, rgb: [47, 14, 176] }, { index: 0.25, rgb: [41, 45, 236] }, { index: 0.38, rgb: [25, 99, 212] }, { index: 0.5, rgb: [68, 131, 200] }, { index: 0.63, rgb: [114, 156, 197] }, { index: 0.75, rgb: [157, 181, 203] }, { index: 0.88, rgb: [200, 208, 216] }, { index: 1, rgb: [241, 237, 236] }],
  "freesurface-red": [{ index: 0, rgb: [60, 9, 18] }, { index: 0.13, rgb: [100, 17, 27] }, { index: 0.25, rgb: [142, 20, 29] }, { index: 0.38, rgb: [177, 43, 27] }, { index: 0.5, rgb: [192, 87, 63] }, { index: 0.63, rgb: [205, 125, 105] }, { index: 0.75, rgb: [216, 162, 148] }, { index: 0.88, rgb: [227, 199, 193] }, { index: 1, rgb: [241, 237, 236] }],
  oxygen: [{ index: 0, rgb: [64, 5, 5] }, { index: 0.13, rgb: [106, 6, 15] }, { index: 0.25, rgb: [144, 26, 7] }, { index: 0.38, rgb: [168, 64, 3] }, { index: 0.5, rgb: [188, 100, 4] }, { index: 0.63, rgb: [206, 136, 11] }, { index: 0.75, rgb: [220, 174, 25] }, { index: 0.88, rgb: [231, 215, 44] }, { index: 1, rgb: [248, 254, 105] }],
  par: [{ index: 0, rgb: [51, 20, 24] }, { index: 0.13, rgb: [90, 32, 35] }, { index: 0.25, rgb: [129, 44, 34] }, { index: 0.38, rgb: [159, 68, 25] }, { index: 0.5, rgb: [182, 99, 19] }, { index: 0.63, rgb: [199, 134, 22] }, { index: 0.75, rgb: [212, 171, 35] }, { index: 0.88, rgb: [221, 210, 54] }, { index: 1, rgb: [225, 253, 75] }],
  phase: [{ index: 0, rgb: [145, 105, 18] }, { index: 0.13, rgb: [184, 71, 38] }, { index: 0.25, rgb: [186, 58, 115] }, { index: 0.38, rgb: [160, 71, 185] }, { index: 0.5, rgb: [110, 97, 218] }, { index: 0.63, rgb: [50, 123, 164] }, { index: 0.75, rgb: [31, 131, 110] }, { index: 0.88, rgb: [77, 129, 34] }, { index: 1, rgb: [145, 105, 18] }],
  salinity: [{ index: 0, rgb: [42, 24, 108] }, { index: 0.13, rgb: [33, 50, 162] }, { index: 0.25, rgb: [15, 90, 145] }, { index: 0.38, rgb: [40, 118, 137] }, { index: 0.5, rgb: [59, 146, 135] }, { index: 0.63, rgb: [79, 175, 126] }, { index: 0.75, rgb: [120, 203, 104] }, { index: 0.88, rgb: [193, 221, 100] }, { index: 1, rgb: [253, 239, 154] }],
  temperature: [{ index: 0, rgb: [4, 35, 51] }, { index: 0.13, rgb: [23, 51, 122] }, { index: 0.25, rgb: [85, 59, 157] }, { index: 0.38, rgb: [129, 79, 143] }, { index: 0.5, rgb: [175, 95, 130] }, { index: 0.63, rgb: [222, 112, 101] }, { index: 0.75, rgb: [249, 146, 66] }, { index: 0.88, rgb: [249, 196, 65] }, { index: 1, rgb: [232, 250, 91] }],
  turbidity: [{ index: 0, rgb: [34, 31, 27] }, { index: 0.13, rgb: [65, 50, 41] }, { index: 0.25, rgb: [98, 69, 52] }, { index: 0.38, rgb: [131, 89, 57] }, { index: 0.5, rgb: [161, 112, 59] }, { index: 0.63, rgb: [185, 140, 66] }, { index: 0.75, rgb: [202, 174, 88] }, { index: 0.88, rgb: [216, 209, 126] }, { index: 1, rgb: [233, 246, 171] }],
  "velocity-blue": [{ index: 0, rgb: [17, 32, 64] }, { index: 0.13, rgb: [35, 52, 116] }, { index: 0.25, rgb: [29, 81, 156] }, { index: 0.38, rgb: [31, 113, 162] }, { index: 0.5, rgb: [50, 144, 169] }, { index: 0.63, rgb: [87, 173, 176] }, { index: 0.75, rgb: [149, 196, 189] }, { index: 0.88, rgb: [203, 221, 211] }, { index: 1, rgb: [254, 251, 230] }],
  "velocity-green": [{ index: 0, rgb: [23, 35, 19] }, { index: 0.13, rgb: [24, 64, 38] }, { index: 0.25, rgb: [11, 95, 45] }, { index: 0.38, rgb: [39, 123, 35] }, { index: 0.5, rgb: [95, 146, 12] }, { index: 0.63, rgb: [152, 165, 18] }, { index: 0.75, rgb: [201, 186, 69] }, { index: 0.88, rgb: [233, 216, 137] }, { index: 1, rgb: [255, 253, 205] }],
  cubehelix: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.07, rgb: [22, 5, 59] }, { index: 0.13, rgb: [60, 4, 105] }, { index: 0.2, rgb: [109, 1, 135] }, { index: 0.27, rgb: [161, 0, 147] }, { index: 0.33, rgb: [210, 2, 142] }, { index: 0.4, rgb: [251, 11, 123] }, { index: 0.47, rgb: [255, 29, 97] }, { index: 0.53, rgb: [255, 54, 69] }, { index: 0.6, rgb: [255, 85, 46] }, { index: 0.67, rgb: [255, 120, 34] }, { index: 0.73, rgb: [255, 157, 37] }, { index: 0.8, rgb: [241, 191, 57] }, { index: 0.87, rgb: [224, 220, 93] }, { index: 0.93, rgb: [218, 241, 142] }, { index: 1, rgb: [227, 253, 198] }]
};
function Er(t, l, x) {
  return t * (1 - x) + l * x;
}
var wr = Er, Ye = Rr, te = wr, _r = Cr;
function Cr(t) {
  var l, x, a, R, y, v, c, g, o, i, s;
  if (t || (t = {}), g = (t.nshades || 72) - 1, c = t.format || "hex", v = t.colormap, v || (v = "jet"), typeof v == "string") {
    if (v = v.toLowerCase(), !Ye[v])
      throw Error(v + " not a supported colorscale");
    y = Ye[v];
  } else if (Array.isArray(v))
    y = v.slice();
  else
    throw Error("unsupported colormap option", v);
  if (y.length > g + 1)
    throw new Error(
      v + " map requires nshades to be at least size " + y.length
    );
  Array.isArray(t.alpha) ? t.alpha.length !== 2 ? i = [1, 1] : i = t.alpha.slice() : typeof t.alpha == "number" ? i = [t.alpha, t.alpha] : i = [1, 1], l = y.map(function(C) {
    return Math.round(C.index * g);
  }), i[0] = Math.min(Math.max(i[0], 0), 1), i[1] = Math.min(Math.max(i[1], 0), 1);
  var m = y.map(function(C, w) {
    var b = y[w].index, d = y[w].rgb.slice();
    return d.length === 4 && d[3] >= 0 && d[3] <= 1 || (d[3] = i[0] + (i[1] - i[0]) * b), d;
  }), o = [];
  for (s = 0; s < l.length - 1; ++s) {
    R = l[s + 1] - l[s], x = m[s], a = m[s + 1];
    for (var S = 0; S < R; S++) {
      var _ = S / R;
      o.push([
        Math.round(te(x[0], a[0], _)),
        Math.round(te(x[1], a[1], _)),
        Math.round(te(x[2], a[2], _)),
        te(x[3], a[3], _)
      ]);
    }
  }
  return o.push(y[y.length - 1].rgb.concat(i[1])), c === "hex" ? o = o.map(Sr) : c === "rgbaString" ? o = o.map(Pr) : c === "float" && (o = o.map(jr)), o;
}
function jr(t) {
  return [
    t[0] / 255,
    t[1] / 255,
    t[2] / 255,
    t[3]
  ];
}
function Sr(t) {
  for (var l, x = "#", a = 0; a < 3; ++a)
    l = t[a], l = l.toString(16), x += ("00" + l).substr(l.length);
  return x;
}
function Pr(t) {
  return "rgba(" + t.join(",") + ")";
}
const ze = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ dark: !1 });
function Be() {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ze);
}
function kr(t) {
  const { children: l, dark: x } = t;
  return /* @__PURE__ */ u.jsx(ze.Provider, { value: { dark: x }, children: l });
}
const Ze = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ duration: 1, currentTime: 0, playbackRate: 1, mode: "page", setDuration: () => {
}, setCurrentTime: () => {
}, setPlaybackRate: () => {
}, pause: () => {
} });
function J() {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Ze);
}
const Or = 10;
function Dr(t) {
  const { children: l, src: x } = t, a = !!t.settings, [R, y] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1), [v, c] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), [g, i] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1), [s, m] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("page"), o = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [S, _] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1), { dark: C } = Be(), w = C ? "dark" : "light";
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    o.current !== null && (o.current.duration && y(o.current.duration), setInterval(function() {
      o.current && o.current.currentTime && c(o.current.currentTime);
    }, Or));
  }, [o.current]);
  const b = (k) => {
    o.current !== null && o.current.duration && y(o.current.duration);
  }, d = (k) => {
    o.current !== null && c(o.current.currentTime);
  }, $ = (k) => {
    o.current !== null && o.current.duration && W(o.current.playbackRate);
  }, Y = (k) => {
    o.current !== null && (o.current.currentTime = k), c(k);
  }, W = (k) => {
    o.current !== null && (o.current.playbackRate = k), i(k);
  }, B = () => {
    o.current !== null && o.current.pause();
  };
  return /* @__PURE__ */ u.jsxs(Ze.Provider, { value: { duration: R, currentTime: v, playbackRate: g, mode: s, setDuration: y, setCurrentTime: Y, setPlaybackRate: W, pause: B }, children: [
    l,
    /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "stretch", gap: 5, marginTop: 5 }, children: [
      /* @__PURE__ */ u.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "row", alignItems: "stretch", gap: 5 }, children: [
        /* @__PURE__ */ u.jsx("audio", { ref: o, controls: !0, style: { width: "100%" }, onTimeUpdate: d, onDurationChange: b, onRateChange: $, controlsList: "nodownload", children: /* @__PURE__ */ u.jsx("source", { src: x }) }),
        a && /* @__PURE__ */ u.jsx("button", { className: w, onClick: () => {
          _(!S);
        }, children: "Settings" })
      ] }),
      a && S && /* @__PURE__ */ u.jsxs("div", { style: { display: "grid", flexDirection: "row", fontFamily: "monospace", gridTemplateColumns: "1fr 3fr", columnGap: 5, rowGap: 5 }, children: [
        /* @__PURE__ */ u.jsx("div", { className: `gridcell header ${w}`, children: "Playback Speed" }),
        /* @__PURE__ */ u.jsx("div", { style: { display: "flex", flexDirection: "row", gap: 5 }, children: /* @__PURE__ */ u.jsxs("div", { className: `slidecontainer ${w}`, children: [
          /* @__PURE__ */ u.jsx("div", { className: `slidervalue ${w}`, children: `${g.toFixed(1)}x` }),
          /* @__PURE__ */ u.jsx("input", { type: "range", min: "0.1", max: "2.0", value: g, className: `slider ${w}`, id: "myRange", step: "0.1", onChange: (k) => {
            W(Number(k.target.value));
          } })
        ] }) }),
        /* @__PURE__ */ u.jsx("div", { className: `gridcell header ${w}`, children: "Playhead Mode" }),
        /* @__PURE__ */ u.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr 1fr", gridTemplateRows: "1fr" }, children: [
          /* @__PURE__ */ u.jsx("div", { className: `gridcell ${w} ${s === "page" && "selected"}`, onClick: () => {
            m("page");
          }, children: "Page" }),
          /* @__PURE__ */ u.jsx("div", { className: `gridcell ${w} ${s === "stop" && "selected"}`, onClick: () => {
            m("stop");
          }, children: "Stop" }),
          /* @__PURE__ */ u.jsx("div", { className: `gridcell ${w} ${s === "loop" && "selected"}`, onClick: () => {
            m("loop");
          }, children: "Loop" }),
          /* @__PURE__ */ u.jsx("div", { className: `gridcell ${w} ${s === "continue" && "selected"}`, onClick: () => {
            m("continue");
          }, children: "Continue" })
        ] })
      ] })
    ] })
  ] });
}
const qe = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ startTime: 0, endTime: 1, zoomedDuration: 1, isZoomed: !1, setStartTime: () => {
}, setEndTime: () => {
}, setCenterTime: () => {
}, zoomIn: () => {
}, zoomOut: () => {
} });
function he() {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(qe);
}
function Mr(t) {
  const { children: l } = t, { duration: x, currentTime: a, mode: R, pause: y, setCurrentTime: v } = J(), [c, g] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), [i, s] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(x), m = i - c, o = (b) => {
    g(b - m / 2), s(b + m / 2);
  };
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    g(0), s(x);
  }, [x]), (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (R === "stop") {
      if (a >= i && a <= i + 0.1)
        y(), v(c);
      else if (a > i + 0.1) {
        const b = i, d = i + m;
        g(b), s(d);
      } else if (a < c - 0.1) {
        const b = c - m, d = c;
        g(b), s(d);
      }
    } else if (R === "loop") {
      if (a >= i && a <= i + 0.1)
        v(c);
      else if (a > i + 0.1) {
        const b = i, d = i + m;
        g(b), s(d);
      } else if (a < c - 0.1) {
        const b = c - m, d = c;
        g(b), s(d);
      }
    } else if (R === "page") {
      if (a >= i && a <= i + 0.1)
        C();
      else if (a > i + 0.1) {
        const b = i, d = i + m;
        g(b), s(d);
      } else if (a < c - 0.1) {
        const b = c - m, d = c;
        g(b), s(d);
      }
    }
  }, [a, R]);
  const S = () => {
    const b = Math.max(0, c + 0.2 * m), d = Math.min(x, i - 0.2 * m);
    g(b), s(d), v(b);
  }, _ = () => {
    const b = Math.max(0, c - 0.3333333333333333 * m), d = Math.min(x, i + 1 / 3 * m);
    g(b), s(d), v(b);
  }, C = () => {
    const b = Math.min(x, i + m), d = Math.max(0, b - m);
    g(d), s(b);
  }, w = c > 0 || i < x;
  return /* @__PURE__ */ u.jsx(qe.Provider, { value: { startTime: c, endTime: i, zoomedDuration: m, isZoomed: w, setStartTime: g, setEndTime: s, setCenterTime: o, zoomIn: S, zoomOut: _ }, children: l });
}
function $r(t) {
  const { children: l, height: x } = t, { duration: a, setCurrentTime: R } = J(), y = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), { startTime: v, endTime: c } = he(), g = (i) => {
    var m;
    const s = (m = y.current) == null ? void 0 : m.getBoundingClientRect();
    if (s) {
      const { left: o, right: S } = s;
      let _ = v + (c - v) * (i.clientX - o) / (S - o);
      _ < 0 && (_ = 0), _ > a && (_ = a), R(_);
    }
  };
  return /* @__PURE__ */ u.jsx("svg", { ref: y, width: "100%", height: x, viewBox: `${v},0,${c - v},100`, cursor: "pointer", preserveAspectRatio: "none", onClick: g, children: l });
}
const Ar = 0.01;
function Ir(t) {
  const { children: l, height: x } = t, { duration: a, setCurrentTime: R } = J(), { startTime: y, endTime: v, zoomedDuration: c, isZoomed: g, setStartTime: i, setEndTime: s, zoomIn: m, zoomOut: o, setCenterTime: S } = he(), _ = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [C, w] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), [b, d] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), { dark: $ } = Be(), Y = $ ? "dark" : "light", W = !g && C && b, B = g && C, k = (L) => {
    var O;
    const F = (O = _.current) == null ? void 0 : O.getBoundingClientRect();
    if (F) {
      const { left: A, right: U } = F;
      return a * (L.clientX - A) / (U - A);
    }
    return null;
  }, ae = (L) => {
    w(k(L));
  }, X = (L) => {
    const F = k(L);
    if (d(F), F && B) {
      const O = Math.min(Math.max(c / 2, F), a - c / 2);
      S(O), R(O - c / 2);
    }
  }, oe = (L) => {
    W && (b - C >= Ar ? (i(C), s(b), R(C)) : (i(0), s(a), R(0))), w(null), d(null);
  };
  return /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", flexDirection: "row", gap: 5 }, children: [
    /* @__PURE__ */ u.jsx("button", { className: Y, onClick: o, children: "Zoom Out" }),
    /* @__PURE__ */ u.jsxs("svg", { ref: _, width: "100%", height: x, viewBox: `0,0,${a},100`, cursor: g ? "grabbing" : "zoom-in", preserveAspectRatio: "none", onPointerDown: ae, onPointerUp: oe, onPointerMove: X, children: [
      l,
      /* @__PURE__ */ u.jsx("rect", { x: 0, width: y, y: "0", height: "100", style: { fill: "white", opacity: 0.5 } }),
      /* @__PURE__ */ u.jsx("rect", { x: v, width: 100 - v, y: "0", height: "100", style: { fill: "white", opacity: 0.5 } }),
      W && b > C && /* @__PURE__ */ u.jsx("rect", { x: C, width: b - C, y: "0", height: "100", style: { fill: "red", opacity: 0.5 } })
    ] }),
    /* @__PURE__ */ u.jsx("button", { className: Y, style: { fontFamily: "monospace" }, onClick: m, children: "Zoom In" })
  ] });
}
function Fr(t) {
  const { dataURL: l } = t, x = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), { duration: a, currentTime: R } = J(), { zoomedDuration: y } = he();
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
    /* @__PURE__ */ u.jsx(
      "image",
      {
        width: a,
        height: 100,
        x: 0,
        y: 0,
        href: l,
        preserveAspectRatio: "none",
        pointerEvents: "none"
      }
    ),
    /* @__PURE__ */ u.jsx(
      "line",
      {
        ref: x,
        stroke: "red",
        strokeWidth: 5e-3 * y,
        x1: R,
        x2: R,
        y1: 0,
        y2: 100
      }
    )
  ] });
}
function Nr(t) {
  var l = t.map(function(a) {
    return Math.max.apply(Math, a);
  }), x = Math.max.apply(null, l);
  return x;
}
function Wr(t) {
  var l = t.map(function(a) {
    return Math.min.apply(Math, a);
  }), x = Math.min.apply(null, l);
  return x;
}
function Lr(t) {
  const { sxx: l, specHeight: x, navigator: a, colormap: R, transparent: y } = t, v = t.navHeight ? t.navHeight : 0, c = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [g, i] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
  J();
  const s = _r({
    colormap: R,
    nshades: 256,
    format: "rgba",
    alpha: 255
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (c.current) {
      const o = c.current.getContext("2d");
      if (o) {
        const S = Nr(l), _ = Wr(l);
        if (typeof S < "u" && typeof _ < "u") {
          let C = new ImageData(l[0].length, l.length);
          for (let w = l.length - 1; w >= 0; w--)
            for (let b = 0; b < l[0].length; b++) {
              const d = Math.floor(255 * (l[w][b] - _) / (S - _)), $ = ((l.length - w) * l[0].length + b) * 4;
              C.data[$] = s[d][0], C.data[$ + 1] = s[d][1], C.data[$ + 2] = s[d][2], C.data[$ + 3] = y ? d : 255;
            }
          o.putImageData(C, 0, 0), i(c.current.toDataURL());
        }
      }
    }
  }, [l, c, R, y]);
  const m = /* @__PURE__ */ u.jsx(Fr, { dataURL: g });
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
    /* @__PURE__ */ u.jsx("canvas", { hidden: !0, ref: c, height: l.length, width: l[0].length }),
    /* @__PURE__ */ u.jsx(Mr, { children: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
      /* @__PURE__ */ u.jsx($r, { height: x, children: m }),
      a && /* @__PURE__ */ u.jsx(Ir, { height: v, children: m })
    ] }) })
  ] });
}
const Yr = (t) => {
  const { sxx: l, src: x, specHeight: a, navHeight: R } = t, y = !!t.navigator, v = !!t.settings, c = t.colormap ? t.colormap : "viridis", g = !!t.transparent, i = !!t.dark;
  return /* @__PURE__ */ u.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ u.jsx(kr, { dark: i, children: /* @__PURE__ */ u.jsx(Dr, { src: x, settings: v, children: /* @__PURE__ */ u.jsx(
    Lr,
    {
      sxx: l,
      specHeight: a,
      navHeight: R,
      colormap: c,
      transparent: g,
      navigator: y
    }
  ) }) }) });
};



/***/ })

}]);
//# sourceMappingURL=vendors-node_modules_react-audio-spectrogram-player_dist_react-audio-spectrogram-player_es_js.661e58e36a0ad26610ad.js.map